final void reset() { if (skeleton != null) { skeleton.resetAndUpdate(); } }
public void reset(boolean rewind){ if(rewind){ setTime(0); if(control.getSkeleton()!=null){ control.getSkeleton().resetAndUpdate(); }else{ TempVars vars = TempVars.get(); update(0, vars); vars.release(); } } animation = null; notified = false; }
/** * Generate physics shapes and bone links for the skeleton. * * @param model the spatial with the model's SkeletonControl (not null) */ protected void scanSpatial(Spatial model) { AnimControl animControl = model.getControl(AnimControl.class); Map<Integer, List<Float>> pointsMap = null; if (weightThreshold == -1.0f) { pointsMap = RagdollUtils.buildPointMap(model); } skeleton = animControl.getSkeleton(); skeleton.resetAndUpdate(); for (int i = 0; i < skeleton.getRoots().length; i++) { Bone childBone = skeleton.getRoots()[i]; if (childBone.getParent() == null) { logger.log(Level.FINE, "Found root bone in skeleton {0}", skeleton); boneRecursion(model, childBone, baseRigidBody, 1, pointsMap); } } }
/** * Generate physics shapes and bone links for the skeleton. * * @param model the spatial with the model's SkeletonControl (not null) */ protected void scanSpatial(Spatial model) { AnimControl animControl = model.getControl(AnimControl.class); Map<Integer, List<Float>> pointsMap = null; if (weightThreshold == -1.0f) { pointsMap = RagdollUtils.buildPointMap(model); } skeleton = animControl.getSkeleton(); skeleton.resetAndUpdate(); for (int i = 0; i < skeleton.getRoots().length; i++) { Bone childBone = skeleton.getRoots()[i]; if (childBone.getParent() == null) { logger.log(Level.FINE, "Found root bone in skeleton {0}", skeleton); boneRecursion(model, childBone, baseRigidBody, 1, pointsMap); } } }
final void reset() { if (skeleton != null) { skeleton.resetAndUpdate(); } }
final void reset() { if (skeleton != null) { skeleton.resetAndUpdate(); } }
protected void scanSpatial(Spatial model) { AnimControl animControl = model.getControl(AnimControl.class); Map<Integer, List<Float>> pointsMap = null; if (weightThreshold == -1.0f) { pointsMap = RagdollUtils.buildPointMap(model); } skeleton = animControl.getSkeleton(); skeleton.resetAndUpdate(); for (int i = 0; i < skeleton.getRoots().length; i++) { Bone childBone = skeleton.getRoots()[i]; if (childBone.getParent() == null) { logger.log(Level.FINE, "Found root bone in skeleton {0}", skeleton); boneRecursion(model, childBone, baseRigidBody, 1, pointsMap); } } }
public void reset(boolean rewind){ if(rewind){ setTime(0); if(control.getSkeleton()!=null){ control.getSkeleton().resetAndUpdate(); }else{ TempVars vars = TempVars.get(); update(0, vars); vars.release(); } } animation = null; // System.out.println("Setting notified false"); notified = false; }
public void reset(boolean rewind){ if(rewind){ setTime(0); if(control.getSkeleton()!=null){ control.getSkeleton().resetAndUpdate(); }else{ TempVars vars = TempVars.get(); update(0, vars); vars.release(); } } animation = null; notified = false; }
/** * Generate physics shapes and bone links for the skeleton. * * @param model the spatial with the model's SkeletonControl (not null) */ protected void scanSpatial(Spatial model) { AnimControl animControl = model.getControl(AnimControl.class); Map<Integer, List<Float>> pointsMap = null; if (weightThreshold == -1.0f) { pointsMap = RagdollUtils.buildPointMap(model); } skeleton = animControl.getSkeleton(); skeleton.resetAndUpdate(); for (int i = 0; i < skeleton.getRoots().length; i++) { Bone childBone = skeleton.getRoots()[i]; if (childBone.getParent() == null) { logger.log(Level.FINE, "Found root bone in skeleton {0}", skeleton); boneRecursion(model, childBone, baseRigidBody, 1, pointsMap); } } }
private void scanSpatial(Spatial model) { AnimControl animControl = model.getControl(AnimControl.class); Map<Integer, List<Float>> pointsMap = null; if (weightThreshold == -1.0f) { pointsMap = RagdollUtils.buildPointMap(model); } skeleton = animControl.getSkeleton(); skeleton.resetAndUpdate(); for (int i = 0; i < skeleton.getRoots().length; i++) { Bone childBone = skeleton.getRoots()[i]; if (childBone.getParent() == null) { logger.log(Level.INFO, "Found root bone in skeleton {0}", skeleton); baseRigidBody = new PhysicsRigidBody(new BoxCollisionShape(Vector3f.UNIT_XYZ.mult(0.1f)), 1); baseRigidBody.setKinematic(mode == Mode.Kinetmatic); boneRecursion(model, childBone, baseRigidBody, 1, pointsMap); } } }
protected void resetBonePos() { for (int i = 0; i < pmdNode.getSkeleton().getBoneCount(); i++) { Bone bone = pmdNode.getSkeleton().getBone(i); bone.setUserControl(false); } pmdNode.getSkeleton().resetAndUpdate(); for (int i = 0; i < pmdNode.getSkeleton().getBoneCount(); i++) { Bone bone = pmdNode.getSkeleton().getBone(i); bone.setUserControl(true); } }
private void computeBindTransforms(BoneWrapper boneWrapper, Skeleton skeleton) { Bone bone = boneWrapper.bone; tmpTransforms.fromTransformMatrix(boneWrapper.modelBindMatrix); if (bone.getParent() != null) { //root bone, model transforms are the same as the local transforms //but for child bones we need to combine it with the parents inverse model transforms. tmpMat.setTranslation(bone.getParent().getModelSpacePosition()); tmpMat.setRotationQuaternion(bone.getParent().getModelSpaceRotation()); tmpMat.setScale(bone.getParent().getModelSpaceScale()); tmpMat.invertLocal(); tmpTransforms2.fromTransformMatrix(tmpMat); tmpTransforms.combineWithParent(tmpTransforms2); } bone.setBindTransforms(tmpTransforms.getTranslation(), tmpTransforms.getRotation(), tmpTransforms.getScale()); //resets the local transforms to bind transforms for all bones. //then computes the model transforms from local transforms for each bone. skeleton.resetAndUpdate(); skeleton.setBindingPose(); for (Integer childIndex : boneWrapper.children) { BoneWrapper child = fetchFromCache("nodes", childIndex, BoneWrapper.class); computeBindTransforms(child, skeleton); } }
skeleton.setBindingPose(); skeleton.updateWorldVectors(); skeleton.resetAndUpdate(); skeleton.computeSkinningMatrices();