public class SixDofSpringJoint extends SixDofJoint
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 |
logger3
message logger for this class
|
logger2logger15, pivotA, pivotBloggerloggerN| Constructor and Description |
|---|
SixDofSpringJoint(PhysicsRigidBody rigidBodyA,
PhysicsRigidBody rigidBodyB,
Vector3f pivotInA,
Vector3f pivotInB,
Matrix3f rotInA,
Matrix3f rotInB,
boolean useLinearReferenceFrameA)
Instantiate a double-ended SixDofSpringJoint.
|
SixDofSpringJoint(PhysicsRigidBody rigidBodyB,
Vector3f pivotInB,
Vector3f pivotInWorld,
Matrix3f rotInB,
Matrix3f rotInWorld,
JointEnd linearReferenceFrame)
Instantiate a single-ended SixDofSpringJoint.
|
| 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
btGeneric6DofSpringConstraint. |
protected long |
createJoint1(long bodyIdB,
Vector3f pivotInB,
Matrix3f rotInB,
boolean useLinearReferenceFrameB)
Create a single-ended
btGeneric6DofSpringConstraint. |
void |
enableSpring(int dofIndex,
boolean onOff)
Enable or disable the spring for the indexed degree of freedom.
|
float |
getDamping(int dofIndex)
Read the damping of the indexed degree of freedom.
|
float |
getEquilibriumPoint(int dofIndex)
Read the equilibrium point of the indexed degree of freedom.
|
float |
getStiffness(int dofIndex)
Read the spring stiffness of the indexed degree of freedom.
|
boolean |
isSpringEnabled(int dofIndex)
Test whether the spring for the indexed degree of freedom is enabled.
|
void |
setDamping(int dofIndex,
float damping)
Alter the damping for the indexed degree of freedom.
|
void |
setEquilibriumPoint()
Alter the equilibrium points for all degrees of freedom, based on the
joint's current location/orientation.
|
void |
setEquilibriumPoint(int dofIndex)
Alter the equilibrium point of the indexed degree of freedom, based on
the joint's current location/orientation.
|
void |
setStiffness(int dofIndex,
float stiffness)
Alter the spring stiffness for the indexed degree of freedom.
|
getAngles, getAngularLowerLimit, getAngularUpperLimit, getFrameTransform, getLinearLowerLimit, getLinearUpperLimit, getPivotOffset, getRotationalLimitMotor, getTranslationalLimitMotor, setAngularLowerLimit, setAngularUpperLimit, setLinearLowerLimit, setLinearUpperLimitgetAppliedImpulse, 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 logger3
public SixDofSpringJoint(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 SixDofSpringJoint(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 orientation of the joint in A's 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
Bpublic void enableSpring(int dofIndex,
boolean onOff)
dofIndex - which degree of freedom (0→X translation, 1→Y
translation, 2→Z translation, 3→X rotation, 4→Y rotation,
5→Z rotation)onOff - true → enable, false → disable (default=false)public float getDamping(int dofIndex)
dofIndex - which degree of freedom (0→X translation, 1→Y
translation, 2→Z translation, 3→X rotation, 4→Y rotation,
5→Z rotation)public float getEquilibriumPoint(int dofIndex)
dofIndex - which degree of freedom (0→X translation, 1→Y
translation, 2→Z translation, 3→X rotation, 4→Y rotation,
5→Z rotation)public float getStiffness(int dofIndex)
dofIndex - which degree of freedom (0→X translation, 1→Y
translation, 2→Z translation, 3→X rotation, 4→Y rotation,
5→Z rotation)public boolean isSpringEnabled(int dofIndex)
dofIndex - which degree of freedom (0→X translation, 1→Y
translation, 2→Z translation, 3→X rotation, 4→Y rotation,
5→Z rotation)public void setDamping(int dofIndex,
float damping)
dofIndex - which degree of freedom (0→X translation, 1→Y
translation, 2→Z translation, 3→X rotation, 4→Y rotation,
5→Z rotation)damping - the desired viscous damping ratio (0→no damping,
1→critically damped, default=1)public void setEquilibriumPoint()
public void setEquilibriumPoint(int dofIndex)
dofIndex - which degree of freedom (0→X translation, 1→Y
translation, 2→Z translation, 3→X rotation, 4→Y rotation,
5→Z rotation)public void setStiffness(int dofIndex,
float stiffness)
dofIndex - which degree of freedom (0→X translation, 1→Y
translation, 2→Z translation, 3→X rotation, 4→Y rotation,
5→Z rotation)stiffness - the desired stiffness (default=0)protected long createJoint(long bodyIdA,
long bodyIdB,
Vector3f pivotInA,
Matrix3f rotInA,
Vector3f pivotInB,
Matrix3f rotInB,
boolean useLinearReferenceFrameA)
btGeneric6DofSpringConstraint.createJoint in class SixDofJointbodyIdA - 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)
btGeneric6DofSpringConstraint.createJoint1 in class SixDofJointbodyIdB - 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