public class SixDofJoint extends Constraint
From the Bullet manual:
For each axis:
It is recommended to use the btGeneric6DofSpring2Constraint, it has some improvements over the original btGeneric6Dof(Spring)Constraint.
New6Dof| Modifier and Type | Field and Description |
|---|---|
static java.util.logging.Logger |
logger2
message logger for this class
|
logger15, pivotA, pivotBloggerloggerN| Constructor and Description |
|---|
SixDofJoint(PhysicsRigidBody rigidBodyA,
PhysicsRigidBody rigidBodyB,
Vector3f pivotInA,
Vector3f pivotInB,
boolean useLinearReferenceFrameA)
Instantiate a double-ended SixDofJoint.
|
SixDofJoint(PhysicsRigidBody rigidBodyA,
PhysicsRigidBody rigidBodyB,
Vector3f pivotInA,
Vector3f pivotInB,
Matrix3f rotInA,
Matrix3f rotInB,
boolean useLinearReferenceFrameA)
Instantiate a double-ended SixDofJoint.
|
SixDofJoint(PhysicsRigidBody rigidBodyB,
Vector3f pivotInB,
Vector3f pivotInWorld,
Matrix3f rotInB,
Matrix3f rotInWorld,
JointEnd linearReferenceFrame)
Instantiate a single-ended SixDofJoint.
|
| Modifier and Type | Method and Description |
|---|---|
protected long |
createJoint(long bodyIdA,
long bodyIdB,
Vector3f pivotInA,
Matrix3f rotInA,
Vector3f pivotInB,
Matrix3f rotInB,
boolean useLinearReferenceFrameA)
Create a double-ended
btGeneric6DofConstraint. |
protected long |
createJoint1(long bodyIdB,
Vector3f pivotInB,
Matrix3f rotInB,
boolean useLinearReferenceFrameB)
Create a single-ended
btGeneric6DofConstraint. |
Vector3f |
getAngles(Vector3f storeResult)
Copy the joint's rotation angles.
|
Vector3f |
getAngularLowerLimit(Vector3f storeResult)
Copy the joint's lower limits for rotation on all 3 axes.
|
Vector3f |
getAngularUpperLimit(Vector3f storeResult)
Copy the joint's upper limits for rotation on all 3 axes.
|
Transform |
getFrameTransform(JointEnd end,
Transform storeResult)
Copy the joint's frame transform relative to the specified end.
|
Vector3f |
getLinearLowerLimit(Vector3f storeResult)
Copy the joint's lower limits for translation on all 3 axes.
|
Vector3f |
getLinearUpperLimit(Vector3f storeResult)
Copy the joint's upper limits for translation on all 3 axes.
|
Vector3f |
getPivotOffset(Vector3f storeResult)
Copy the joint's pivot offset.
|
RotationalLimitMotor |
getRotationalLimitMotor(int axisIndex)
Access the indexed RotationalLimitMotor of this joint, the motor which
influences rotation around the indexed axis.
|
TranslationalLimitMotor |
getTranslationalLimitMotor()
Access the TranslationalLimitMotor of this joint, the motor which
influences translation on all 3 axes.
|
void |
setAngularLowerLimit(Vector3f limits)
Alter the joint's lower limits for rotation of all 3 axes.
|
void |
setAngularUpperLimit(Vector3f limits)
Alter the joint's upper limits for rotation of all 3 axes.
|
void |
setLinearLowerLimit(Vector3f vector)
Alter the joint's lower limits for translation of all 3 axes.
|
void |
setLinearUpperLimit(Vector3f vector)
Alter the joint's upper limits for translation of all 3 axes.
|
getAppliedImpulse, getBodyA, getBodyB, getBreakingImpulseThreshold, getConstraintType, getOverrideIterations, getPivot, getPivotA, getPivotB, isCollisionBetweenLinkedBodies, isEnabled, isFeedback, overrideIterations, setBreakingImpulseThreshold, setCollisionBetweenLinkedBodies, setEnabled, setFeedback, setPivotInA, setPivotInBcountEnds, destroy, findEnd, findOtherBody, getBody, getPhysicsSpace, setBodyA, setBodyB, setNativeId, setPhysicsSpace, toStringcompareTo, countTrackers, dumpTrackers, equals, freeUnusedObjects, hasAssignedNativeObject, hashCode, nativeId, reassignNativeId, setNativeIdNotTracked, unassignNativeObjectpublic static final java.util.logging.Logger logger2
public SixDofJoint(PhysicsRigidBody rigidBodyB, Vector3f pivotInB, Vector3f pivotInWorld, Matrix3f rotInB, Matrix3f rotInWorld, JointEnd linearReferenceFrame)
To be effective, the joint must be added to the body's PhysicsSpace and the body must be dynamic.
rigidBodyB - the body to constrain (not null, alias created)pivotInB - the pivot location in B's scaled local coordinates (not
null, unaffected)pivotInWorld - the pivot location in physics-space coordinates (not
null, unaffected)rotInB - the orientation of the joint in B's local coordinates
(rotation matrix, not null, unaffected)rotInWorld - the orientation of the joint in physics-space
coordinates (rotation matrix, not null, unaffected)linearReferenceFrame - which end to use as the linear reference
frame (not null)public SixDofJoint(PhysicsRigidBody rigidBodyA, PhysicsRigidBody rigidBodyB, Vector3f pivotInA, Vector3f pivotInB, Matrix3f rotInA, Matrix3f rotInB, boolean useLinearReferenceFrameA)
To be effective, the joint must be added to the PhysicsSpace of both bodies. Also, the bodies must be distinct and at least one of them must be dynamic.
rigidBodyA - the body for the A end (not null, alias created)rigidBodyB - the body for the B end (not null, alias created)pivotInA - the pivot location in A's scaled local coordinates (not
null, unaffected)pivotInB - the pivot location in B's scaled local coordinates (not
null, unaffected)rotInA - the joint orientation in A's local coordinates (rotation
matrix, unaffected)rotInB - the joint orientation in B's local coordinates (rotation
matrix, unaffected)useLinearReferenceFrameA - true→use body A, false→use body
Bpublic SixDofJoint(PhysicsRigidBody rigidBodyA, PhysicsRigidBody rigidBodyB, Vector3f pivotInA, Vector3f pivotInB, boolean useLinearReferenceFrameA)
To be effective, the joint must be added to the body's PhysicsSpace and the body must be dynamic.
rigidBodyA - the first body to constrain (not null, alias created)rigidBodyB - the 2nd body to constrain (not null, alias created)pivotInA - the pivot location in A's scaled local coordinates (not
null, unaffected)pivotInB - the pivot location in B's scaled local coordinates (not
null, unaffected)useLinearReferenceFrameA - true→use body A, false→use body
Bpublic Vector3f getAngles(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public Vector3f getAngularLowerLimit(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public Vector3f getAngularUpperLimit(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public Transform getFrameTransform(JointEnd end, Transform storeResult)
end - which end (not null)storeResult - storage for the result (modified if not null)public Vector3f getLinearLowerLimit(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public Vector3f getLinearUpperLimit(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public Vector3f getPivotOffset(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public RotationalLimitMotor getRotationalLimitMotor(int axisIndex)
axisIndex - the axis index of the desired motor: 0→X, 1→Y,
2→Zpublic TranslationalLimitMotor getTranslationalLimitMotor()
public void setAngularLowerLimit(Vector3f limits)
limits - the desired lower limits (in radians, not null, unaffected)public void setAngularUpperLimit(Vector3f limits)
limits - the desired upper limits (in radians, not null, unaffected)public void setLinearLowerLimit(Vector3f vector)
vector - the desired lower limits (not null, unaffected)public void setLinearUpperLimit(Vector3f vector)
vector - the desired upper limits (not null, unaffected)protected long createJoint(long bodyIdA,
long bodyIdB,
Vector3f pivotInA,
Matrix3f rotInA,
Vector3f pivotInB,
Matrix3f rotInB,
boolean useLinearReferenceFrameA)
btGeneric6DofConstraint.bodyIdA - the ID of the body for the A end (not zero)bodyIdB - the ID of the body for the B end (not zero)pivotInA - the pivot location in A's scaled local coordinates (not
null, unaffected)rotInA - the orientation of the joint in A's local coordinates (not
null, unaffected)pivotInB - the pivot location in B's scaled local coordinates (not
null, unaffected)rotInB - the orientation of the joint in B's local coordinates (not
null, unaffected)useLinearReferenceFrameA - true→use body A, false→use body
Bprotected long createJoint1(long bodyIdB,
Vector3f pivotInB,
Matrix3f rotInB,
boolean useLinearReferenceFrameB)
btGeneric6DofConstraint.bodyIdB - the ID of the body for the B end (not zero)pivotInB - the pivot location in B's scaled local coordinates (not
null, unaffected)rotInB - the orientation of the joint in B's local coordinates (not
null, unaffected)useLinearReferenceFrameB - true→use body A, false→use body
B