|
@@ -206,43 +206,18 @@ public class SkeletonControl extends AbstractControl implements Cloneable {
|
|
|
}
|
|
|
|
|
|
private void findTargets(Node node) {
|
|
|
- Mesh sharedMesh = null;
|
|
|
-
|
|
|
for (Spatial child : node.getChildren()) {
|
|
|
if (child instanceof Geometry) {
|
|
|
Geometry geom = (Geometry) child;
|
|
|
-
|
|
|
- // is this geometry using a shared mesh?
|
|
|
- Mesh childSharedMesh = geom.getUserData(UserData.JME_SHAREDMESH);
|
|
|
-
|
|
|
- if (childSharedMesh != null) {
|
|
|
- // Don’t bother with non-animated shared meshes
|
|
|
- if (childSharedMesh.isAnimated()) {
|
|
|
- // child is using shared mesh,
|
|
|
- // so animate the shared mesh but ignore child
|
|
|
- if (sharedMesh == null) {
|
|
|
- sharedMesh = childSharedMesh;
|
|
|
- } else if (sharedMesh != childSharedMesh) {
|
|
|
- throw new IllegalStateException("Two conflicting shared meshes for " + node);
|
|
|
- }
|
|
|
- materials.add(geom.getMaterial());
|
|
|
- }
|
|
|
- } else {
|
|
|
- Mesh mesh = geom.getMesh();
|
|
|
- if (mesh.isAnimated()) {
|
|
|
- targets.add(mesh);
|
|
|
- materials.add(geom.getMaterial());
|
|
|
- }
|
|
|
+ Mesh mesh = geom.getMesh();
|
|
|
+ if (mesh.isAnimated()) {
|
|
|
+ targets.add(mesh);
|
|
|
+ materials.add(geom.getMaterial());
|
|
|
}
|
|
|
} else if (child instanceof Node) {
|
|
|
findTargets((Node) child);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- if (sharedMesh != null) {
|
|
|
- targets.add(sharedMesh);
|
|
|
- }
|
|
|
-
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -263,7 +238,7 @@ public class SkeletonControl extends AbstractControl implements Cloneable {
|
|
|
softwareSkinUpdate(mesh, offsetMatrices);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
private void controlRenderHardware() {
|
|
|
offsetMatrices = skeleton.computeSkinningMatrices();
|
|
|
for (Material m : materials) {
|