/** * <code>getLocalRotation</code> retrieves the local rotation of this * node. * * @return the local rotation of this node. */ public Quaternion getLocalRotation() { return localTransform.getRotation(); }
public Quaternion getLocalRotation() { return localTransform.getRotation(); }
public Quaternion getRotation() { return transform.getRotation(); }
/** * <code>getWorldRotation</code> retrieves the absolute rotation of the * Spatial. * * @return the Spatial's world rotation quaternion. */ public Quaternion getWorldRotation() { checkDoTransformUpdate(); return worldTransform.getRotation(); }
/** * @return the physicsLocation */ public Quaternion getPhysicsRotation() { gObject.getWorldTransform(tempTrans); Converter.convert(tempTrans.getRotation(tempRot), physicsLocation.getRotation()); return physicsLocation.getRotation(); }
/** * Rotates the spatial by the given rotation. * * @return The spatial on which this method is called, e.g <code>this</code>. */ public Spatial rotate(Quaternion rot) { this.localTransform.getRotation().multLocal(rot); setTransformRefresh(); return this; }
/** * <code>setLocalRotation</code> sets the local rotation of this node * by using a {@link Matrix3f}. * * @param rotation * the new local rotation. */ public void setLocalRotation(Matrix3f rotation) { localTransform.getRotation().fromRotationMatrix(rotation); setTransformRefresh(); }
public Matrix3f getPhysicsRotationMatrix() { gObject.getWorldTransform(tempTrans); Converter.convert(tempTrans.getRotation(tempRot), physicsLocation.getRotation()); return physicsLocation.getRotation().toRotationMatrix(); }
/** * @return the physicsLocation */ public Quaternion getPhysicsRotation(Quaternion rot) { if (rot == null) { rot = new Quaternion(); } gObject.getWorldTransform(tempTrans); Converter.convert(tempTrans.getRotation(tempRot), physicsLocation.getRotation()); return rot.set(physicsLocation.getRotation()); }
/** * @return the physicsLocation */ public Matrix3f getPhysicsRotationMatrix(Matrix3f rot) { if (rot == null) { rot = new Matrix3f(); } gObject.getWorldTransform(tempTrans); Converter.convert(tempTrans.getRotation(tempRot), physicsLocation.getRotation()); return rot.set(physicsLocation.getRotation()); }
public static com.jme3.math.Transform convert(com.bulletphysics.linearmath.Transform in, com.jme3.math.Transform out) { convert(in.origin, out.getTranslation()); convert(in.basis, out.getRotation()); return out; }
public static com.bulletphysics.linearmath.Transform convert(com.jme3.math.Transform in, com.bulletphysics.linearmath.Transform out) { convert(in.getTranslation(), out.origin); convert(in.getRotation(), out.basis); return out; }
public Bone getJmeBone() { if (bone == null) { bone = new Bone(name); bone.setBindTransforms(jmeLocalBindPose.getTranslation(), jmeLocalBindPose.getRotation(), jmeLocalBindPose.getScale()); } return bone; } }
private void dumpScene(Spatial s, int indent) { System.err.println(indentString.substring(0, indent) + s.getName() + " (" + s.getClass().getSimpleName() + ") / " + s.getLocalTransform().getTranslation().toString() + ", " + s.getLocalTransform().getRotation().toString() + ", " + s.getLocalTransform().getScale().toString()); if (s instanceof Node) { Node n = (Node) s; for (Spatial spatial : n.getChildren()) { dumpScene(spatial, indent + 1); } } } }
public DTransform(Transform transform) { translation = new Vector3d(transform.getTranslation()); rotation = new DQuaternion(transform.getRotation()); scale = new Vector3d(transform.getScale()); }
/** * Adds a key frame for the given Transform at the given keyFrame index * @param keyFrameIndex the index at which the keyFrame must be inserted * @param transform the transforms to use for this keyFrame */ public void addKeyFrameTransform(int keyFrameIndex, Transform transform) { addKeyFrameTranslation(keyFrameIndex, transform.getTranslation()); addKeyFrameScale(keyFrameIndex, transform.getScale()); addKeyFrameRotation(keyFrameIndex, transform.getRotation()); }
/** * 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); } }
private void dumpScene(Spatial s, int indent) { System.err.println(indentString.substring(0, indent) + s.getName() + " (" + s.getClass().getSimpleName() + ") / " + s.getLocalTransform().getTranslation().toString() + ", " + s.getLocalTransform().getRotation().toString() + ", " + s.getLocalTransform().getScale().toString()); if (s instanceof Node) { Node n = (Node) s; for (Spatial spatial : n.getChildren()) { dumpScene(spatial, indent + 1); } } } }
@Override protected Matrix4f getTransformMatrix(Geometry g){ // Compute the Local matrix for the geometry cachedLocalMat.loadIdentity(); cachedLocalMat.setRotationQuaternion(g.localTransform.getRotation()); cachedLocalMat.setTranslation(g.localTransform.getTranslation()); TempVars vars = TempVars.get(); Matrix4f scaleMat = vars.tempMat4; scaleMat.loadIdentity(); scaleMat.scale(g.localTransform.getScale()); cachedLocalMat.multLocal(scaleMat); vars.release(); return cachedLocalMat; }