|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bulletphysics.dynamics.constraintsolver.TypedConstraint
com.bulletphysics.dynamics.constraintsolver.Generic6DofConstraint
public class Generic6DofConstraint
Generic6DofConstraint between two rigidbodies each with a pivotpoint 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.
AXIS | MIN ANGLE | MAX ANGLE |
X | -PI | PI |
Y | -PI/2 | PI/2 |
Z | -PI/2 | PI/2 |
Field Summary | |
---|---|
protected RotationalLimitMotor[] |
angularLimits
|
protected javax.vecmath.Vector3f |
anchorPos
|
protected javax.vecmath.Vector3f[] |
calculatedAxis
|
protected javax.vecmath.Vector3f |
calculatedAxisAngleDiff
|
protected Transform |
calculatedTransformA
|
protected Transform |
calculatedTransformB
|
protected Transform |
frameInA
|
protected Transform |
frameInB
|
protected JacobianEntry[] |
jacAng
|
protected JacobianEntry[] |
jacLinear
|
protected TranslationalLimitMotor |
linearLimits
|
protected float |
timeStep
|
protected boolean |
useLinearReferenceFrameA
|
Fields inherited from class com.bulletphysics.dynamics.constraintsolver.TypedConstraint |
---|
appliedImpulse, rbA, rbB |
Constructor Summary | |
---|---|
Generic6DofConstraint()
|
|
Generic6DofConstraint(RigidBody rbA,
RigidBody rbB,
Transform frameInA,
Transform frameInB,
boolean useLinearReferenceFrameA)
|
Method Summary | |
---|---|
protected void |
buildAngularJacobian(int jacAngular_index,
javax.vecmath.Vector3f jointAxisW)
|
void |
buildJacobian()
|
protected void |
buildLinearJacobian(int jacLinear_index,
javax.vecmath.Vector3f normalWorld,
javax.vecmath.Vector3f pivotAInW,
javax.vecmath.Vector3f pivotBInW)
|
void |
calcAnchorPos()
|
protected void |
calculateAngleInfo()
Calcs the euler angles between the two bodies. |
void |
calculateTransforms()
Calcs global transform of the offsets. |
float |
getAngle(int axis_index)
Get the relative Euler angle. |
javax.vecmath.Vector3f |
getAxis(int axis_index,
javax.vecmath.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(javax.vecmath.Vector3f angularLower)
|
void |
setAngularUpperLimit(javax.vecmath.Vector3f angularUpper)
|
void |
setLimit(int axis,
float lo,
float hi)
first 3 are linear, next 3 are angular |
void |
setLinearLowerLimit(javax.vecmath.Vector3f linearLower)
|
void |
setLinearUpperLimit(javax.vecmath.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 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Transform frameInA
protected final Transform frameInB
protected final JacobianEntry[] jacLinear
protected final JacobianEntry[] jacAng
protected final TranslationalLimitMotor linearLimits
protected final RotationalLimitMotor[] angularLimits
protected float timeStep
protected final Transform calculatedTransformA
protected final Transform calculatedTransformB
protected final javax.vecmath.Vector3f calculatedAxisAngleDiff
protected final javax.vecmath.Vector3f[] calculatedAxis
protected final javax.vecmath.Vector3f anchorPos
protected boolean useLinearReferenceFrameA
Constructor Detail |
---|
public Generic6DofConstraint()
public Generic6DofConstraint(RigidBody rbA, RigidBody rbB, Transform frameInA, Transform frameInB, boolean useLinearReferenceFrameA)
Method Detail |
---|
protected void calculateAngleInfo()
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
protected void buildLinearJacobian(int jacLinear_index, javax.vecmath.Vector3f normalWorld, javax.vecmath.Vector3f pivotAInW, javax.vecmath.Vector3f pivotBInW)
protected void buildAngularJacobian(int jacAngular_index, javax.vecmath.Vector3f jointAxisW)
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 javax.vecmath.Vector3f getAxis(int axis_index, javax.vecmath.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(javax.vecmath.Vector3f linearLower)
public void setLinearUpperLimit(javax.vecmath.Vector3f linearUpper)
public void setAngularLowerLimit(javax.vecmath.Vector3f angularLower)
public void setAngularUpperLimit(javax.vecmath.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 |