Class ConstraintRef

All Implemented Interfaces:
ConstConstraint, ConstJoltPhysicsObject, AutoCloseable, Comparable<JoltPhysicsObject>

public final class ConstraintRef extends Ref implements ConstConstraint
A counted reference to a Constraint. (native type: Ref<Constraint>)
  • 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 interface ConstConstraint
      Returns:
      the priority level
    • getConstraintSettings

      public ConstraintSettingsRef getConstraintSettings()
      Convert the constraint to a ConstraintSettings object. The constraint is unaffected.
      Specified by:
      getConstraintSettings in interface ConstConstraint
      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 interface ConstConstraint
      Returns:
      true if enabled, otherwise false
    • 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 interface ConstConstraint
      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 interface ConstConstraint
      Returns:
      the number of iterations, or 0 to use the default in PhysicsSettings
    • getSubType

      public EConstraintSubType getSubType()
      Return the constraint's subtype. The constraint is unaffected.
      Specified by:
      getSubType in interface ConstConstraint
      Returns:
      an enum value (not null)
    • getType

      public EConstraintType getType()
      Return the constraint's type. The constraint is unaffected.
      Specified by:
      getType in interface ConstConstraint
      Returns:
      an enum value (not null)
    • getPtr

      public Constraint getPtr()
      Temporarily access the referenced Constraint.
      Specified by:
      getPtr in class Ref
      Returns:
      a new JVM object with the pre-existing native object assigned
    • targetVa

      public long targetVa()
      Return the address of the native Constraint. No objects are affected.
      Specified by:
      targetVa in interface ConstJoltPhysicsObject
      Overrides:
      targetVa in class JoltPhysicsObject
      Returns:
      a virtual address (not zero)
    • toRef

      public ConstraintRef toRef()
      Create another counted reference to the native Constraint.
      Specified by:
      toRef in class Ref
      Returns:
      a new JVM object with a new native object assigned