Class 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 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 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 in PhysicsSettings (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 in PhysicsSettings (default=0)
    • getConstraintPriority

      public int getConstraintPriority()
      Return the constraint's priority when solving. The settings are unaffected. (native attribute: mConstraintPriority)
      Specified by:
      getConstraintPriority in interface ConstConstraintSettings
      Returns:
      the priority level
    • getControllerType

      public int getControllerType()
      Return the constraint's controller type. The settings are unaffected.
      Specified by:
      getControllerType in interface ConstConstraintSettings
      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 interface ConstConstraintSettings
      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 interface ConstConstraintSettings
      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:
      getNumPositionStepsOverride in interface ConstConstraintSettings
      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 interface ConstConstraintSettings
      Returns:
      the number of iterations, or 0 to use the default configured in PhysicsSettings
    • getRefCount

      public int getRefCount()
      Count the active references to the native ConstraintSettings. The settings are unaffected.
      Specified by:
      getRefCount in interface RefTarget
      Returns:
      the count (≥0)
    • setEmbedded

      public void setEmbedded()
      Mark the native ConstraintSettings as embedded.
      Specified by:
      setEmbedded in interface RefTarget
    • toRef

      public Ref toRef()
      Create a counted reference to the native ConstraintSettings.
      Specified by:
      toRef in interface RefTarget
      Returns:
      a new JVM object with a new native object assigned