public abstract class Constraint extends PhysicsJoint
| Modifier and Type | Field and Description |
|---|---|
static java.util.logging.Logger |
logger15
message logger for this class
|
protected Vector3f |
pivotA
copy of the pivot location: in physics-space coordinates if bodyA is
null, or else in A's scaled local coordinates
|
protected Vector3f |
pivotB
copy of the pivot location: in physics-space coordinates if bodyB is
null, or else in B's scaled local coordinates
|
loggerloggerN| Modifier | Constructor and Description |
|---|---|
protected |
Constraint(PhysicsBody bodyA,
PhysicsBody bodyB,
Vector3f pivotInA,
Vector3f pivotInB)
Instantiate an enabled, double-ended Constraint.
|
protected |
Constraint(PhysicsRigidBody body,
JointEnd bodyEnd,
Vector3f pivotInBody)
Instantiate an enabled, single-ended Constraint using the specified body
at the specified end.
|
protected |
Constraint(PhysicsRigidBody body,
JointEnd bodyEnd,
Vector3f pivotInBody,
Vector3f pivotInWorld)
Instantiate an enabled, single-ended Constraint using the specified body
at the specified end.
|
| Modifier and Type | Method and Description |
|---|---|
float |
getAppliedImpulse()
Determine the magnitude of the applied impulse.
|
PhysicsRigidBody |
getBodyA()
Access the rigid body at the A end.
|
PhysicsRigidBody |
getBodyB()
Access the rigid body at the B end.
|
float |
getBreakingImpulseThreshold()
Determine the breaking impulse threshold.
|
protected static int |
getConstraintType(long constraintId)
Read the constraint type.
|
int |
getOverrideIterations()
Determine the number of iterations used to solve this Constraint.
|
Vector3f |
getPivot(JointEnd end,
Vector3f storeResult)
Copy the location of the specified connection point in the specified
body.
|
Vector3f |
getPivotA(Vector3f storeResult)
Copy the location of the connection point in the body at the A end.
|
Vector3f |
getPivotB(Vector3f storeResult)
Copy the location of the connection point in the body at the B end.
|
boolean |
isCollisionBetweenLinkedBodies()
Test whether collisions are handled between the ends.
|
boolean |
isEnabled()
Test whether this Constraint is enabled.
|
boolean |
isFeedback()
Test whether this Constraint has feedback enabled.
|
void |
overrideIterations(int numIterations)
Override the number of iterations used to solve this Constraint.
|
void |
setBreakingImpulseThreshold(float desiredThreshold)
Alter the breaking impulse threshold.
|
void |
setCollisionBetweenLinkedBodies(boolean allow)
Handle/ignore collisions between the ends of a double-ended joint.
|
void |
setEnabled(boolean enable)
Enable or disable this Constraint.
|
void |
setFeedback(boolean enable)
Enable or disable feedback for this Constraint.
|
protected void |
setPivotInA(Vector3f location)
Alter the pivot location in A's scaled local coordinates.
|
protected void |
setPivotInB(Vector3f location)
Alter the pivot location in B's scaled local coordinates.
|
countEnds, 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 logger15
protected Vector3f pivotA
protected Vector3f pivotB
protected Constraint(PhysicsRigidBody body, JointEnd bodyEnd, Vector3f pivotInBody)
To be effective, the Constraint must be added to the body's PhysicsSpace and the body must be dynamic.
body - the body to constrain (not null, alias created)bodyEnd - at which end to attach the body (not null)pivotInBody - the pivot location in the body's scaled local
coordinates (not null, unaffected)protected Constraint(PhysicsRigidBody body, JointEnd bodyEnd, Vector3f pivotInBody, Vector3f pivotInWorld)
To be effective, the Constraint must be added to the body's PhysicsSpace and the body must be dynamic.
body - the body to constrain (not null, alias created)bodyEnd - at which end to attach the body (not null)pivotInBody - the pivot location in the body's scaled local
coordinates (not null, unaffected)pivotInWorld - the pivot location in physics-space coordinates (not
null, unaffected)protected Constraint(PhysicsBody bodyA, PhysicsBody bodyB, Vector3f pivotInA, Vector3f pivotInB)
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.
bodyA - the body for the A end (not null, alias created)bodyB - 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)public float getAppliedImpulse()
java.lang.IllegalStateException - if feedback is not enabledpublic float getBreakingImpulseThreshold()
public int getOverrideIterations()
public Vector3f getPivot(JointEnd end, Vector3f storeResult)
end - which end of the Constraint to access (not null)storeResult - storage for the result (modified if not null)public Vector3f getPivotA(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public Vector3f getPivotB(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public boolean isCollisionBetweenLinkedBodies()
public boolean isFeedback()
public void overrideIterations(int numIterations)
numIterations - the desired number of iterations (≥0) or -1 to
use the solver's default (default=-1)public void setBreakingImpulseThreshold(float desiredThreshold)
desiredThreshold - the desired value (default=MAX_VALUE with SP
library or +Infinity with DP library)public void setCollisionBetweenLinkedBodies(boolean allow)
allow - true to handle collisions, false to ignore them
(default=true)public void setEnabled(boolean enable)
enable - true to enable, false to disable (default=true)public void setFeedback(boolean enable)
enable - true to enable, false to disable (default=false)protected static final int getConstraintType(long constraintId)
constraintId - identifier of the btTypedConstraint (not
zero)protected void setPivotInA(Vector3f location)
location - the desired location (not null, unaffected)protected void setPivotInB(Vector3f location)
location - the desired location (not null, unaffected)public PhysicsRigidBody getBodyA()
getBodyA in class PhysicsJointpublic PhysicsRigidBody getBodyB()
getBodyB in class PhysicsJointpublic boolean isEnabled()
isEnabled in class PhysicsJoint