Przeglądaj źródła

- add some javadoc to HingeJoint setLimit

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10053 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
nor..67 12 lat temu
rodzic
commit
5d9b67214a

+ 20 - 0
engine/src/bullet/com/jme3/bullet/joints/HingeJoint.java

@@ -73,6 +73,12 @@ public class HingeJoint extends PhysicsJoint {
         createJoint();
     }
 
+    /**
+     * Enables the motor.
+     * @param enable if true, motor is enabled.
+     * @param targetVelocity the target velocity of the rotation.
+     * @param maxMotorImpulse the max force applied to the hinge to rotate it.
+     */
     public void enableMotor(boolean enable, float targetVelocity, float maxMotorImpulse) {
         enableMotor(objectId, enable, targetVelocity, maxMotorImpulse);
     }
@@ -97,12 +103,26 @@ public class HingeJoint extends PhysicsJoint {
 
     private native float getMaxMotorImpulse(long objectId);
 
+    /**
+     * Sets the limits of this joint.
+     * @param low the low limit in radians.
+     * @param high the high limit in radians.
+     */
     public void setLimit(float low, float high) {
         setLimit(objectId, low, high);
     }
 
     private native void setLimit(long objectId, float low, float high);
 
+    /**
+     * Sets the limits of this joint.
+     * If you're above the softness, velocities that would shoot through the actual limit are slowed down. The bias be in the range of 0.2 - 0.5.
+     * @param low the low limit in radians.
+     * @param high the high limit in radians.
+     * @param _softness the factor at which the velocity error correction starts operating,i.e a softness of 0.9 means that the vel. corr starts at 90% of the limit range.
+     * @param _biasFactor the magnitude of the position correction. It tells you how strictly the position error (drift ) is corrected.
+     * @param _relaxationFactor the rate at which velocity errors are corrected. This can be seen as the strength of the limits. A low value will make the the limits more spongy.
+     */
     public void setLimit(float low, float high, float _softness, float _biasFactor, float _relaxationFactor) {
         biasFactor = _biasFactor;
         relaxationFactor = _relaxationFactor;

+ 20 - 0
engine/src/jbullet/com/jme3/bullet/joints/HingeJoint.java

@@ -73,14 +73,34 @@ public class HingeJoint extends PhysicsJoint {
         createJoint();
     }
 
+    /**
+     * Enables the motor.
+     * @param enable if true, motor is enabled.
+     * @param targetVelocity the target velocity of the rotation.
+     * @param maxMotorImpulse the max force applied to the hinge to rotate it.
+     */
     public void enableMotor(boolean enable, float targetVelocity, float maxMotorImpulse) {
         ((HingeConstraint) constraint).enableAngularMotor(enable, targetVelocity, maxMotorImpulse);
     }
 
+    /**
+     * Sets the limits of this joint.
+     * @param low the low limit in radians.
+     * @param high the high limit in radians.
+     */
     public void setLimit(float low, float high) {
         ((HingeConstraint) constraint).setLimit(low, high);
     }
 
+    /**
+     * Sets the limits of this joint.
+     * If you're above the softness, velocities that would shoot through the actual limit are slowed down. The bias be in the range of 0.2 - 0.5.
+     * @param low the low limit in radians.
+     * @param high the high limit in radians.
+     * @param _softness the factor at which the velocity error correction starts operating,i.e a softness of 0.9 means that the vel. corr starts at 90% of the limit range.
+     * @param _biasFactor the magnitude of the position correction. It tells you how strictly the position error (drift ) is corrected.
+     * @param _relaxationFactor the rate at which velocity errors are corrected. This can be seen as the strength of the limits. A low value will make the the limits more spongy.
+     */
     public void setLimit(float low, float high, float _softness, float _biasFactor, float _relaxationFactor) {
         biasFactor = _biasFactor;
         relaxationFactor = _relaxationFactor;