Vector3f bonePositionDifference = bone.getLocalPosition().subtract(startTransform.getTranslation()); Quaternion boneRotationDifference = startTransform.getRotation().inverse().mult(bone.getLocalRotation()).normalizeLocal(); Vector3f boneScaleDifference = bone.getLocalScale().divide(startTransform.getScale());
case CONSTRAINT_SPACE_LOCAL: assert bone.getParent() != null : "CONSTRAINT_SPACE_LOCAL should be evaluated as CONSTRAINT_SPACE_POSE if the bone has no parent!"; result = new Transform(bone.getLocalPosition(), bone.getLocalRotation(), bone.getLocalScale()); break; case CONSTRAINT_SPACE_POSE: {
private Vector3f getTranslation(TrackData data, int i) { Vector3f translation; if (data.translations == null) { translation = bone.getLocalPosition(); } else { translation = data.translations[i]; } return translation; }
public static void setBoneModelPos(Bone bone, Vector3f pos, Vector3f tmpV1, Matrix4f tmp1, Matrix3f tmp2) { Bone parentBone = bone.getParent(); if (parentBone != null) { getModelToBoneMatrix(bone.getParent(), tmp1, tmp2); tmp1.mult(pos, tmpV1); bone.getLocalPosition().set(tmpV1); } else { bone.getLocalPosition().set(pos); } } }
protected final void updateSkeletonGeoms(Bone bone) { if (guessBonesOrientation && bone.getName().equalsIgnoreCase("Site")) { return; } Node n = boneNodes.get(bone); n.setLocalTranslation(bone.getLocalPosition()); n.setLocalRotation(bone.getLocalRotation()); n.setLocalScale(bone.getLocalScale()); for (Bone childBone : bone.getChildren()) { updateSkeletonGeoms(childBone); } }
System.err.println("Bind scale: " + selectedBone.getBindScale()); System.err.println("---"); System.err.println("Local translation: " + selectedBone.getLocalPosition()); System.err.println("Local rotation: " + selectedBone.getLocalRotation()); System.err.println("Local scale: " + selectedBone.getLocalScale());
public static boolean equalBindAndLocalTransforms(Bone b) { return equalsEpsilon(b.getBindPosition(), b.getLocalPosition()) && equalsEpsilon(b.getBindRotation(), b.getLocalRotation()) && equalsEpsilon(b.getBindScale(), b.getLocalScale()); }
Vector3f t = bone.getLocalPosition().subtract(bone.getBindPosition()); Quaternion r = tmpQuat.set(bone.getBindRotation()).inverse().multLocal(bone.getLocalRotation()); Vector3f s = bone.getLocalScale().divide(bone.getBindScale());
Bone newBone = newPMDNode.skeleton.getBone(i); Bone bone = skeleton.getBone(i); newBone.getLocalPosition().set(bone.getLocalPosition()); newBone.getLocalRotation().set(bone.getLocalRotation()); newBone.getLocalScale().set(bone.getLocalScale());
Geometry bGeom = new Geometry(bone.getName(), boneShape); Geometry jGeom = new Geometry(bone.getName() + "Joint", jointShape); n.setLocalTranslation(bone.getLocalPosition()); n.setLocalRotation(bone.getLocalRotation()); Vector3f v = bone.getChildren().get(0).getLocalPosition(); Quaternion q = new Quaternion(); q.lookAt(v, Vector3f.UNIT_Z);
Vector3f v = bone.getWorldBindPosition(); if (true || bml.boneType == 1 || bml.boneType == 2) { bone.getLocalPosition().set(v.x + p.x, v.y + p.y, v.z + p.z); Vector3f v = bone.getWorldBindPosition(); if (true || bml.boneType == 1 || bml.boneType == 2) { bone.getLocalPosition().set(v.x + p.x, v.y + p.y, v.z + p.z);