public void setLocalRotation(Quaternion rotation) { localTransform.setRotation(rotation); }
/** * <code>setLocalRotation</code> sets the local rotation of this node. * * @param quaternion * the new local rotation. */ public void setLocalRotation(Quaternion quaternion) { localTransform.setRotation(quaternion); setTransformRefresh(); }
public void setRotation(Quaternion rotation) { transform.setRotation(rotation); updateMatrix(); }
public Transform getModelBindInverseTransform() { Transform t = new Transform(); t.setTranslation(modelBindInversePos); t.setRotation(modelBindInverseRot); if (modelBindInverseScale != null) { t.setScale(modelBindInverseScale); } return t; }
public Transform getBindInverseTransform() { Transform t = new Transform(); t.setTranslation(bindPos); t.setRotation(bindRot); if (bindScale != null) { t.setScale(bindScale); } return t.invert(); }
jmeLocalNodeTransform.setRotation(localRotation); jmeLocalNodeTransform.setScale(localScale);
} else if (qName.equals("bone")) { joint.getLocalTransform().setTranslation(position); joint.getLocalTransform().setRotation(rotation); if (scale != null) { joint.getLocalTransform().setScale(scale);
transform.setRotation(new Quaternion( rotation.get(0).getAsFloat(), rotation.get(1).getAsFloat(),
public void setWorldBindPose(Matrix4f worldBindPose) { if (cachedWorldBindPose != null) { if (!cachedWorldBindPose.equals(worldBindPose)) { throw new UnsupportedOperationException("Bind poses don't match"); } } cachedWorldBindPose = worldBindPose; this.jmeWorldBindPose = new Transform(); this.jmeWorldBindPose.setTranslation(worldBindPose.toTranslationVector()); this.jmeWorldBindPose.setRotation(worldBindPose.toRotationQuat()); this.jmeWorldBindPose.setScale(worldBindPose.toScaleVector()); System.out.println("\tBind Pose for " + getName()); System.out.println(jmeWorldBindPose); float[] angles = new float[3]; jmeWorldBindPose.getRotation().toAngles(angles); System.out.println("Angles: " + angles[0] * FastMath.RAD_TO_DEG + ", " + angles[1] * FastMath.RAD_TO_DEG + ", " + angles[2] * FastMath.RAD_TO_DEG); }
/** * Returns the local transform of this bone combined with the given position and rotation * @param position a position * @param rotation a rotation */ public Transform getCombinedTransform(Vector3f position, Quaternion rotation) { if(tmpTransform == null){ tmpTransform = new Transform(); } rotation.mult(localPos, tmpTransform.getTranslation()).addLocal(position); tmpTransform.setRotation(rotation).getRotation().multLocal(localRot); return tmpTransform; }
private static void applyInverse(Vector3f translation, Quaternion rotation, Vector3f scale, Transform inverseBindPose) { Transform t = new Transform(); t.setTranslation(translation); t.setRotation(rotation); if (scale != null) { t.setScale(scale); } t.combineWithParent(inverseBindPose); t.getTranslation(translation); t.getRotation(rotation); if (scale != null) { t.getScale(scale); } }
transform.setRotation(interpolated.getRotation());
transform.setRotation(m.toRotationQuat()); transform.setScale(m.toScaleVector());
/** * <code>setLocalRotation</code> sets the local rotation of this node. * * @param quaternion * the new local rotation. */ public void setLocalRotation(Quaternion quaternion) { localTransform.setRotation(quaternion); setTransformRefresh(); }
/** * <code>setLocalRotation</code> sets the local rotation of this node. * * @param quaternion * the new local rotation. */ public void setLocalRotation(Quaternion quaternion) { localTransform.setRotation(quaternion); setTransformRefresh(); }
public Transform getModelBindInverseTransform() { Transform t = new Transform(); t.setTranslation(modelBindInversePos); t.setRotation(modelBindInverseRot); if (modelBindInverseScale != null) { t.setScale(modelBindInverseScale); } return t; }
public Transform getBindInverseTransform() { Transform t = new Transform(); t.setTranslation(bindPos); t.setRotation(bindRot); if (bindScale != null) { t.setScale(bindScale); } return t.invert(); }
/** * Returns the local transform of this bone combined with the given position and rotation * @param position a position * @param rotation a rotation */ public Transform getCombinedTransform(Vector3f position, Quaternion rotation) { rotation.mult(localPos, tmpTransform.getTranslation()).addLocal(position); tmpTransform.setRotation(rotation).getRotation().multLocal(localRot); return tmpTransform; }
public static Transform convert( Se3_F64 input , Transform output ) { if( output == null ) output = new Transform(); Quaternion_F64 quatGR = new Quaternion_F64(); ConvertRotation3D_F64.matrixToQuaternion(input.getR(), quatGR); Quaternion quatJME = new Quaternion(); quatJME.set((float)quatGR.x,(float)quatGR.y,(float)quatGR.z,(float)quatGR.w); output.setRotation(quatJME); output.setTranslation((float)input.T.x,(float)input.T.y,(float)input.T.z); return output; }
private void reverseBlendAnimTransforms(Transform t, Transform bindTransforms) { //This is wrong //You'd normally combine those transforms with transform.combineWithParent() //Here we actually do in reverse what JME does to combine anim transforms with bind transfoms (add trans/mult rot/ mult scale) //The code to fix is in Bone.blendAnimTransforms //TODO fix blendAnimTransforms t.getTranslation().subtractLocal(bindTransforms.getTranslation()); t.getScale().divideLocal(bindTransforms.getScale()); tmpQuat.set(bindTransforms.getRotation()).inverseLocal().multLocal(t.getRotation()); t.setRotation(tmpQuat); }