Package com.github.stephengold.joltjni
Class SwingTwistConstraint
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.SwingTwistConstraint
- All Implemented Interfaces:
ConstConstraint,ConstJoltPhysicsObject,ConstTwoBodyConstraint,RefTarget,AutoCloseable,Comparable<JoltPhysicsObject>
A
TwoBodyConstraint that only allows limited rotation.-
Method Summary
Modifier and TypeMethodDescriptionAccess the settings of the swing motor.Return the state of the swing motor.Copy the target angular velocity of body2.Copy the target orientation.Access the settings of the twist motor.Return the state of the twist motor.voidsetMaxFrictionTorque(float torque) Alter the maximum friction torque when not driven by a motor.voidsetNormalHalfConeAngle(float angle) Alter the normal half-cone angle.voidsetPlaneHalfConeAngle(float angle) Alter the half-angle of the plane cone.voidsetSwingMotorState(EMotorState motorState) Alter the state of the swing motor.voidAlter the target angular velocity of body 2 in the constraint space of body 2.voidsetTargetOrientationCs(QuatArg orientation) Alter the target orientation in constraint space.voidsetTwistMaxAngle(float angle) Alter the maximum twist angle.voidsetTwistMinAngle(float angle) Alter the minimum twist angle.voidsetTwistMotorState(EMotorState motorState) Alter the state of the twist 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
-
getSwingMotorSettings
Access the settings of the swing motor.- Returns:
- a new JVM object with the pre-existing native object assigned
-
getSwingMotorState
Return the state of the swing motor. The constraint is unaffected.- Returns:
- the enum value (not
null)
-
getTargetAngularVelocityCs
Copy the target angular velocity of body2. The constraint is unaffected. (native function: GetTargetAngularVelocityCS)- Returns:
- a new vector
-
getTargetOrientationCs
Copy the target orientation. The constraint is unaffected. (native function: GetTargetOrientationCS)- Returns:
- a new quaternion
-
getTwistMotorSettings
Access the settings of the twist motor.- Returns:
- a new JVM object with the pre-existing native object assigned
-
getTwistMotorState
Return the state of the twist motor. The constraint is unaffected.- Returns:
- the enum value (not
null)
-
setMaxFrictionTorque
public void setMaxFrictionTorque(float torque) Alter the maximum friction torque when not driven by a motor.- Parameters:
torque- the desired limit (in Newton.meters)
-
setNormalHalfConeAngle
public void setNormalHalfConeAngle(float angle) Alter the normal half-cone angle.- Parameters:
angle- the desired angle (in radians)
-
setPlaneHalfConeAngle
public void setPlaneHalfConeAngle(float angle) Alter the half-angle of the plane cone.- Parameters:
angle- the desired limit (in radians)
-
setSwingMotorState
Alter the state of the swing motor.- Parameters:
motorState- an enum value (notnull)
-
setTwistMaxAngle
public void setTwistMaxAngle(float angle) Alter the maximum twist angle.- Parameters:
angle- the desired limit (in radians, ≥-Pi, ≤Pi)
-
setTwistMinAngle
public void setTwistMinAngle(float angle) Alter the minimum twist angle.- Parameters:
angle- the desired limit (in radians ≥-Pi, ≤Pi)
-
setTwistMotorState
Alter the state of the twist motor.- Parameters:
motorState- an enum value (notnull)
-
setTargetAngularVelocityCs
Alter the target angular velocity of body 2 in the constraint space of body 2. (native function: SetTargetAngularVelocityCS)- Parameters:
omega- the desired angular velocity (in radians per second, notnull, unaffected)
-
setTargetOrientationCs
Alter the target orientation in constraint space. (native function: SetTargetOrientationCS)- Parameters:
orientation- the desired orientation (notnull, unaffected)
-