createJoint(); setDampingDirAng(dampingDirAng); setDampingDirLin(dampingDirLin); setDampingLimAng(dampingLimAng); setDampingLimLin(dampingLimLin); setDampingOrthoAng(dampingOrthoAng); setDampingOrthoLin(dampingOrthoLin); setLowerAngLimit(lowerAngLimit); setLowerLinLimit(lowerLinLimit); setMaxAngMotorForce(maxAngMotorForce); setMaxLinMotorForce(maxLinMotorForce); setPoweredAngMotor(poweredAngMotor); setPoweredLinMotor(poweredLinMotor); setRestitutionDirAng(restitutionDirAng); setRestitutionDirLin(restitutionDirLin); setRestitutionLimAng(restitutionLimAng); setRestitutionLimLin(restitutionLimLin); setRestitutionOrthoAng(restitutionOrthoAng); setRestitutionOrthoLin(restitutionOrthoLin); setSoftnessDirAng(softnessDirAng); setSoftnessDirLin(softnessDirLin); setSoftnessLimAng(softnessLimAng); setSoftnessLimLin(softnessLimLin); setSoftnessOrthoAng(softnessOrthoAng); setSoftnessOrthoLin(softnessOrthoLin); setTargetAngMotorVelocity(targetAngMotorVelicoty);
SliderJoint joint = new SliderJoint(rb1, rb2, new Vector3f(2f, 0f, 0f), new Vector3f(-2f, 0f, 0f), true); joint.setLowerAngLimit(-0.01f); joint.setLowerLinLimit(-0.02f); joint.setUpperAngLimit(0.01f); joint.setUpperLinLimit(0.02f); joint.setDampingDirAng(0.03f); joint.setDampingDirLin(0.04f); joint.setDampingLimAng(0.05f); joint.setDampingLimLin(0.06f); joint.setDampingOrthoAng(0.07f); joint.setDampingOrthoLin(0.08f); joint.setRestitutionDirAng(0.09f); joint.setRestitutionDirLin(0.10f); joint.setRestitutionLimAng(0.11f); joint.setRestitutionLimLin(0.12f); joint.setRestitutionOrthoAng(0.13f); joint.setRestitutionOrthoLin(0.14f); joint.setSoftnessDirAng(0.15f); joint.setSoftnessDirLin(0.16f); joint.setSoftnessLimAng(0.17f); joint.setSoftnessLimLin(0.18f); joint.setSoftnessOrthoAng(0.19f); joint.setSoftnessOrthoLin(0.20f);
capsule.write(getDampingDirAng(), "dampingDirAng", 0f); capsule.write(getDampingDirLin(), "dampingDirLin", 0f); capsule.write(getDampingLimAng(), "dampingLimAng", 0f); capsule.write(getDampingLimLin(), "dampingLimLin", 0f); capsule.write(getDampingOrthoAng(), "dampingOrthoAng", 0f); capsule.write(getDampingOrthoLin(), "dampingOrthoLin", 0f); capsule.write(getLowerAngLimit(), "lowerAngLimit", 0f); capsule.write(getLowerLinLimit(), "lowerLinLimit", 0f); capsule.write(getMaxAngMotorForce(), "maxAngMotorForce", 0f); capsule.write(getMaxLinMotorForce(), "maxLinMotorForce", 0f); capsule.write(isPoweredAngMotor(), "poweredAngMotor", false); capsule.write(isPoweredLinMotor(), "poweredLinMotor", false); capsule.write(getRestitutionDirAng(), "restitutionDirAng", 0f); capsule.write(getRestitutionDirLin(), "restitutionDirLin", 0f); capsule.write(getRestitutionLimAng(), "restitutionLimAng", 0f); capsule.write(getRestitutionLimLin(), "restitutionLimLin", 0f); capsule.write(getRestitutionOrthoAng(), "restitutionOrthoAng", 0f); capsule.write(getRestitutionOrthoLin(), "restitutionOrthoLin", 0f); capsule.write(getSoftnessDirAng(), "softnessDirAng", 0f); capsule.write(getSoftnessDirLin(), "softnessDirLin", 0f); capsule.write(getSoftnessLimAng(), "softnessLimAng", 0f); capsule.write(getSoftnessLimLin(), "softnessLimLin", 0f); capsule.write(getSoftnessOrthoAng(), "softnessOrthoAng", 0f); capsule.write(getSoftnessOrthoLin(), "softnessOrthoLin", 0f); capsule.write(getTargetAngMotorVelocity(), "targetAngMotorVelicoty", 0f); capsule.write(getTargetLinMotorVelocity(), "targetLinMotorVelicoty", 0f);
/** * @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, Matrix3f rotA, Matrix3f rotB, boolean useLinearReferenceFrameA) { super(nodeA, nodeB, pivotA, pivotB); this.rotA=rotA; this.rotB=rotB; this.useLinearReferenceFrameA=useLinearReferenceFrameA; createJoint(); }
private native float getDampingDirLin(long objectId);
private native float getDampingLimLin(long objectId);
private native float getMaxAngMotorForce(long objectId);
private native float getLowerAngLimit(long objectId);
private native float getDampingOrthoAng(long objectId);
private native float getLowerLinLimit(long objectId);
private native float getDampingDirAng(long objectId);
private native float getDampingLimAng(long objectId);
private native float getDampingOrthoLin(long objectId);
capsule.write(getDampingDirAng(), "dampingDirAng", 0f); capsule.write(getDampingDirLin(), "dampingDirLin", 0f); capsule.write(getDampingLimAng(), "dampingLimAng", 0f); capsule.write(getDampingLimLin(), "dampingLimLin", 0f); capsule.write(getDampingOrthoAng(), "dampingOrthoAng", 0f); capsule.write(getDampingOrthoLin(), "dampingOrthoLin", 0f); capsule.write(getLowerAngLimit(), "lowerAngLimit", 0f); capsule.write(getLowerLinLimit(), "lowerLinLimit", 0f); capsule.write(getMaxAngMotorForce(), "maxAngMotorForce", 0f); capsule.write(getMaxLinMotorForce(), "maxLinMotorForce", 0f); capsule.write(isPoweredAngMotor(), "poweredAngMotor", false); capsule.write(isPoweredLinMotor(), "poweredLinMotor", false); capsule.write(getRestitutionDirAng(), "restitutionDirAng", 0f); capsule.write(getRestitutionDirLin(), "restitutionDirLin", 0f); capsule.write(getRestitutionLimAng(), "restitutionLimAng", 0f); capsule.write(getRestitutionLimLin(), "restitutionLimLin", 0f); capsule.write(getRestitutionOrthoAng(), "restitutionOrthoAng", 0f); capsule.write(getRestitutionOrthoLin(), "restitutionOrthoLin", 0f); capsule.write(getSoftnessDirAng(), "softnessDirAng", 0f); capsule.write(getSoftnessDirLin(), "softnessDirLin", 0f); capsule.write(getSoftnessLimAng(), "softnessLimAng", 0f); capsule.write(getSoftnessLimLin(), "softnessLimLin", 0f); capsule.write(getSoftnessOrthoAng(), "softnessOrthoAng", 0f); capsule.write(getSoftnessOrthoLin(), "softnessOrthoLin", 0f); capsule.write(getTargetAngMotorVelocity(), "targetAngMotorVelicoty", 0f); capsule.write(getTargetLinMotorVelocity(), "targetLinMotorVelicoty", 0f);
/** * Instantiate a SliderJoint. 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 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) * @param useLinearReferenceFrameA true→use node A, false→use node * B */ public SliderJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, Vector3f pivotA, Vector3f pivotB, Matrix3f rotA, Matrix3f rotB, boolean useLinearReferenceFrameA) { super(nodeA, nodeB, pivotA, pivotB); this.rotA = rotA; this.rotB = rotB; this.useLinearReferenceFrameA = useLinearReferenceFrameA; createJoint(); }
private native float getDampingDirLin(long objectId);
private native float getDampingLimLin(long objectId);
private native float getMaxAngMotorForce(long objectId);
private native float getLowerAngLimit(long objectId);
private native float getDampingOrthoAng(long objectId);