fix libgdx compatibele to run tests from playground

This commit is contained in:
Longri 2016-06-18 10:34:39 +02:00 committed by Emux
parent f7f20f486e
commit d1fd03a52f

View File

@ -106,8 +106,8 @@ public class SharedModel implements RenderableProvider {
copy.translation.set(0,0,0); copy.translation.set(0,0,0);
copy.rotation.idt(); copy.rotation.idt();
copy.scale.set(1,1,1); copy.scale.set(1,1,1);
} else if (parentTransform && copy.parent != null) } else if (parentTransform && copy.getParent() != null)
this.transform.mul(node.parent.globalTransform); this.transform.mul(node.getParent().globalTransform);
setBones(); setBones();
copyAnimations(model.animations); copyAnimations(model.animations);
calculateTransforms(); calculateTransforms();
@ -234,10 +234,8 @@ public class SharedModel implements RenderableProvider {
} }
private Node copyNode(Node parent, Node node) { private Node copyNode(Node parent, Node node) {
Node copy = new Node(); Node copy = parent.copy();
copy.id = node.id; copy.id = node.id;
//copy.boneId = node.boneId;
copy.parent = parent;
copy.translation.set(node.translation); copy.translation.set(node.translation);
copy.rotation.set(node.rotation); copy.rotation.set(node.rotation);
copy.scale.set(node.scale); copy.scale.set(node.scale);
@ -246,8 +244,8 @@ public class SharedModel implements RenderableProvider {
for(NodePart nodePart: node.parts) { for(NodePart nodePart: node.parts) {
copy.parts.add(copyNodePart(nodePart)); copy.parts.add(copyNodePart(nodePart));
} }
for(Node child: node.children) { for(Node child: node.getChildren()) {
copy.children.add(copyNode(copy, child)); copy.addChild(copyNode(copy, child));
} }
return copy; return copy;
} }
@ -256,8 +254,8 @@ public class SharedModel implements RenderableProvider {
NodePart copy = new NodePart(); NodePart copy = new NodePart();
copy.meshPart = new MeshPart(); copy.meshPart = new MeshPart();
copy.meshPart.id = nodePart.meshPart.id; copy.meshPart.id = nodePart.meshPart.id;
copy.meshPart.indexOffset = nodePart.meshPart.indexOffset; copy.meshPart.offset = nodePart.meshPart.offset;
copy.meshPart.numVertices = nodePart.meshPart.numVertices; copy.meshPart.size = nodePart.meshPart.size;
copy.meshPart.primitiveType = nodePart.meshPart.primitiveType; copy.meshPart.primitiveType = nodePart.meshPart.primitiveType;
copy.meshPart.mesh = nodePart.meshPart.mesh; copy.meshPart.mesh = nodePart.meshPart.mesh;
@ -286,15 +284,12 @@ public class SharedModel implements RenderableProvider {
continue; continue;
NodeAnimation nodeAnim = new NodeAnimation(); NodeAnimation nodeAnim = new NodeAnimation();
nodeAnim.node = node; nodeAnim.node = node;
for (final NodeKeyframe kf : nanim.keyframes) { for (final NodeKeyframe kf : nanim.translation) {
NodeKeyframe keyframe = new NodeKeyframe(); NodeKeyframe keyframe = new NodeKeyframe(kf.keytime,kf);
keyframe.keytime = kf.keytime; keyframe.keytime = kf.keytime;
keyframe.rotation.set(kf.rotation); nodeAnim.translation.add(keyframe);
keyframe.scale.set(kf.scale);
keyframe.translation.set(kf.translation);
nodeAnim.keyframes.add(keyframe);
} }
if (nodeAnim.keyframes.size > 0) if (nodeAnim.translation.size > 0)
animation.nodeAnimations.add(nodeAnim); animation.nodeAnimations.add(nodeAnim);
} }
if (animation.nodeAnimations.size > 0) if (animation.nodeAnimations.size > 0)
@ -346,7 +341,7 @@ public class SharedModel implements RenderableProvider {
} }
} }
for(Node child: node.children) { for(Node child: node.getChildren()) {
getRenderables(child, renderables, pool); getRenderables(child, renderables, pool);
} }
} }