public class NewHinge extends New6Dof
Rotation is enabled only for the Z and X axes, with limits on Z-axis rotation. The X axis rotates freely. Translation is enabled only for the Z axis, with a suspension spring.
Inspired by Bullet's btHinge2Constraint.
| Modifier and Type | Field and Description |
|---|---|
static java.util.logging.Logger |
logger3
message logger for this class
|
logger15, pivotA, pivotBloggerloggerN| Constructor and Description |
|---|
NewHinge(PhysicsRigidBody rigidBodyA,
PhysicsRigidBody rigidBodyB,
Vector3f anchor,
Vector3f axis1,
Vector3f axis2)
Instantiate a double-ended constraint.
|
| Modifier and Type | Method and Description |
|---|---|
Vector3f |
getAnchor(Vector3f storeResult)
Determine the anchor location for body A.
|
Vector3f |
getAnchor2(Vector3f storeResult)
Determine the anchor location for body B.
|
float |
getAngle1()
Determine the rotation angle for axis1.
|
float |
getAngle2()
Determine the rotation angle for axis2.
|
Vector3f |
getAxis1(Vector3f storeResult)
Determine the direction of axis1.
|
Vector3f |
getAxis2(Vector3f storeResult)
Determine the direction of axis2.
|
void |
setLowerLimit(float angle1Min)
Alter the lower limit for axis1 rotation.
|
void |
setUpperLimit(float angle1Max)
Alter the upper limit for axis1 rotation.
|
calculatedBasisA, calculatedBasisB, calculatedOriginA, calculatedOriginB, checkRotationOrder, enableSpring, get, getAngles, getAxis, getFrameTransform, getPivotOffset, getRotationMatrix, getRotationMotor, getRotationOrder, getTranslationMotor, isMotorEnabled, isServoEnabled, isSpringEnabled, newInstance, set, setDamping, setEquilibriumPoint, setEquilibriumPoint, setEquilibriumPoint, setPivotInA, setPivotInB, setRotationOrder, setStiffnessgetAppliedImpulse, 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 logger3
public NewHinge(PhysicsRigidBody rigidBodyA, PhysicsRigidBody rigidBodyB, Vector3f anchor, Vector3f axis1, Vector3f axis2)
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)anchor - initial anchor location for the constraint frame (in
physics-space coordinates, not null, unaffected)axis1 - initial Z-axis direction for the constraint frame (in
physics-space coordinates, not null, not zero, unaffected)axis2 - initial X-axis direction for the constraint frame (in
physics-space coordinates, not null, not zero, unaffected)public Vector3f getAnchor(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public Vector3f getAnchor2(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public float getAngle1()
public float getAngle2()
public Vector3f getAxis1(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public Vector3f getAxis2(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public final void setLowerLimit(float angle1Min)
angle1Min - the desired angle (in radians)public final void setUpperLimit(float angle1Max)
angle1Max - the desired angle (in radians)