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.Access the settings of the twist motor.void
setMaxFrictionTorque
(float torque) Alter the maximum friction torque when not driven by a motor.void
setNormalHalfConeAngle
(float angle) Alter the normal half-cone angle.void
setPlaneHalfConeAngle
(float angle) Alter the half-angle of the plane cone.void
setSwingMotorState
(EMotorState motorState) Alter the state of the swing motor.void
Alter the target angular velocity of body 2 in the constraint space of body 2.void
setTargetOrientationCs
(QuatArg orientation) Alter the target orientation in constraint space.void
setTwistMaxAngle
(float angle) Alter the maximum twist angle.void
setTwistMinAngle
(float angle) Alter the minimum twist angle.void
setTwistMotorState
(EMotorState motorState) Alter the state of the twist motor.Methods inherited from class com.github.stephengold.joltjni.TwoBodyConstraint
getBody1, getBody2, getConstraintToBody1Matrix, getConstraintToBody2Matrix, toRef
Methods inherited from class com.github.stephengold.joltjni.Constraint
getConstraintPriority, getConstraintSettings, getEnabled, getNumPositionStepsOverride, getNumVelocityStepsOverride, getRefCount, getSubType, getType, notifyShapeChanged, setConstraintPriority, setEmbedded, setEnabled, setNumPositionStepsOverride, setNumVelocityStepsOverride
Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstConstraint
getConstraintPriority, getConstraintSettings, getEnabled, getNumPositionStepsOverride, getNumVelocityStepsOverride, getSubType, getType
Methods 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
-
getTwistMotorSettings
Access the settings of the twist motor.- Returns:
- a new JVM object with the pre-existing native object assigned
-
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 (not null)
-
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 (not null)
-
setTargetAngularVelocityCs
Alter the target angular velocity of body 2 in the constraint space of body 2. (native method: SetTargetAngularVelocityCS)- Parameters:
omega
- the desired angular velocity (in radians per second, not null, unaffected)
-
setTargetOrientationCs
Alter the target orientation in constraint space. (native method: SetTargetOrientationCS)- Parameters:
orientation
- the desired orientation (not null, unaffected)
-