public class Generic6DofConstraint extends TypedConstraint
Generic6DofConstraint can leave any of the 6 degree of freedom "free" or "locked".
Currently this limit supports rotational motors.
setLinearUpperLimit(javax.vecmath.Vector3f), setLinearLowerLimit(javax.vecmath.Vector3f).
You can set the parameters with the TranslationalLimitMotor structure accsesible
through the getTranslationalLimitMotor() method.
At this moment translational motors are not supported. May be in the future.RotationalLimitMotor structure for configuring
the limit. This is accessible through getRotationalLimitMotor(int) method,
this brings support for limit parameters and motors.| AXIS | MIN ANGLE | MAX ANGLE |
| X | -PI | PI |
| Y | -PI/2 | PI/2 |
| Z | -PI/2 | PI/2 |
| Constructor and Description |
|---|
Generic6DofConstraint() |
Generic6DofConstraint(RigidBody rbA,
RigidBody rbB,
Transform frameInA,
Transform frameInB,
boolean useLinearReferenceFrameA) |
| Modifier and Type | Method and Description |
|---|---|
void |
buildJacobian() |
void |
calcAnchorPos() |
void |
calculateTransforms()
Calcs global transform of the offsets.
|
float |
getAngle(int axis_index)
Get the relative Euler angle.
|
Vector3f |
getAxis(int axis_index,
Vector3f out)
Get the rotation axis in global coordinates.
|
Transform |
getCalculatedTransformA(Transform out)
Gets the global transform of the offset for body A.
|
Transform |
getCalculatedTransformB(Transform out)
Gets the global transform of the offset for body B.
|
Transform |
getFrameOffsetA(Transform out) |
Transform |
getFrameOffsetB(Transform out) |
RotationalLimitMotor |
getRotationalLimitMotor(int index)
Retrieves the angular limit informacion.
|
TranslationalLimitMotor |
getTranslationalLimitMotor()
Retrieves the limit informacion.
|
boolean |
isLimited(int limitIndex)
Test limit.
|
void |
setAngularLowerLimit(Vector3f angularLower) |
void |
setAngularUpperLimit(Vector3f angularUpper) |
void |
setLimit(int axis,
float lo,
float hi)
first 3 are linear, next 3 are angular
|
void |
setLinearLowerLimit(Vector3f linearLower) |
void |
setLinearUpperLimit(Vector3f linearUpper) |
void |
solveConstraint(float timeStep) |
boolean |
testAngularLimitMotor(int axis_index)
Test angular limit.
|
void |
updateRHS(float timeStep) |
getAppliedImpulse, getConstraintType, getRigidBodyA, getRigidBodyB, getUid, getUserConstraintId, getUserConstraintType, setUserConstraintId, setUserConstraintTypepublic void calculateTransforms()
Calcs the global transform for the joint offset for body A an B, and also calcs the agle differences between the bodies. See also: Generic6DofConstraint.getCalculatedTransformA, Generic6DofConstraint.getCalculatedTransformB, Generic6DofConstraint.calculateAngleInfo
public boolean testAngularLimitMotor(int axis_index)
Calculates angular correction and returns true if limit needs to be corrected. Generic6DofConstraint.buildJacobian must be called previously.
public void buildJacobian()
buildJacobian in class TypedConstraintpublic void solveConstraint(float timeStep)
solveConstraint in class TypedConstraintpublic void updateRHS(float timeStep)
public Vector3f getAxis(int axis_index, Vector3f out)
public float getAngle(int axis_index)
public Transform getCalculatedTransformA(Transform out)
See also: Generic6DofConstraint.getFrameOffsetA, Generic6DofConstraint.getFrameOffsetB, Generic6DofConstraint.calculateAngleInfo.
public Transform getCalculatedTransformB(Transform out)
See also: Generic6DofConstraint.getFrameOffsetA, Generic6DofConstraint.getFrameOffsetB, Generic6DofConstraint.calculateAngleInfo.
public void setLinearLowerLimit(Vector3f linearLower)
public void setLinearUpperLimit(Vector3f linearUpper)
public void setAngularLowerLimit(Vector3f angularLower)
public void setAngularUpperLimit(Vector3f angularUpper)
public RotationalLimitMotor getRotationalLimitMotor(int index)
public TranslationalLimitMotor getTranslationalLimitMotor()
public void setLimit(int axis,
float lo,
float hi)
public boolean isLimited(int limitIndex)
- free means upper < lower,
- locked means upper == lower
- limited means upper > lower
- limitIndex: first 3 are linear, next 3 are angular
public void calcAnchorPos()