public class New6Dof extends Constraint
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 rigid bodies, and the latter 3
dof axis represent the angular motion. Each axis can be either locked, free
or limited.
For each axis:
| Modifier and Type | Field and Description |
|---|---|
static java.util.logging.Logger |
logger2
message logger for this class
|
logger15, pivotA, pivotBloggerloggerN| Constructor and Description |
|---|
New6Dof(PhysicsRigidBody rigidBodyA,
PhysicsRigidBody rigidBodyB,
Vector3f pivotInA,
Vector3f pivotInB,
Matrix3f rotInA,
Matrix3f rotInB,
RotationOrder rotationOrder)
Instantiate a double-ended New6Dof constraint with all rotation DOFs free
and all translation DOFs locked.
|
New6Dof(PhysicsRigidBody rigidBodyB,
Vector3f pivotInB,
Vector3f pivotInWorld,
Matrix3f rotInB,
Matrix3f rotInWorld,
RotationOrder rotationOrder)
Instantiate a single-ended New6Dof constraint with all rotation DOFs free
and all translation DOFs locked.
|
| Modifier and Type | Method and Description |
|---|---|
Matrix3f |
calculatedBasisA(Matrix3f storeResult)
Calculate the pivot orientation of the A end.
|
Matrix3f |
calculatedBasisB(Matrix3f storeResult)
Calculate the pivot orientation of the B end.
|
Vector3f |
calculatedOriginA(Vector3f storeResult)
Calculate the pivot location of the A end (native field:
m_calculatedTransformA.m_origin).
|
Vector3f |
calculatedOriginB(Vector3f storeResult)
Calculate the pivot location of the B end (native field:
m_calculatedTransformB.m_origin).
|
boolean |
checkRotationOrder()
Compare Bullet's rotation order to the JVM copy.
|
void |
enableSpring(int dofIndex,
boolean onOff)
Enable or disable the spring for the indexed degree of freedom.
|
float |
get(MotorParam parameter,
int dofIndex)
Read the specified parameter of the indexed degree of freedom.
|
Vector3f |
getAngles(Vector3f storeResult)
Calculate the constraint's rotation angles (native field:
m_calculatedAxisAngleDiff).
|
Vector3f |
getAxis(int axisIndex,
Vector3f storeResult)
Calculate the indexed axis of the Constraint (native field:
m_calculatedAxis).
|
Transform |
getFrameTransform(JointEnd end,
Transform storeResult)
Copy the constraint's frame transform relative to the specified end
(native fields: m_frameInA, m_frameInB).
|
Vector3f |
getPivotOffset(Vector3f storeResult)
Copy the constraint's pivot offset (native field:
m_calculatedLinearDiff).
|
Matrix3f |
getRotationMatrix(JointEnd end,
Matrix3f storeResult)
Copy the orientation of the constraint in the specified end's coordinate
system.
|
RotationMotor |
getRotationMotor(int axisIndex)
Access the indexed RotationMotor of this constraint, the motor which
influences rotation around the indexed axis.
|
RotationOrder |
getRotationOrder()
Return the order in which axis rotations are applied (native field:
m_rotateOrder).
|
TranslationMotor |
getTranslationMotor()
Access the TranslationMotor of this Constraint, the motor which
influences translation on all 3 axes.
|
boolean |
isMotorEnabled(int dofIndex)
Test whether the motor is enabled for the indexed degree of freedom.
|
boolean |
isServoEnabled(int dofIndex)
Test whether the servo is enabled for the indexed degree of freedom.
|
boolean |
isSpringEnabled(int dofIndex)
Test whether the spring is enabled for the indexed degree of freedom.
|
static New6Dof |
newInstance(PhysicsRigidBody rigidBodyA,
PhysicsRigidBody rigidBodyB,
Vector3f pivotInWorld,
Quaternion rotInWorld,
RotationOrder rotationOrder)
Instantiate a double-ended New6Dof constraint with all rotation DOFs free
and all translation DOFs locked at zero.
|
void |
set(MotorParam parameter,
int dofIndex,
float value)
Alter the specified parameter for the indexed degree of freedom.
|
void |
setDamping(int dofIndex,
float damping,
boolean limitIfNeeded)
Alter the damping for the indexed degree of freedom.
|
void |
setEquilibriumPoint()
Alter the equilibrium points for all degrees of freedom, based on the
constraint's current location/orientation.
|
void |
setEquilibriumPoint(int dofIndex)
Alter the equilibrium point of the indexed degree of freedom, based on
the constraint's current location/orientation.
|
void |
setEquilibriumPoint(int dofIndex,
float value)
Alter the equilibrium point of the indexed degree of freedom.
|
void |
setPivotInA(Vector3f location)
Alter the pivot location in A's scaled local coordinates.
|
void |
setPivotInB(Vector3f location)
Alter the pivot location in B's scaled local coordinates.
|
void |
setRotationOrder(RotationOrder rotationOrder)
Alter the order in which to apply axis rotations.
|
void |
setStiffness(int dofIndex,
float stiffness,
boolean limitIfNeeded)
Alter the spring stiffness for the indexed degree of freedom.
|
getAppliedImpulse, getBodyA, getBodyB, getBreakingImpulseThreshold, getConstraintType, getOverrideIterations, getPivot, getPivotA, getPivotB, isCollisionBetweenLinkedBodies, isEnabled, isFeedback, overrideIterations, setBreakingImpulseThreshold, setCollisionBetweenLinkedBodies, setEnabled, setFeedbackcountEnds, 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 New6Dof(PhysicsRigidBody rigidBodyB, Vector3f pivotInB, Vector3f pivotInWorld, Matrix3f rotInB, Matrix3f rotInWorld, RotationOrder rotationOrder)
To be effective, the constraint 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 constraint in B's local coordinates
(rotation matrix, not null, unaffected)rotInWorld - the orientation of the constraint in physics-space
coordinates (rotation matrix, not null, unaffected)rotationOrder - the order in which to apply axis rotations (not
null)public New6Dof(PhysicsRigidBody rigidBodyA, PhysicsRigidBody rigidBodyB, Vector3f pivotInA, Vector3f pivotInB, Matrix3f rotInA, Matrix3f rotInB, RotationOrder rotationOrder)
To be effective, the constraint 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 constraint in A's local coordinates
(not null, unaffected)rotInB - the orientation of the constraint in B's local coordinates
(not null, unaffected)rotationOrder - the order in which to apply axis rotations (not
null)public Matrix3f calculatedBasisA(Matrix3f storeResult)
storeResult - storage for the result (modified if not null)public Matrix3f calculatedBasisB(Matrix3f storeResult)
storeResult - storage for the result (modified if not null)public Vector3f calculatedOriginA(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public Vector3f calculatedOriginB(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public boolean checkRotationOrder()
public 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 get(MotorParam parameter, int dofIndex)
parameter - which parameter (not null)dofIndex - which degree of freedom (0→X translation, 1→Y
translation, 2→Z translation, 3→X rotation, 4→Y rotation,
5→Z rotation)public Vector3f getAngles(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public Vector3f getAxis(int axisIndex, Vector3f storeResult)
axisIndex - the axis index of the desired motor: 0→X, 1→Y,
2→ZstoreResult - 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 getPivotOffset(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public Matrix3f getRotationMatrix(JointEnd end, Matrix3f storeResult)
end - which end (not null)storeResult - storage for the result (modified if not null)Constraint.getPivot(
com.jme3.bullet.joints.JointEnd, com.jme3.math.Vector3f)public RotationMotor getRotationMotor(int axisIndex)
axisIndex - the axis index of the desired motor: 0→X, 1→Y,
2→Zpublic RotationOrder getRotationOrder()
public TranslationMotor getTranslationMotor()
public boolean isMotorEnabled(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 isServoEnabled(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 static New6Dof newInstance(PhysicsRigidBody rigidBodyA, PhysicsRigidBody rigidBodyB, Vector3f pivotInWorld, Quaternion rotInWorld, RotationOrder rotationOrder)
To be effective, the Constraint 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)pivotInWorld - the pivot location (in physics-space coordinates, not
null, unaffected)rotInWorld - the orientation of the constraint (in physics-space
coordinates, not null, not zero, unaffected)rotationOrder - the order in which to apply axis rotations (not
null)public void set(MotorParam parameter, int dofIndex, float value)
parameter - which parameter (not null)dofIndex - which degree of freedom (0→X translation, 1→Y
translation, 2→Z translation, 3→X rotation, 4→Y rotation,
5→Z rotation)value - the desired parameter valuepublic void setDamping(int dofIndex,
float damping,
boolean limitIfNeeded)
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)limitIfNeeded - true→automatically limit damping to prevent the
spring from blowing uppublic 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 setEquilibriumPoint(int dofIndex,
float value)
dofIndex - which degree of freedom (0→X translation, 1→Y
translation, 2→Z translation, 3→X rotation, 4→Y rotation,
5→Z rotation)value - the desired equilibrium pointpublic void setRotationOrder(RotationOrder rotationOrder)
rotationOrder - the desired order (not null)public void setStiffness(int dofIndex,
float stiffness,
boolean limitIfNeeded)
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)limitIfNeeded - true→automatically limit stiffness to prevent
the spring from moving too widelypublic void setPivotInA(Vector3f location)
setPivotInA in class Constraintlocation - the desired location (not null, unaffected)public void setPivotInB(Vector3f location)
setPivotInB in class Constraintlocation - the desired location (not null, unaffected)