Added object offsets to exporters, converted tabs to spaces, added

method to get model nodes anywhere in the hierarchy by name, update 
model bounds in SkinMesh after deforming mesh.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4038 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Andrzej Kapolka
2006-04-20 02:04:56 +00:00
parent 6bf2506f50
commit d544f127a4
4 changed files with 172 additions and 141 deletions
@@ -64,6 +64,26 @@ public class ModelNode extends Node
super(name);
}
/**
* Recursively searches the scene graph rooted at this node for a
* node with the provided name.
*/
public Spatial getDescendant (String name)
{
for (int ii = 0, nn = getQuantity(); ii < nn; ii++) {
Spatial child = getChild(ii);
if (child.getName().equals(name)) {
return child;
} else if (child instanceof ModelNode) {
child = ((ModelNode)child).getDescendant(name);
if (child != null) {
return child;
}
}
}
return null;
}
/**
* Returns a reference to the model space transform of the node.
*/
@@ -269,6 +269,7 @@ public class SkinMesh extends ModelMesh
BufferUtils.setInBuffer(_normal, nbuf, idx);
}
}
updateModelBound();
}
/** The groups of vertices influenced by different sets of bones. */