public class SixDofJoint extends PhysicsJoint
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
Modifier | Constructor and Description |
---|---|
protected |
SixDofJoint()
No-argument constructor needed by SavableClassUtil.
|
|
SixDofJoint(PhysicsRigidBody nodeA,
PhysicsRigidBody nodeB,
Vector3f pivotA,
Vector3f pivotB,
boolean useLinearReferenceFrameA)
Instantiate a SixDofJoint.
|
|
SixDofJoint(PhysicsRigidBody nodeA,
PhysicsRigidBody nodeB,
Vector3f pivotA,
Vector3f pivotB,
Matrix3f rotA,
Matrix3f rotB,
boolean useLinearReferenceFrameA)
Instantiate a SixDofJoint.
|
Modifier and Type | Method and Description |
---|---|
Vector3f |
getAngles(Vector3f storeResult)
Copy the joint's rotation angles.
|
RotationalLimitMotor |
getRotationalLimitMotor(int index)
Access the indexed RotationalLimitMotor of this joint, the motor which
influences rotation around one axis.
|
TranslationalLimitMotor |
getTranslationalLimitMotor()
Access the TranslationalLimitMotor of this joint, the motor which
influences translation on all 3 axes.
|
void |
read(JmeImporter im)
De-serialize this joint, for example when loading from a J3O file.
|
void |
setAngularLowerLimit(Vector3f vector)
Alter the joint's lower limits for rotation of all 3 axes.
|
void |
setAngularUpperLimit(Vector3f vector)
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.
|
void |
write(JmeExporter ex)
Serialize this joint, for example when saving to a J3O file.
|
destroy, finalize, getAppliedImpulse, getBodyA, getBodyB, getObjectId, getPivotA, getPivotB, isCollisionBetweenLinkedBodys, setCollisionBetweenLinkedBodys
protected SixDofJoint()
public SixDofJoint(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 SixDofJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, Vector3f pivotA, Vector3f pivotB, 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)useLinearReferenceFrameA
- true→use node A, false→use node
Bpublic Vector3f getAngles(Vector3f storeResult)
storeResult
- storage for the result (modified if not null)public TranslationalLimitMotor getTranslationalLimitMotor()
public RotationalLimitMotor getRotationalLimitMotor(int index)
index
- the axis index of the desired motor: 0→X, 1→Y,
2→Zpublic void setLinearUpperLimit(Vector3f vector)
vector
- the desired upper limits (not null, unaffected)public void setLinearLowerLimit(Vector3f vector)
vector
- the desired lower limits (not null, unaffected)public void setAngularUpperLimit(Vector3f vector)
vector
- the desired upper limits (in radians, not null, unaffected)public void setAngularLowerLimit(Vector3f vector)
vector
- the desired lower limits (in radians, not null, unaffected)public void read(JmeImporter im) throws java.io.IOException
read
in interface Savable
read
in class PhysicsJoint
im
- importer (not null)java.io.IOException
- from importerpublic void write(JmeExporter ex) throws java.io.IOException
write
in interface Savable
write
in class PhysicsJoint
ex
- exporter (not null)java.io.IOException
- from exporter