Updated to reflect changes in JME and changed hashCode to hash on the

node name instead of the identity, to ensure consistent ordering.


git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@77 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Andrzej Kapolka
2006-11-16 23:11:27 +00:00
parent a8e1855207
commit cfe8c0f2df
4 changed files with 17 additions and 2 deletions
@@ -163,6 +163,7 @@ public class JmeCanvasApp extends JmeApp
renderer.setHeadless(true); renderer.setHeadless(true);
setRenderer(renderer); setRenderer(renderer);
_display.setRenderer(renderer); _display.setRenderer(renderer);
_display.getCurrentContext().setupRecords(renderer);
DisplaySystem.updateStates(renderer); DisplaySystem.updateStates(renderer);
if (!init()) { if (!init()) {
+1 -1
View File
@@ -917,7 +917,7 @@ public class Model extends ModelNode
{ {
// update the bounds with an identity transform (which will be // update the bounds with an identity transform (which will be
// overwritten after this method is called) // overwritten after this method is called)
getWorldRotation().set(Quaternion.IDENTITY); getWorldRotation().loadIdentity();
getWorldTranslation().set(Vector3f.ZERO); getWorldTranslation().set(Vector3f.ZERO);
getWorldScale().set(Vector3f.UNIT_XYZ); getWorldScale().set(Vector3f.UNIT_XYZ);
for (int ii = 0, nn = getQuantity(); ii < nn; ii++) { for (int ii = 0, nn = getQuantity(); ii < nn; ii++) {
@@ -86,6 +86,13 @@ public class ModelMesh extends TriMesh
super(name); super(name);
} }
@Override // documentation inherited
public int hashCode ()
{
// hash on the name rather than the identity for consistent ordering
return getName().hashCode();
}
/** /**
* Reconfigures this model with a new set of (sub-)properties. Textures * Reconfigures this model with a new set of (sub-)properties. Textures
* must be (re-)resolved after calling this method. * must be (re-)resolved after calling this method.
@@ -64,6 +64,13 @@ public class ModelNode extends Node
super(name); super(name);
} }
@Override // documentation inherited
public int hashCode ()
{
// hash on the name rather than the identity for consistent ordering
return getName().hashCode();
}
/** /**
* Recursively searches the scene graph rooted at this node for a * Recursively searches the scene graph rooted at this node for a
* node with the provided name. * node with the provided name.
@@ -391,7 +398,7 @@ public class ModelNode extends Node
Vector3f translation, Quaternion rotation, Vector3f scale, Vector3f translation, Quaternion rotation, Vector3f scale,
Matrix4f result) Matrix4f result)
{ {
result.set(rotation); result.setRotationQuaternion(rotation);
result.setTranslation(translation); result.setTranslation(translation);
result.m00 *= scale.x; result.m00 *= scale.x;