Package com.github.stephengold.joltjni
Class SwingTwistConstraintSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.SerializableObject
com.github.stephengold.joltjni.ConstraintSettings
com.github.stephengold.joltjni.TwoBodyConstraintSettings
com.github.stephengold.joltjni.SwingTwistConstraintSettings
- All Implemented Interfaces:
ConstConstraintSettings
,ConstJoltPhysicsObject
,RefTarget
,AutoCloseable
,Comparable<JoltPhysicsObject>
Settings used to construct a
SwingTwistConstraint
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat
Return the maximum friction torque when not driven by a motor.float
Return the half angle of the normal cone.Copy the plane axis of body 1.Copy the plane axis of body 2.float
Return one-half the maximum angle between the twist axes of body 1 and body 2.Copy the initial location of body 1.Copy the initial location of body 2.getSpace()
Return which space the other properties are specified in.Access the swing motor settings.Return type of swing constraint.Copy the twist axis of body 1.Copy the twist axis of body 2.float
Return the maximum twist angle.float
Return the minimum twist angle.Access the twist motor settings.void
setMaxFrictionTorque
(float torque) Alter the maximum friction torque when not driven by a motor.void
setNormalHalfConeAngle
(float angle) Alter the half angle of the normal cone.setPlaneAxis1
(Vec3Arg axisDirection) Alter the plane axis of body 1.setPlaneAxis2
(Vec3Arg axisDirection) Alter the plane axis of body 2.void
setPlaneHalfConeAngle
(float angle) Alter the half-angle of the plane cone.setPosition1
(RVec3Arg location) Alter the initial location of the body 1.setPosition2
(RVec3Arg location) Alter the initial location of body 2.void
setSpace
(EConstraintSpace space) Alter which space the other properties are specified in.setSwingMotorSettings
(MotorSettings motorSettings) Alter the settings for the swing motor.void
setSwingType
(ESwingType swingType) Alter the type of swing constraint.setTwistAxis1
(Vec3Arg axisDirection) Alter the twist axis of the body 1.setTwistAxis2
(Vec3Arg axisDirection) Alter the twist axis of body 2.void
setTwistMaxAngle
(float angle) Alter the maximum twist angle.void
setTwistMinAngle
(float angle) Alter the minimum twist angle.setTwistMotorSettings
(MotorSettings motorSettings) Alter the settings for the twist motor.Methods inherited from class com.github.stephengold.joltjni.TwoBodyConstraintSettings
create, toRef
Methods inherited from class com.github.stephengold.joltjni.ConstraintSettings
getConstraintPriority, getControllerType, getDrawConstraintSize, getEnabled, getNumPositionStepsOverride, getNumVelocityStepsOverride, getRefCount, setConstraintPriority, setDrawConstraintSize, 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.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Constructor Details
-
SwingTwistConstraintSettings
public SwingTwistConstraintSettings()Instantiate default settings.
-
-
Method Details
-
getMaxFrictionTorque
public float getMaxFrictionTorque()Return the maximum friction torque when not driven by a motor. The settings are unaffected. (native attribute: mMaxFrictionTorque)- Returns:
- the torque (in Newton.meters)
-
getNormalHalfConeAngle
public float getNormalHalfConeAngle()Return the half angle of the normal cone. The settings are unaffected. (native attribute: mNormalHalfConeAngle)- Returns:
- the half angle (in radians)
-
getPlaneAxis1
Copy the plane axis of body 1. The settings are unaffected. (native attribute: mPlaneAxis1)- Returns:
- a new direction vector
-
getPlaneAxis2
Copy the plane axis of body 2. The settings are unaffected. (native attribute: mPlaneAxis2)- Returns:
- a new direction vector
-
getPlaneHalfConeAngle
public float getPlaneHalfConeAngle()Return one-half the maximum angle between the twist axes of body 1 and body 2. The settings are unaffected. (native attribute: mPlaneHalfConeAngle)- Returns:
- the half angle (in radians)
-
getPosition1
Copy the initial location of body 1. The settings are unaffected. (native attribute: mPosition1)- Returns:
- a new location vector
-
getPosition2
Copy the initial location of body 2. The settings are unaffected. (native attribute: mPosition2)- Returns:
- a new location vector
-
getSpace
Return which space the other properties are specified in. The settings are unaffected. (native attribute: mSpace)- Returns:
- an enum value (not null)
-
getSwingMotorSettings
Access the swing motor settings. (native attribute: mSwingMotorSettings)- Returns:
- a new JVM object with the pre-existing native object assigned
-
getSwingType
Return type of swing constraint. The settings are unaffected. (native attribute: mSwingType)- Returns:
- the enum value (not null)
-
getTwistAxis1
Copy the twist axis of body 1. The settings are unaffected. (native attribute: mTwistAxis1)- Returns:
- a new direction vector
-
getTwistAxis2
Copy the twist axis of body 2. The settings are unaffected. (native attribute: mTwistAxis2)- Returns:
- a new direction vector
-
getTwistMaxAngle
public float getTwistMaxAngle()Return the maximum twist angle. The settings are unaffected. (native attribute: mTwistMaxAngle)- Returns:
- the angle (in radians)
-
getTwistMinAngle
public float getTwistMinAngle()Return the minimum twist angle. The settings are unaffected. (native attribute: mTwistMinAngle)- Returns:
- the angle (in radians)
-
getTwistMotorSettings
Access the twist motor settings. (native attribute: mTwistMotorSettings)- 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. (native attribute: mMaxFrictionTorque)- Parameters:
torque
- the desired limit (in Newton.meters, default=0)
-
setNormalHalfConeAngle
public void setNormalHalfConeAngle(float angle) Alter the half angle of the normal cone. (native attribute: mNormalHalfConeAngle)- Parameters:
angle
- the desired half angle (in radians, default=0)
-
setPlaneAxis1
Alter the plane axis of body 1. (native attribute: mPlaneAxis1)- Parameters:
axisDirection
- the desired direction (not null, unaffected, default=(0,1,0))- Returns:
- the argument, for chaining
-
setPlaneAxis2
Alter the plane axis of body 2. (native attribute: mPlaneAxis2)- Parameters:
axisDirection
- the desired direction (not null, unaffected, default=(0,1,0))- Returns:
- the argument, for chaining
-
setPlaneHalfConeAngle
public void setPlaneHalfConeAngle(float angle) Alter the half-angle of the plane cone. (native attribute: mPlaneHalfConeAngle)- Parameters:
angle
- the desired limit (in radians, default=0)
-
setPosition1
Alter the initial location of the body 1. (native attribute: mPosition1)- Parameters:
location
- the desired location (not null, unaffected, default=(0,0,0))- Returns:
- the argument, for chaining
-
setPosition2
Alter the initial location of body 2. (native attribute: mPosition2)- Parameters:
location
- the desired location (not null, unaffected, default=(0,0,0))- Returns:
- the argument, for chaining
-
setSpace
Alter which space the other properties are specified in. (native attribute: mSpace)- Parameters:
space
- enum value (not null, default=WorldSpace)
-
setSwingMotorSettings
Alter the settings for the swing motor. (native attribute: mSwingMotorSettings)- Parameters:
motorSettings
- the desired settings (not null, unaffected)- Returns:
- the argument, for chaining
-
setSwingType
Alter the type of swing constraint. (native attribute: mSwingType)- Parameters:
swingType
- the desired enum value (not null, default=Cone)
-
setTwistAxis1
Alter the twist axis of the body 1. (native attribute: mTwistAxis1)- Parameters:
axisDirection
- the desired direction (not null, unaffected, default=(1,0,0))- Returns:
- the argument, for chaining
-
setTwistAxis2
Alter the twist axis of body 2. (native attribute: mTwistAxis2)- Parameters:
axisDirection
- the desired direction (not null, unaffected, default=(1,0,0))- Returns:
- the argument, for chaining
-
setTwistMaxAngle
public void setTwistMaxAngle(float angle) Alter the maximum twist angle. (native attribute: mTwistMaxAngle)- Parameters:
angle
- the desired limit (in radians, ≥-Pi, ≤Pi, default=0)
-
setTwistMinAngle
public void setTwistMinAngle(float angle) Alter the minimum twist angle. (native attribute: mTwistMinAngle)- Parameters:
angle
- the desired limit (in radians, ≥-Pi, ≤Pi, default=0)
-
setTwistMotorSettings
Alter the settings for the twist motor. (native attribute: mTwistMotorSetting)- Parameters:
motorSettings
- the desired settings (not null, unaffected)- Returns:
- the argument, for chaining
-