|
|
@ -79,6 +79,10 @@ public class ArmatureNode extends Node { |
|
|
|
public ArmatureNode(Armature armature, Node joints, Node wires, Node outlines, List<Joint> deformingJoints) { |
|
|
|
public ArmatureNode(Armature armature, Node joints, Node wires, Node outlines, List<Joint> deformingJoints) { |
|
|
|
this.armature = armature; |
|
|
|
this.armature = armature; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Geometry origin = new Geometry("Armature Origin", new JointShape()); |
|
|
|
|
|
|
|
setColor(origin, ColorRGBA.Green); |
|
|
|
|
|
|
|
attach(joints, true, origin); |
|
|
|
|
|
|
|
|
|
|
|
for (Joint joint : armature.getRoots()) { |
|
|
|
for (Joint joint : armature.getRoots()) { |
|
|
|
createSkeletonGeoms(joint, joints, wires, outlines, deformingJoints); |
|
|
|
createSkeletonGeoms(joint, joints, wires, outlines, deformingJoints); |
|
|
|
} |
|
|
|
} |
|
|
@ -253,14 +257,13 @@ public class ArmatureNode extends Node { |
|
|
|
return nbCol; |
|
|
|
return nbCol; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void updateBoneMesh(Geometry bGeom, Vector3f start, Vector3f[] ends) { |
|
|
|
private void updateBoneMesh(Geometry geom, Vector3f start, Vector3f[] ends) { |
|
|
|
VertexBuffer pos = bGeom.getMesh().getBuffer(VertexBuffer.Type.Position); |
|
|
|
if (geom.getMesh() instanceof ArmatureInterJointsWire) { |
|
|
|
FloatBuffer fb = (FloatBuffer) pos.getData(); |
|
|
|
((ArmatureInterJointsWire) geom.getMesh()).updatePoints(start, ends); |
|
|
|
fb.rewind(); |
|
|
|
} else if (geom.getMesh() instanceof Line) { |
|
|
|
fb.put(new float[]{start.x, start.y, start.z, |
|
|
|
((Line) geom.getMesh()).updatePoints(start, ends[0]); |
|
|
|
ends[0].x, ends[0].y, ends[0].z,}); |
|
|
|
} |
|
|
|
pos.updateData(fb); |
|
|
|
geom.updateModelBound(); |
|
|
|
bGeom.updateModelBound(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void setColor(Geometry g, ColorRGBA color) { |
|
|
|
private void setColor(Geometry g, ColorRGBA color) { |
|
|
|