java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.template.Ref
com.github.stephengold.joltjni.ConstraintRef
- All Implemented Interfaces:
ConstConstraint,ConstJoltPhysicsObject,AutoCloseable,Comparable<JoltPhysicsObject>
A counted reference to a
Constraint. (native type:
Ref<Constraint>)-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturn the constraint's priority when solving.Generate settings to reconstruct the constraint.booleanTest whether the constraint is enabled.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.getPtr()Temporarily access the referencedConstraint.Return the constraint's subtype.getType()Return the constraint's type.booleanisActive()Test whether the constraint is active.voidsaveState(StateRecorder recorder) Save the state of the constraint, for possible replay.longtargetVa()Return the address of the nativeConstraint.toRef()Create another counted reference to the nativeConstraint.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, 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
-
Constructor Details
-
ConstraintRef
public ConstraintRef()Instantiate an empty reference.
-
-
Method Details
-
getConstraintPriority
public int getConstraintPriority()Return the constraint's priority when solving. The constraint is unaffected.- Specified by:
getConstraintPriorityin interfaceConstConstraint- Returns:
- the priority level
-
getConstraintSettings
Generate settings to reconstruct the constraint. The constraint is unaffected.- Specified by:
getConstraintSettingsin interfaceConstConstraint- Returns:
- a new counted reference to a new settings object
-
getEnabled
public boolean getEnabled()Test whether the constraint is enabled. The constraint is unaffected.- Specified by:
getEnabledin interfaceConstConstraint- Returns:
trueif enabled, otherwisefalse
-
getNumPositionStepsOverride
public int getNumPositionStepsOverride()Return the override for the number of position iterations used in the solver. The constraint is unaffected.- Specified by:
getNumPositionStepsOverridein interfaceConstConstraint- 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 constraint is unaffected.- Specified by:
getNumVelocityStepsOverridein interfaceConstConstraint- Returns:
- the number of iterations, or 0 to use the default in
PhysicsSettings
-
getSubType
Return the constraint's subtype. The constraint is unaffected.- Specified by:
getSubTypein interfaceConstConstraint- Returns:
- an enum value (not null)
-
getType
Return the constraint's type. The constraint is unaffected.- Specified by:
getTypein interfaceConstConstraint- Returns:
- an enum value (not null)
-
isActive
public boolean isActive()Test whether the constraint is active. The constraint is unaffected.- Specified by:
isActivein interfaceConstConstraint- Returns:
trueif active, otherwisefalse
-
saveState
Save the state of the constraint, for possible replay. The constraint is unaffected.- Specified by:
saveStatein interfaceConstConstraint- Parameters:
recorder- the recorder to write to (not null)
-
getPtr
Temporarily access the referencedConstraint. -
targetVa
public long targetVa()Return the address of the nativeConstraint. No objects are affected.- Specified by:
targetVain interfaceConstJoltPhysicsObject- Overrides:
targetVain classJoltPhysicsObject- Returns:
- a virtual address (not zero)
-
toRef
Create another counted reference to the nativeConstraint.
-