|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bulletphysics.dynamics.constraintsolver.TypedConstraint com.bulletphysics.dynamics.constraintsolver.Generic6DofConstraint
public class Generic6DofConstraint
Generic6DofConstraint between two rigidbodies each with a pivot point that descibes the axis location in local space.
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 Summary | |
---|---|
Generic6DofConstraint()
|
|
Generic6DofConstraint(RigidBody rbA,
RigidBody rbB,
Transform frameInA,
Transform frameInB,
boolean useLinearReferenceFrameA)
|
Method Summary | |
---|---|
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)
|
Methods inherited from class com.bulletphysics.dynamics.constraintsolver.TypedConstraint |
---|
getAppliedImpulse, getConstraintType, getRigidBodyA, getRigidBodyB, getUid, getUserConstraintId, getUserConstraintType, setUserConstraintId, setUserConstraintType |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Generic6DofConstraint()
public Generic6DofConstraint(RigidBody rbA, RigidBody rbB, Transform frameInA, Transform frameInB, boolean useLinearReferenceFrameA)
Method Detail |
---|
public 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 TypedConstraint
public void solveConstraint(float timeStep)
solveConstraint
in class TypedConstraint
public 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 Transform getFrameOffsetA(Transform out)
public Transform getFrameOffsetB(Transform out)
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()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |