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<JoltPhysicsObject>
- Direct Known Subclasses:
TwoBodyConstraintSettings
,VehicleConstraintSettings
public abstract class ConstraintSettings
extends SerializableObject
implements ConstConstraintSettings, RefTarget
Settings used to construct a
Constraint
.-
Method Summary
Modifier and TypeMethodDescriptionint
Return the constraint's priority when solving.int
Return the constraint's controller type.float
Return the size of the constraint in debug renders.boolean
Test whether the constraint will be enabled initially.int
Return the override for the number of position iterations used in the solver.int
Return the override for the number of velocity iterations used in the solver.int
Count the active references to the nativeConstraintSettings
.void
setConstraintPriority
(int level) Alter the constraint's priority when solving.void
setDrawConstraintSize
(float size) Alter the size of constraint in debug renders.void
Mark the nativeConstraintSettings
as embedded.void
setEnabled
(boolean setting) Initially enable or disable the constraint.void
setNumPositionStepsOverride
(int setting) Alter the override for the number of position iterations used in the solver.void
setNumVelocityStepsOverride
(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, 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
-
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)
-
setDrawConstraintSize
public void setDrawConstraintSize(float size) Alter the size of constraint in debug renders. (native attribute: mDrawConstraintSize)- Parameters:
size
- the desired size (default=1)
-
setEnabled
public void setEnabled(boolean setting) Initially enable or disable the constraint. (native attribute: mEnabled)- Parameters:
setting
-true
to enable orfalse
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:
getConstraintPriority
in interfaceConstConstraintSettings
- Returns:
- the priority level
-
getControllerType
public int getControllerType()Return the constraint's controller type. The settings are unaffected.- Specified by:
getControllerType
in interfaceConstConstraintSettings
- Returns:
- a numeric code, such as
VehicleController.motorcycleType
-
getDrawConstraintSize
public float getDrawConstraintSize()Return the size of the constraint in debug renders. The settings are unaffected. (native attribute: mDrawConstraintSize)- Specified by:
getDrawConstraintSize
in interfaceConstConstraintSettings
- Returns:
- the size
-
getEnabled
public boolean getEnabled()Test whether the constraint will be enabled initially. The settings are unaffected. (native attribute: mEnabled)- Specified by:
getEnabled
in interfaceConstConstraintSettings
- Returns:
true
if enabled, otherwisefalse
-
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:
getNumPositionStepsOverride
in 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:
getNumVelocityStepsOverride
in interfaceConstConstraintSettings
- Returns:
- the number of iterations, or 0 to use the default configured in
PhysicsSettings
-
getRefCount
public int getRefCount()Count the active references to the nativeConstraintSettings
. The settings are unaffected.- Specified by:
getRefCount
in interfaceRefTarget
- Returns:
- the count (≥0)
-
setEmbedded
public void setEmbedded()Mark the nativeConstraintSettings
as embedded.- Specified by:
setEmbedded
in interfaceRefTarget
-
toRef
Create a counted reference to the nativeConstraintSettings
.
-