/** * <code>getLocalTranslation</code> retrieves the local translation of * this node. * * @return the local translation of this node. */ public Vector3f getLocalTranslation() { return localTransform.getTranslation(); }
public Vector3f getLocalTranslation() { return localTransform.getTranslation(); }
/** * @return the physicsLocation */ public Vector3f getPhysicsLocation() { gObject.getWorldTransform(tempTrans); Converter.convert(tempTrans.origin, physicsLocation.getTranslation()); return physicsLocation.getTranslation(); }
/** * @return the physicsLocation */ public Vector3f getPhysicsLocation() { gObject.getWorldTransform(tempTrans); Converter.convert(tempTrans.origin, physicsLocation.getTranslation()); return physicsLocation.getTranslation(); }
/** * <code>getWorldTranslation</code> retrieves the absolute translation of * the spatial. * * @return the Spatial's world translation vector. */ public Vector3f getWorldTranslation() { checkDoTransformUpdate(); return worldTransform.getTranslation(); }
/** * Translates the spatial by the given translation vector. * * @return The spatial on which this method is called, e.g <code>this</code>. */ public Spatial move(Vector3f offset) { this.localTransform.getTranslation().addLocal(offset); setTransformRefresh(); return this; }
/** * @return the physicsLocation */ public Vector3f getPhysicsLocation(Vector3f trans) { if (trans == null) { trans = new Vector3f(); } gObject.getWorldTransform(tempTrans); Converter.convert(tempTrans.origin, physicsLocation.getTranslation()); return trans.set(physicsLocation.getTranslation()); }
/** * @return the physicsLocation */ public Vector3f getPhysicsLocation(Vector3f trans) { if (trans == null) { trans = new Vector3f(); } gObject.getWorldTransform(tempTrans); Converter.convert(tempTrans.origin, physicsLocation.getTranslation()); return trans.set(physicsLocation.getTranslation()); }
/** * Translates the spatial by the given translation vector. * * @return The spatial on which this method is called, e.g <code>this</code>. */ public Spatial move(float x, float y, float z) { this.localTransform.getTranslation().addLocal(x, y, z); setTransformRefresh(); return this; }
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 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 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; }
@Override public void updateGeometricState() { super.updateGeometricState(); if (channel < 0 || this.getParent() == null) return; Vector3f currentWorldTranslation = worldTransform.getTranslation(); if (!previousWorldTranslation.equals(currentWorldTranslation)) { getRenderer().updateSourceParam(this, AudioParam.Position); if (velocityFromTranslation && !Float.isNaN(previousWorldTranslation.x)) { velocity.set(currentWorldTranslation).subtractLocal(previousWorldTranslation).multLocal(1f / lastTpf); getRenderer().updateSourceParam(this, AudioParam.Velocity); } previousWorldTranslation.set(currentWorldTranslation); } }
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; }
private boolean insidePlane(Plane p, Vector3f axis1, Vector3f axis2, Vector3f axis3, Vector3f tn) { // transform the plane normal in the box local space. tn.set(axis1.dot(p.getNormal()), axis2.dot(p.getNormal()), axis3.dot(p.getNormal())); // distance check float radius = FastMath.abs(tn.x) + FastMath.abs(tn.y) + FastMath.abs(tn.z); float distance = p.pseudoDistance(transform.getTranslation()); if (distance < -radius) { return false; } return true; }