/** * Creates a new HingeJoint * @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 HingeJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, Vector3f pivotA, Vector3f pivotB, Vector3f axisA, Vector3f axisB) { super(nodeA, nodeB, pivotA, pivotB); this.axisA = axisA; this.axisB = axisB; createJoint(); }
/** * Instantiate a HingeJoint. 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) * @param axisA the local axis of the connection to node A (not null, alias * created) * @param axisB the local axis of the connection to node B (not null, alias * created) */ public HingeJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, Vector3f pivotA, Vector3f pivotB, Vector3f axisA, Vector3f axisB) { super(nodeA, nodeB, pivotA, pivotB); this.axisA = axisA; this.axisB = axisB; createJoint(); }
private native long createJoint(long objectIdA, long objectIdB, Vector3f pivotA, Vector3f axisA, Vector3f pivotB, Vector3f axisB); }
public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); this.axisA = (Vector3f) capsule.readSavable("axisA", new Vector3f()); this.axisB = (Vector3f) capsule.readSavable("axisB", new Vector3f()); this.angularOnly = capsule.readBoolean("angularOnly", false); float lowerLimit = capsule.readFloat("lowerLimit", 1e30f); float upperLimit = capsule.readFloat("upperLimit", -1e30f); this.biasFactor = capsule.readFloat("biasFactor", 0.3f); this.relaxationFactor = capsule.readFloat("relaxationFactor", 1f); this.limitSoftness = capsule.readFloat("limitSoftness", 0.9f); boolean enableAngularMotor=capsule.readBoolean("enableAngularMotor", false); float targetVelocity=capsule.readFloat("targetVelocity", 0.0f); float maxMotorImpulse=capsule.readFloat("maxMotorImpulse", 0.0f); createJoint(); enableMotor(enableAngularMotor, targetVelocity, maxMotorImpulse); ((HingeConstraint) constraint).setLimit(lowerLimit, upperLimit, limitSoftness, biasFactor, relaxationFactor); }
/** * De-serialize this joint, for example when loading from a J3O file. * * @param im importer (not null) * @throws IOException from importer */ public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); this.axisA = (Vector3f) capsule.readSavable("axisA", new Vector3f()); this.axisB = (Vector3f) capsule.readSavable("axisB", new Vector3f()); this.angularOnly = capsule.readBoolean("angularOnly", false); float lowerLimit = capsule.readFloat("lowerLimit", 1e30f); float upperLimit = capsule.readFloat("upperLimit", -1e30f); this.biasFactor = capsule.readFloat("biasFactor", 0.3f); this.relaxationFactor = capsule.readFloat("relaxationFactor", 1f); this.limitSoftness = capsule.readFloat("limitSoftness", 0.9f); boolean enableAngularMotor = capsule.readBoolean("enableAngularMotor", false); float targetVelocity = capsule.readFloat("targetVelocity", 0.0f); float maxMotorImpulse = capsule.readFloat("maxMotorImpulse", 0.0f); createJoint(); enableMotor(enableAngularMotor, targetVelocity, maxMotorImpulse); setLimit(lowerLimit, upperLimit, limitSoftness, biasFactor, relaxationFactor); }
/** * Creates a new HingeJoint * @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 HingeJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, Vector3f pivotA, Vector3f pivotB, Vector3f axisA, Vector3f axisB) { super(nodeA, nodeB, pivotA, pivotB); this.axisA = axisA; this.axisB = axisB; createJoint(); }
/** * Creates a new HingeJoint * @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 HingeJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, Vector3f pivotA, Vector3f pivotB, Vector3f axisA, Vector3f axisB) { super(nodeA, nodeB, pivotA, pivotB); this.axisA = axisA; this.axisB = axisB; createJoint(); }
/** * Creates a new HingeJoint * @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 HingeJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, Vector3f pivotA, Vector3f pivotB, Vector3f axisA, Vector3f axisB) { super(nodeA, nodeB, pivotA, pivotB); this.axisA = axisA; this.axisB = axisB; createJoint(); }
private native long createJoint(long objectIdA, long objectIdB, Vector3f pivotA, Vector3f axisA, Vector3f pivotB, Vector3f axisB); }
private native long createJoint(long objectIdA, long objectIdB, Vector3f pivotA, Vector3f axisA, Vector3f pivotB, Vector3f axisB); }
public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); this.axisA = (Vector3f) capsule.readSavable("axisA", new Vector3f()); this.axisB = (Vector3f) capsule.readSavable("axisB", new Vector3f()); this.angularOnly = capsule.readBoolean("angularOnly", false); float lowerLimit = capsule.readFloat("lowerLimit", 1e30f); float upperLimit = capsule.readFloat("upperLimit", -1e30f); this.biasFactor = capsule.readFloat("biasFactor", 0.3f); this.relaxationFactor = capsule.readFloat("relaxationFactor", 1f); this.limitSoftness = capsule.readFloat("limitSoftness", 0.9f); boolean enableAngularMotor = capsule.readBoolean("enableAngularMotor", false); float targetVelocity = capsule.readFloat("targetVelocity", 0.0f); float maxMotorImpulse = capsule.readFloat("maxMotorImpulse", 0.0f); createJoint(); enableMotor(enableAngularMotor, targetVelocity, maxMotorImpulse); setLimit(lowerLimit, upperLimit, limitSoftness, biasFactor, relaxationFactor); }
public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); this.axisA = (Vector3f) capsule.readSavable("axisA", new Vector3f()); this.axisB = (Vector3f) capsule.readSavable("axisB", new Vector3f()); this.angularOnly = capsule.readBoolean("angularOnly", false); float lowerLimit = capsule.readFloat("lowerLimit", 1e30f); float upperLimit = capsule.readFloat("upperLimit", -1e30f); this.biasFactor = capsule.readFloat("biasFactor", 0.3f); this.relaxationFactor = capsule.readFloat("relaxationFactor", 1f); this.limitSoftness = capsule.readFloat("limitSoftness", 0.9f); boolean enableAngularMotor = capsule.readBoolean("enableAngularMotor", false); float targetVelocity = capsule.readFloat("targetVelocity", 0.0f); float maxMotorImpulse = capsule.readFloat("maxMotorImpulse", 0.0f); createJoint(); enableMotor(enableAngularMotor, targetVelocity, maxMotorImpulse); setLimit(lowerLimit, upperLimit, limitSoftness, biasFactor, relaxationFactor); }
public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); this.axisA = (Vector3f) capsule.readSavable("axisA", new Vector3f()); this.axisB = (Vector3f) capsule.readSavable("axisB", new Vector3f()); this.angularOnly = capsule.readBoolean("angularOnly", false); float lowerLimit = capsule.readFloat("lowerLimit", 1e30f); float upperLimit = capsule.readFloat("upperLimit", -1e30f); this.biasFactor = capsule.readFloat("biasFactor", 0.3f); this.relaxationFactor = capsule.readFloat("relaxationFactor", 1f); this.limitSoftness = capsule.readFloat("limitSoftness", 0.9f); boolean enableAngularMotor=capsule.readBoolean("enableAngularMotor", false); float targetVelocity=capsule.readFloat("targetVelocity", 0.0f); float maxMotorImpulse=capsule.readFloat("maxMotorImpulse", 0.0f); createJoint(); enableMotor(enableAngularMotor, targetVelocity, maxMotorImpulse); ((HingeConstraint) constraint).setLimit(lowerLimit, upperLimit, limitSoftness, biasFactor, relaxationFactor); }