/** * <code>transposeNew</code> returns a transposed version of this matrix. * * @return The new Matrix3f object. */ public Matrix3f transposeNew() { Matrix3f ret = new Matrix3f(m00, m10, m20, m01, m11, m21, m02, m12, m22); return ret; }
/** * @param pivotA local translation of the joint connection point in node A * @param pivotB local translation of the joint connection point in node B */ public ConeJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, Vector3f pivotA, Vector3f pivotB) { super(nodeA, nodeB, pivotA, pivotB); this.rotA = new Matrix3f(); this.rotB = new Matrix3f(); createJoint(); }
/** * @param pivotA local translation of the joint connection point in node A * @param pivotB local translation of the joint connection point in node B */ public SliderJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, Vector3f pivotA, Vector3f pivotB, boolean useLinearReferenceFrameA) { super(nodeA, nodeB, pivotA, pivotB); this.rotA=new Matrix3f(); this.rotB=new Matrix3f(); this.useLinearReferenceFrameA=useLinearReferenceFrameA; createJoint(); }
/** * Copy this object's orientation to a matrix. * * @return a new matrix (not null) */ public Matrix3f getPhysicsRotationMatrix() { Matrix3f mtx = new Matrix3f(); getPhysicsRotationMatrix(objectId, mtx); return mtx; }
/** * Copy this body's orientation to a matrix. * * @return a new matrix (not null) */ public Matrix3f getPhysicsRotationMatrix() { Matrix3f mtx = new Matrix3f(); getPhysicsRotationMatrix(objectId, mtx); return mtx; }
/** * <code>toRotationMatrix</code> converts this quaternion to a rotational * matrix. Note: the result is created from a normalized version of this quat. * * @return the rotation matrix representation of this quaternion. */ public Matrix3f toRotationMatrix() { Matrix3f matrix = new Matrix3f(); return toRotationMatrix(matrix); }
public static com.jme3.math.Matrix3f convert(javax.vecmath.Matrix3f oldMatrix) { com.jme3.math.Matrix3f newMatrix = new com.jme3.math.Matrix3f(); convert(oldMatrix, newMatrix); return newMatrix; }
/** * adds a child shape at the given local translation * @param shape the child shape to add * @param location the local location of the child shape */ public void addChildShape(CollisionShape shape, Vector3f location) { Transform transA = new Transform(Converter.convert(new Matrix3f())); Converter.convert(location, transA.origin); children.add(new ChildCollisionShape(location.clone(), new Matrix3f(), shape)); ((CompoundShape) cShape).addChildShape(transA, shape.getCShape()); }
public BillboardControl() { super(); orient = new Matrix3f(); look = new Vector3f(); left = new Vector3f(); alignment = Alignment.Screen; }
/** * Gets the physics object rotation as a matrix, no conversions and no object instantiation * @param rotation the rotation of the actual physics object is stored in this Matrix3f */ public Matrix3f getPhysicsRotationMatrix(Matrix3f rotation) { if (rotation == null) { rotation = new Matrix3f(); } rBody.getCenterOfMassTransform(tempTrans); return Converter.convert(tempTrans.basis, rotation); }
/** * Gets the physics object rotation * @param rotation the rotation of the actual physics object is stored in this Matrix3f */ public Matrix3f getInterpolatedPhysicsRotation(Matrix3f rotation) { if (rotation == null) { rotation = new Matrix3f(); } rBody.getInterpolationWorldTransform(tempTrans); return Converter.convert(tempTrans.basis, rotation); }
@Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this); capsule.write(rotA, "rotA", new Matrix3f()); capsule.write(rotB, "rotB", new Matrix3f()); capsule.write(angularOnly, "angularOnly", false); capsule.write(swingSpan1, "swingSpan1", 1e30f); capsule.write(swingSpan2, "swingSpan2", 1e30f); capsule.write(twistSpan, "twistSpan", 1e30f); }
@Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); this.rotA = (Matrix3f) capsule.readSavable("rotA", new Matrix3f()); this.rotB = (Matrix3f) capsule.readSavable("rotB", new Matrix3f()); this.angularOnly = capsule.readBoolean("angularOnly", false); this.swingSpan1 = capsule.readFloat("swingSpan1", 1e30f); this.swingSpan2 = capsule.readFloat("swingSpan2", 1e30f); this.twistSpan = capsule.readFloat("twistSpan", 1e30f); createJoint(); }
/** * @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()); }
@Override public void write(JmeExporter e) throws IOException { super.write(e); OutputCapsule capsule = e.getCapsule(this); capsule.write(getPhysicsLocation(new Vector3f()), "physicsLocation", new Vector3f()); capsule.write(getPhysicsRotationMatrix(new Matrix3f()), "physicsRotation", new Matrix3f()); capsule.write(getCcdMotionThreshold(), "ccdMotionThreshold", 0); capsule.write(getCcdSweptSphereRadius(), "ccdSweptSphereRadius", 0); }
/** * Serialize this shape, for example when saving to a J3O file. * * @param ex exporter (not null) * @throws IOException from exporter */ public void write(JmeExporter ex) throws IOException { OutputCapsule capsule = ex.getCapsule(this); capsule.write(location, "location", new Vector3f()); capsule.write(rotation, "rotation", new Matrix3f()); capsule.write(shape, "shape", new BoxCollisionShape(new Vector3f(1, 1, 1))); }
/** * Serialize this shape, for example when saving to a J3O file. * * @param ex exporter (not null) * @throws IOException from exporter */ public void write(JmeExporter ex) throws IOException { OutputCapsule capsule = ex.getCapsule(this); capsule.write(location, "location", new Vector3f()); capsule.write(rotation, "rotation", new Matrix3f()); capsule.write(shape, "shape", new BoxCollisionShape(new Vector3f(1, 1, 1))); }
/** * De-serialize this shape, for example when loading from a J3O file. * * @param im importer (not null) * @throws IOException from importer */ public void read(JmeImporter im) throws IOException { InputCapsule capsule = im.getCapsule(this); location = (Vector3f) capsule.readSavable("location", new Vector3f()); rotation = (Matrix3f) capsule.readSavable("rotation", new Matrix3f()); shape = (CollisionShape) capsule.readSavable("shape", new BoxCollisionShape(new Vector3f(1, 1, 1))); } }
/** * De-serialize this shape, for example when loading from a J3O file. * * @param im importer (not null) * @throws IOException from importer */ public void read(JmeImporter im) throws IOException { InputCapsule capsule = im.getCapsule(this); location = (Vector3f) capsule.readSavable("location", new Vector3f()); rotation = (Matrix3f) capsule.readSavable("rotation", new Matrix3f()); shape = (CollisionShape) capsule.readSavable("shape", new BoxCollisionShape(new Vector3f(1, 1, 1))); } }
@Override public void read(JmeImporter e) throws IOException { super.read(e); InputCapsule capsule = e.getCapsule(this); buildObject(); setPhysicsLocation((Vector3f) capsule.readSavable("physicsLocation", new Vector3f())); setPhysicsRotation(((Matrix3f) capsule.readSavable("physicsRotation", new Matrix3f()))); setCcdMotionThreshold(capsule.readFloat("ccdMotionThreshold", 0)); setCcdSweptSphereRadius(capsule.readFloat("ccdSweptSphereRadius", 0)); } }