I had a difficult time understanding how to use ConeJoints, and found the javadoc unhelpful in my learning process.
What do people think about adding some additional information?
[patch]
Index: src/jbullet/com/jme3/bullet/joints/ConeJoint.java
===================================================================
— src/jbullet/com/jme3/bullet/joints/ConeJoint.java (revision 8953)
+++ src/jbullet/com/jme3/bullet/joints/ConeJoint.java (working copy)
@@ -44,10 +44,19 @@
import java.io.IOException;
/**
-
- <i>From bullet manual:</i><br>
- <i>From bullet manual:</i><br>
-
- To create ragdolls, the conve twist constraint is very useful for limbs like the upper arm.
- To create ragdolls, the conve twist constraint is very useful for limbs like the upper arm.
-
- It is a special point to point constraint that adds cone and twist axis limits.
- It is a special point to point constraint that adds cone and twist axis limits.
-
- The x-axis serves as twist axis.
- The x-axis serves as twist axis.
- *
-
- The Cone Joint is a special point to point constraint that adds
- The Cone Joint is a special point to point constraint that adds
-
- cone and twist axis limits. It can be used to simulate human-like
- cone and twist axis limits. It can be used to simulate human-like
-
- joints in ragdolls, such the hips and upper arm.
- joints in ragdolls, such the hips and upper arm.
- *
-
- The axis of symmetry of the cone relative to each of the shapes it
- The axis of symmetry of the cone relative to each of the shapes it
-
- connects defaults to the x-axis.
- connects defaults to the x-axis.
- *
-
- See the <a href="http://bulletphysics.com/Bullet/BulletFull/
+classbtConeTwistConstraint.html"> bullet api refence</a> or the <a href=
- See the <a href="http://bulletphysics.com/Bullet/BulletFull/
- "http://bulletphysics.com/ftp/pub/test/physics/Bullet_User_Manual.pdf">
-
- bullet manual</a> for more information.
- bullet manual</a> for more information.
- *
-
@author normenhansen
*/
public class ConeJoint extends PhysicsJoint {
@@ -75,6 +84,12 @@
/**
-
@param pivotA local translation of the joint connection point in node A
-
@param pivotB local translation of the joint connection point in node B
-
* @param rotA rotate the axis of symmetry of the cone from its<br />
-
* default of Vector3f.UNIT_X relative to node A. rotA<br />
-
* must be a rotation matrix.<br />
-
* @param rotB rotate the axis of symmetry of the cone from its<br />
-
* default of Vector3f.UNIT_X relative to node B. rotB<br />
-
* must be a rotation matrix.<br />
*/
public ConeJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, Vector3f pivotA, Vector3f pivotB, Matrix3f rotA, Matrix3f rotB) {
super(nodeA, nodeB, pivotA, pivotB);
@@ -82,7 +97,26 @@
this.rotB = rotB;
createJoint();
}
-
+
- /**
-
* Specify the shape of the ConeJoint's cone, as well as the twist<br />
-
* limits.<br />
-
*<br />
-
* See the <a<br />
-
href="http://bulletphysics.org/mediawiki-1.5.8/index.php/Constraints"><br />
-
bullet wiki </a> for examples.<br />
-
* @param swingSpan1 when the axis of symmetry of the cone is at<br />
-
* its default of Vector3f.UNIT_X, swingSpan1 is the half angle of<br />
-
* the apex of the isosceles triangle made by projecting the cone<br />
-
* onto the XY plane. Value can range from 0 to (Math.PI / 2)<br />
-
* @param swingSpan2 when the axis of symmetry of the cone is at<br />
-
* its default of Vector3f.UNIT_X, swingSpan2 is the half angle of<br />
-
* the apex of the isosceles triangle made by projecting the cone<br />
-
* onto the XZ plane. Value can range from 0 to (Math.PI / 2)<br />
-
* @param twistSpan Maximum angle in radians that the two<br />
-
* connected bodies can twist along the axis of symmetry of the<br />
-
* cone. Value can range from 0 to (Math.PI * 2)<br />
-
*/<br />
public void setLimit(float swingSpan1, float swingSpan2, float twistSpan) {
this.swingSpan1 = swingSpan1;
this.swingSpan2 = swingSpan2;
@@ -90,6 +124,14 @@
((ConeTwistConstraint) constraint).setLimit(swingSpan1, swingSpan2, twistSpan);
}
- /**
-
* Sets weather the cone joint constraint should constrict the<br />
-
* translational degrees of freedom as in the {@link Point2PointJoint}<br />
-
* or leave the translational degrees of freedom free and only<br />
-
* affect rotational degrees of freedom.<br />
-
* @param value if true, leave translational DOFs free; if false,<br />
-
* constrain them as in {@link Point2PointJoint}.<br />
-
*/<br />
public void setAngularOnly(boolean value) {
angularOnly = value;
((ConeTwistConstraint) constraint).setAngularOnly(value);
[/patch]
sincerely,
–Robert McIntyre