private native long createJoint(long objectIdA, long objectIdB, Vector3f pivotA, Matrix3f rotA, Vector3f pivotB, Matrix3f rotB); }
private PhysicsJoint join(Node A, Node B, Vector3f connectionPoint) { Vector3f pivotA = A.worldToLocal(connectionPoint, new Vector3f()); Vector3f pivotB = B.worldToLocal(connectionPoint, new Vector3f()); ConeJoint joint = new ConeJoint(A.getControl(RigidBodyControl.class), B.getControl(RigidBodyControl.class), pivotA, pivotB); joint.setLimit(1f, 1f, 0); return joint; }
/** * @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, Matrix3f rotA, Matrix3f rotB) { super(nodeA, nodeB, pivotA, pivotB); this.rotA = rotA; this.rotB = rotB; createJoint(); }
private native void setLimit(long objectId, float swingSpan1, float swingSpan2, float twistSpan);
private native void setAngularOnly(long objectId, boolean value);
/** * Instantiate a ConeJoint. To be effective, the joint must be added to a * physics space. * * @param nodeA the 1st body connected by the joint (not null, alias * created) * @param nodeB the 2nd body connected by the joint (not null, alias * created) * @param pivotA local translation of the joint connection point in node A * (not null, alias created) * @param pivotB local translation of the joint connection point in node B * (not null, alias created) * @param rotA the local orientation of the connection to node A (not null, * alias created) * @param rotB the local orientation of the connection to node B (not null, * alias created) */ public ConeJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, Vector3f pivotA, Vector3f pivotB, Matrix3f rotA, Matrix3f rotB) { super(nodeA, nodeB, pivotA, pivotB); this.rotA = rotA; this.rotB = rotB; createJoint(); }
private native void setLimit(long objectId, float swingSpan1, float swingSpan2, float twistSpan);
private native void setAngularOnly(long objectId, boolean value);
private native long createJoint(long objectIdA, long objectIdB, Vector3f pivotA, Matrix3f rotA, Vector3f pivotB, Matrix3f rotB); }
/** * @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(); }
private native void setLimit(long objectId, float swingSpan1, float swingSpan2, float twistSpan);
private native void setAngularOnly(long objectId, boolean value);
private native long createJoint(long objectIdA, long objectIdB, Vector3f pivotA, Matrix3f rotA, Vector3f pivotB, Matrix3f rotB); }
/** * Instantiate a ConeJoint. To be effective, the joint must be added to a * physics space. * * @param nodeA the 1st body connected by the joint (not null, alias * created) * @param nodeB the 2nd body connected by the joint (not null, alias * created) * @param pivotA the local offset of the connection point in node A (not * null, alias created) * @param pivotB the local offset of the connection point in node B (not * null, alias created) */ public ConeJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, Vector3f pivotA, Vector3f pivotB) { super(nodeA, nodeB, pivotA, pivotB); this.rotA = new Matrix3f(); this.rotB = new Matrix3f(); createJoint(); }
@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(); }
/** * De-serialize this joint, for example when loading from a J3O file. * * @param im importer (not null) * @throws IOException from importer */ @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(); }
/** * @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, Matrix3f rotA, Matrix3f rotB) { super(nodeA, nodeB, pivotA, pivotB); this.rotA = rotA; this.rotB = rotB; 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 ConeJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, Vector3f pivotA, Vector3f pivotB, Matrix3f rotA, Matrix3f rotB) { super(nodeA, nodeB, pivotA, pivotB); this.rotA = rotA; this.rotB = rotB; 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 ConeJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, Vector3f pivotA, Vector3f pivotB, Matrix3f rotA, Matrix3f rotB) { super(nodeA, nodeB, pivotA, pivotB); this.rotA = rotA; this.rotB = rotB; 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 ConeJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, Vector3f pivotA, Vector3f pivotB) { super(nodeA, nodeB, pivotA, pivotB); this.rotA = new Matrix3f(); this.rotB = new Matrix3f(); createJoint(); }