java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.Constraint
com.github.stephengold.joltjni.TwoBodyConstraint
com.github.stephengold.joltjni.HingeConstraint
- All Implemented Interfaces:
 ConstConstraint,ConstJoltPhysicsObject,ConstTwoBodyConstraint,RefTarget,AutoCloseable,Comparable<JoltPhysicsObject>
A 
TwoBodyConstraint that allows rotation only along one axis and
 disables translation, eliminating 5 degrees of freedom.- 
Method Summary
Modifier and TypeMethodDescriptionfloatReturn the current angle from rest orientation.floatReturn the upper limit of rotation.floatReturn the lower limit of rotation.Access the spring settings.floatReturn the maximum friction torque when not driven by a motor.Access the motor settings.Return the state of the motor.floatReturn the target angle of the motor.floatReturn the target angular velocity of the motor.booleanTest whether the constraint has limits.voidsetLimits(float min, float max) Alter the limits.voidsetMaxFrictionTorque(float torque) Alter the maximum friction torque when not driven by a motor.voidsetMotorState(EMotorState state) Alter the state of the motor.voidsetTargetAngle(float angle) Alter the target angle of the motor.voidsetTargetAngularVelocity(float omega) Alter the target angular velocity of the motor.Methods inherited from class com.github.stephengold.joltjni.TwoBodyConstraint
getBody1, getBody1PivotLocation, getBody2, getBody2PivotLocation, getConstraintToBody1Matrix, getConstraintToBody2Matrix, toRefMethods inherited from class com.github.stephengold.joltjni.Constraint
getConstraintPriority, getConstraintSettings, getEnabled, getNumPositionStepsOverride, getNumVelocityStepsOverride, getRefCount, getSubType, getType, isActive, notifyShapeChanged, restoreState, saveState, setConstraintPriority, setEmbedded, setEnabled, setNumPositionStepsOverride, setNumVelocityStepsOverride, setVirtualAddressAsCoOwnerMethods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, vaMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstConstraint
getConstraintPriority, getConstraintSettings, getEnabled, getNumPositionStepsOverride, getNumVelocityStepsOverride, getSubType, getType, isActive, saveStateMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa 
- 
Method Details
- 
getCurrentAngle
public float getCurrentAngle()Return the current angle from rest orientation. The constraint is unaffected.- Returns:
 - the angle (in radians)
 
 - 
getLimitsMax
public float getLimitsMax()Return the upper limit of rotation. The constraint is unaffected.- Returns:
 - the upper limit (in radians)
 
 - 
getLimitsMin
public float getLimitsMin()Return the lower limit of rotation. The constraint is unaffected.- Returns:
 - the lower limit (in radians)
 
 - 
getLimitsSpringSettings
Access the spring settings.- Returns:
 - a new JVM object with the pre-existing native object assigned
 
 - 
getMaxFrictionTorque
public float getMaxFrictionTorque()Return the maximum friction torque when not driven by a motor. The constraint is unaffected.- Returns:
 - the torque (in Newton.meters)
 
 - 
getMotorSettings
Access the motor settings.- Returns:
 - a new JVM object with the pre-existing native object assigned
 
 - 
getMotorState
Return the state of the motor. The constraint is unaffected.- Returns:
 - an enum value (not null)
 
 - 
getTargetAngle
public float getTargetAngle()Return the target angle of the motor. The constraint is unaffected.- Returns:
 - the angle (in radians)
 
 - 
getTargetAngularVelocity
public float getTargetAngularVelocity()Return the target angular velocity of the motor. The constraint is unaffected.- Returns:
 - the angular velocity (in radians per second)
 
 - 
hasLimits
public boolean hasLimits()Test whether the constraint has limits. The constraint is unaffected.- Returns:
 trueif limited, otherwisefalse
 - 
setLimits
public void setLimits(float min, float max) Alter the limits.- Parameters:
 min- the desired lower limit (in radians)max- the desired upper limit (in radians)
 - 
setMaxFrictionTorque
public void setMaxFrictionTorque(float torque) Alter the maximum friction torque when not driven by a motor.- Parameters:
 torque- the desired torque (in Newton.meters)
 - 
setMotorState
Alter the state of the motor.- Parameters:
 state- the desired state (not null)
 - 
setTargetAngle
public void setTargetAngle(float angle) Alter the target angle of the motor.- Parameters:
 angle- the desired angle (in radians)
 - 
setTargetAngularVelocity
public void setTargetAngularVelocity(float omega) Alter the target angular velocity of the motor.- Parameters:
 omega- the desired angular velocity (in radians per second)
 
 -