/** * Internal use only. */ @Override protected void controlUpdate(float tpf) { if (skeleton != null) { skeleton.reset(); // reset skeleton to bind pose } TempVars vars = TempVars.get(); for (int i = 0; i < channels.size(); i++) { channels.get(i).update(tpf, vars); } vars.release(); if (skeleton != null) { skeleton.updateWorldVectors(); } }
/** * Resets the node's feature to its starting transformation. */ private void reset() { if (spatial != null) { spatial.setLocalTransform(spatialStartTransform); for (SimulationNode child : children) { child.reset(); } } else if (skeleton != null) { for (Entry<Bone, Transform> entry : boneStartTransforms.entrySet()) { Transform t = entry.getValue(); entry.getKey().setBindTransforms(t.getTranslation(), t.getRotation(), t.getScale()); entry.getKey().updateModelTransforms(); } skeleton.reset(); } }
/** * Internal use only. */ @Override protected void controlUpdate(float tpf) { if (skeleton != null) { skeleton.reset(); // reset skeleton to bind pose } TempVars vars = TempVars.get(); for (int i = 0; i < channels.size(); i++) { channels.get(i).update(tpf, vars); } vars.release(); if (skeleton != null) { skeleton.updateWorldVectors(); } }
/** * Internal use only. */ @Override protected void controlUpdate(float tpf) { if (skeleton != null) { skeleton.reset(); // reset skeleton to bind pose } TempVars vars = TempVars.get(); for (int i = 0; i < channels.size(); i++) { channels.get(i).update(tpf, vars); } vars.release(); if (skeleton != null) { skeleton.updateWorldVectors(); } }
/** * Creates a debugger with no length data. The wires will be a connection * between the bones' heads only. The points will show the bones' heads only * and no dotted line of inter bones connection will be visible. * * @param name the name of the debugger's node * @param skeleton the skeleton that will be shown */ public SkeletonDebugger(String name, Skeleton skeleton, boolean guessBonesOrientation) { super(name); this.skeleton = skeleton; skeleton.reset(); skeleton.updateWorldVectors(); Map<Integer, Float> boneLengths = new HashMap<Integer, Float>(); for (Bone bone : skeleton.getRoots()) { computeLength(bone, boneLengths, skeleton); } bones = new SkeletonBone(skeleton, boneLengths, guessBonesOrientation); this.attachChild(bones); interBoneWires = new SkeletonInterBoneWire(skeleton, boneLengths, guessBonesOrientation); Geometry g = new Geometry(name + "_interwires", interBoneWires); g.setBatchHint(BatchHint.Never); this.attachChild(g); }
this.skeleton.reset(); this.skeleton.updateWorldVectors(); this.guessBonesOrientation = guessBonesOrientation;
@Override protected void controlUpdate(float tpf) { skeleton.reset(); // reset skeleton to bind pose