Package com.github.stephengold.joltjni
Class ConstraintSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.SerializableObject
com.github.stephengold.joltjni.ConstraintSettings
- All Implemented Interfaces:
ConstConstraintSettings,ConstJoltPhysicsObject,RefTarget,AutoCloseable,Comparable<ConstJoltPhysicsObject>
- Direct Known Subclasses:
TwoBodyConstraintSettings,VehicleConstraintSettings
public abstract class ConstraintSettings
extends SerializableObject
implements ConstConstraintSettings, RefTarget
Settings used to construct a
Constraint.-
Method Summary
Modifier and TypeMethodDescriptionintReturn the constraint's priority when solving.booleanTest whether the constraint will be enabled initially.intReturn the override for the number of position iterations used in the solver.intReturn the override for the number of velocity iterations used in the solver.intCount the active references to the nativeConstraintSettings.voidsetConstraintPriority(int level) Alter the constraint's priority when solving.voidMark the nativeConstraintSettingsas embedded.voidsetEnabled(boolean setting) Initially enable or disable the constraint.voidsetNumPositionStepsOverride(int setting) Alter the override for the number of position iterations used in the solver.voidsetNumVelocityStepsOverride(int setting) Alter the override for the number of velocity iterations used in the solver.toRef()Create a counted reference to the nativeConstraintSettings.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, startCleaner, 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, va
-
Method Details
-
setConstraintPriority
public void setConstraintPriority(int level) Alter the constraint's priority when solving. (native attribute: mConstraintPriority)- Parameters:
level- the desired priority level (default=0)
-
setEnabled
public void setEnabled(boolean setting) Initially enable or disable the constraint. (native attribute: mEnabled)- Parameters:
setting- true to enable or false to disable (default=true)
-
setNumPositionStepsOverride
public void setNumPositionStepsOverride(int setting) Alter the override for the number of position iterations used in the solver. (native attribute: mNumPositionStepsOverride)- Parameters:
setting- the number of iterations, or 0 to use the default inPhysicsSettings(default=0)
-
setNumVelocityStepsOverride
public void setNumVelocityStepsOverride(int setting) Alter the override for the number of velocity iterations used in the solver. (native attribute: mNumVelocityStepsOverride)- Parameters:
setting- the number of iterations, or 0 to use the default inPhysicsSettings(default=0)
-
getConstraintPriority
public int getConstraintPriority()Return the constraint's priority when solving. The settings are unaffected. (native attribute: mConstraintPriority)- Specified by:
getConstraintPriorityin interfaceConstConstraintSettings- Returns:
- the priority level
-
getEnabled
public boolean getEnabled()Test whether the constraint will be enabled initially. The settings are unaffected. (native attribute: mEnabled)- Specified by:
getEnabledin interfaceConstConstraintSettings- Returns:
- true if enabled, otherwise false
-
getNumPositionStepsOverride
public int getNumPositionStepsOverride()Return the override for the number of position iterations used in the solver. The settings are unaffected. (native attribute: mNumPositionStepsOverride)- Specified by:
getNumPositionStepsOverridein interfaceConstConstraintSettings- Returns:
- the number of iterations, or 0 to use the default in
PhysicsSettings
-
getNumVelocityStepsOverride
public int getNumVelocityStepsOverride()Return the override for the number of velocity iterations used in the solver. The settings are unaffected. (native attribute: mNumVelocityStepsOverride)- Specified by:
getNumVelocityStepsOverridein interfaceConstConstraintSettings- Returns:
- the number of iterations, or 0 to use the default in
PhysicsSettings
-
getRefCount
public int getRefCount()Count the active references to the nativeConstraintSettings. The settings are unaffected.- Specified by:
getRefCountin interfaceRefTarget- Returns:
- the count (≥0)
-
setEmbedded
public void setEmbedded()Mark the nativeConstraintSettingsas embedded.- Specified by:
setEmbeddedin interfaceRefTarget
-
toRef
Create a counted reference to the nativeConstraintSettings.
-