Package com.github.stephengold.joltjni
Class SliderConstraintSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.SerializableObject
com.github.stephengold.joltjni.ConstraintSettings
com.github.stephengold.joltjni.TwoBodyConstraintSettings
com.github.stephengold.joltjni.SliderConstraintSettings
- All Implemented Interfaces:
ConstConstraintSettings,ConstJoltPhysicsObject,ConstSerializableObject,RefTarget,AutoCloseable,Comparable<JoltPhysicsObject>
Settings used to construct a
SliderConstraint.-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate default settings.Instantiate a copy of the specified settings. -
Method Summary
Modifier and TypeMethodDescriptionbooleanTest whether to configure the attachment points based on the positions of the bodies when the constraint is created.floatReturn the upper limit of translation.floatReturn the lower limit of translation.Access the spring settings.floatReturn the maximum friction force when not driven by a motor.Access the motor settings.Copy the normal axis of body 1.Copy the normal axis of body 2.Copy the constraint location for body 1.Copy the constraint location for body 2.Copy the slider axis of body 1.Copy the slider axis of body 2.getSpace()Return which space the other properties are specified in.voidsetAutoDetectPoint(boolean setting) Alter whether to configure the attachment points based on the positions of the bodies when the constraint is created.voidsetLimitsMax(float limit) Alter the upper limit of translation.voidsetLimitsMin(float limit) Alter the lower limit of translation.voidsetMaxFrictionForce(float force) Alter the maximum friction force when not driven by a motor.setNormalAxis1(Vec3Arg direction) Alter the normal axis of body 1.setNormalAxis2(Vec3Arg direction) Alter the normal axis of body 2.Alter the constraint location for body 1.Alter the constraint location for body 2.voidsetSliderAxis(Vec3Arg sliderAxis) Alter the slider and normal axes, assuming the bodies are correctly oriented.setSliderAxis1(Vec3Arg direction) Alter the slider axis of body 1.setSliderAxis2(Vec3Arg direction) Alter the slider axis of body 2.voidsetSpace(EConstraintSpace space) Alter which space the other properties are specified in.Methods inherited from class com.github.stephengold.joltjni.TwoBodyConstraintSettings
create, toRefMethods inherited from class com.github.stephengold.joltjni.ConstraintSettings
getConstraintPriority, getControllerType, getDrawConstraintSize, getEnabled, getNumPositionStepsOverride, getNumVelocityStepsOverride, getRefCount, saveBinaryState, setConstraintPriority, setDrawConstraintSize, setEmbedded, setEnabled, setNumPositionStepsOverride, setNumVelocityStepsOverride, setVirtualAddressAsCoOwner, sRestoreFromBinaryStateMethods inherited from class com.github.stephengold.joltjni.SerializableObject
getRttiMethods 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.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVaMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstSerializableObject
getRtti
-
Constructor Details
-
SliderConstraintSettings
public SliderConstraintSettings()Instantiate default settings. -
SliderConstraintSettings
Instantiate a copy of the specified settings.- Parameters:
original- the settings to copy (notnull, unaffected)
-
-
Method Details
-
getAutoDetectPoint
public boolean getAutoDetectPoint()Test whether to configure the attachment points based on the positions of the bodies when the constraint is created. The settings are unaffected. (native attribute: mAutoDetectPoint)- Returns:
trueto use body positions,falsefor explicit configuration
-
getLimitsMax
public float getLimitsMax()Return the upper limit of translation. The settings are unaffected. (native attribute: mLimitsMax)- Returns:
- the upper limit
-
getLimitsMin
public float getLimitsMin()Return the lower limit of translation. The settings are unaffected. (native attribute: mLimitsMin)- Returns:
- the lower limit
-
getLimitsSpringSettings
Access the spring settings. (native attribute: mLimitsSpringSettings)- Returns:
- a new JVM object with the pre-existing native object assigned
-
getMaxFrictionForce
public float getMaxFrictionForce()Return the maximum friction force when not driven by a motor. The settings are unaffected. (native attribute: mMaxFrictionForce)- Returns:
- the force (in Newtons)
-
getMotorSettings
Access the motor settings. (native attribute: mMotorSettings)- Returns:
- a new JVM object with the pre-existing native object assigned
-
getNormalAxis1
Copy the normal axis of body 1. The settings are unaffected. (native attribute: mNormalAxis1)- Returns:
- a new direction vector
-
getNormalAxis2
Copy the normal axis of body 2. The settings are unaffected. (native attribute: mNormalAxis2)- Returns:
- a new direction vector
-
getPoint1
Copy the constraint location for body 1. The settings are unaffected. (native attribute: mPoint1)- Returns:
- a new location vector
-
getPoint2
Copy the constraint location for body 2. The settings are unaffected. (native attribute: mPoint2)- Returns:
- a new location vector
-
getSliderAxis1
Copy the slider axis of body 1. The settings are unaffected. (native attribute: mSliderAxis1)- Returns:
- a new direction vector
-
getSliderAxis2
Copy the slider axis of body 2. The settings are unaffected. (native attribute: mSliderAxis2)- Returns:
- a new direction vector
-
getSpace
Return which space the other properties are specified in. The settings are unaffected. (native attribute: mSpace)- Returns:
- an enum value (not null)
-
setAutoDetectPoint
public void setAutoDetectPoint(boolean setting) Alter whether to configure the attachment points based on the positions of the bodies when the constraint is created. (native attribute: mAutoDetectPoint)- Parameters:
setting-trueto use body positions,falsefor explicit configuration (default=false)
-
setLimitsMax
public void setLimitsMax(float limit) Alter the upper limit of translation. (native attribute: mLimitsMax)- Parameters:
limit- the desired upper limit (default=MAX_VALUE)
-
setLimitsMin
public void setLimitsMin(float limit) Alter the lower limit of translation. (native attribute: mLimitsMin)- Parameters:
limit- the desired lower limit (default=-MAX_VALUE)
-
setMaxFrictionForce
public void setMaxFrictionForce(float force) Alter the maximum friction force when not driven by a motor. (native attribute: mMaxFrictionForce)- Parameters:
force- the desired force (in Newtons, default=0)
-
setNormalAxis1
Alter the normal axis of body 1. (native attribute: mNormalAxis1)- Parameters:
direction- the desired axis direction (not null, unaffected, default=(0,1,0))- Returns:
- the argument, for chaining
-
setNormalAxis2
Alter the normal axis of body 2. (native attribute: mNormalAxis2)- Parameters:
direction- the desired axis direction (not null, unaffected, default=(0,1,0))- Returns:
- the argument, for chaining
-
setPoint1
Alter the constraint location for body 1. (native attribute: mPoint1)- Parameters:
location- the desired location (not null, unaffected, default=(0,0,0))- Returns:
- the argument, for chaining
-
setPoint2
Alter the constraint location for body 2. (native attribute: mPoint2)- Parameters:
location- the desired location (not null, unaffected, default=(0,0,0))- Returns:
- the argument, for chaining
-
setSliderAxis
Alter the slider and normal axes, assuming the bodies are correctly oriented.- Parameters:
sliderAxis- the desired slider axis direction (in system coordinates, not null, unaffected)
-
setSliderAxis1
Alter the slider axis of body 1. (native attribute: mSliderAxis1)- Parameters:
direction- the desired axis direction (not null, unaffected, default=(1,0,0))- Returns:
- the argument, for chaining
-
setSliderAxis2
Alter the slider axis of body 2. (native attribute: mSliderAxis2)- Parameters:
direction- the desired axis direction (not null, unaffected, default=(1,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)
-