public class SixDofSpringJoint extends SixDofJoint
From the Bullet manual:
This generic constraint can emulate a variety of standard constraints, by
configuring each of the 6 degrees of freedom (dof). The first 3 dof axis are
linear axis, which represent translation of rigidbodies, and the latter 3 dof
axis represent the angular motion. Each axis can be either locked, free or
limited. On construction of a new btGeneric6DofSpring2Constraint, all axis
are locked. Afterwards the axis can be reconfigured. Note that several
combinations that include free and/or limited angular degrees of freedom are
undefined.
For each axis:
collisionBetweenLinkedBodys, nodeA, nodeB, objectId, pivotA, pivotB| Constructor and Description |
|---|
SixDofSpringJoint()
No-argument constructor needed by SavableClassUtil.
|
SixDofSpringJoint(PhysicsRigidBody nodeA,
PhysicsRigidBody nodeB,
Vector3f pivotA,
Vector3f pivotB,
Matrix3f rotA,
Matrix3f rotB,
boolean useLinearReferenceFrameA)
Instantiate a SixDofSpringJoint.
|
| Modifier and Type | Method and Description |
|---|---|
void |
enableSpring(int index,
boolean onOff)
Enable or disable the spring for the indexed degree of freedom.
|
void |
setDamping(int index,
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
current constraint position/orientation.
|
void |
setEquilibriumPoint(int index)
Alter the equilibrium point of the indexed degree of freedom, based on
the current constraint position/orientation.
|
void |
setStiffness(int index,
float stiffness)
Alter the spring stiffness for the indexed degree of freedom.
|
getAngles, getRotationalLimitMotor, getTranslationalLimitMotor, read, setAngularLowerLimit, setAngularUpperLimit, setLinearLowerLimit, setLinearUpperLimit, writedestroy, finalize, getAppliedImpulse, getBodyA, getBodyB, getObjectId, getPivotA, getPivotB, isCollisionBetweenLinkedBodys, setCollisionBetweenLinkedBodyspublic SixDofSpringJoint()
public SixDofSpringJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, Vector3f pivotA, Vector3f pivotB, Matrix3f rotA, Matrix3f rotB, boolean useLinearReferenceFrameA)
nodeA - the 1st body connected by the joint (not null, alias
created)nodeB - the 2nd body connected by the joint (not null, alias
created)pivotA - the local offset of the connection point in node A (not
null, alias created)pivotB - the local offset of the connection point in node B (not
null, alias created)rotA - the local orientation of the connection to node A (not
null, alias created)rotB - the local orientation of the connection to node B (not
null, alias created)useLinearReferenceFrameA - true→use node A, false→use node
Bpublic void enableSpring(int index,
boolean onOff)
index - which degree of freedom (≥0, <6)onOff - true → enable, false → disablepublic void setStiffness(int index,
float stiffness)
index - which degree of freedom (≥0, <6)stiffness - the desired stiffnesspublic void setDamping(int index,
float damping)
index - which degree of freedom (≥0, <6)damping - the desired viscous damping ratio (0→no damping,
1→critically damped, default=1)public void setEquilibriumPoint()
public void setEquilibriumPoint(int index)
index - which degree of freedom (≥0, <6)