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 TypeMethodDescriptionint
Return the constraint's priority when solving.Convert the constraint to aConstraintSettings
object.boolean
Test whether the constraint is enabled.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.getPtr()
Temporarily access the referencedConstraint
.Return the constraint's subtype.getType()
Return the constraint's type.long
targetVa()
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, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, 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
-
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:
getConstraintPriority
in interfaceConstConstraint
- Returns:
- the priority level
-
getConstraintSettings
Convert the constraint to aConstraintSettings
object. The constraint is unaffected.- Specified by:
getConstraintSettings
in interfaceConstConstraint
- Returns:
- a new reference to a new settings object
-
getEnabled
public boolean getEnabled()Test whether the constraint is enabled. The constraint is unaffected.- Specified by:
getEnabled
in interfaceConstConstraint
- Returns:
true
if 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:
getNumPositionStepsOverride
in 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:
getNumVelocityStepsOverride
in 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:
getSubType
in interfaceConstConstraint
- Returns:
- an enum value (not null)
-
getType
Return the constraint's type. The constraint is unaffected.- Specified by:
getType
in interfaceConstConstraint
- Returns:
- an enum value (not null)
-
getPtr
Temporarily access the referencedConstraint
. -
targetVa
public long targetVa()Return the address of the nativeConstraint
. No objects are affected.- Specified by:
targetVa
in interfaceConstJoltPhysicsObject
- Overrides:
targetVa
in classJoltPhysicsObject
- Returns:
- a virtual address (not zero)
-
toRef
Create another counted reference to the nativeConstraint
.
-