Class SixDofConstraintSettings

All Implemented Interfaces:
ConstConstraintSettings, ConstJoltPhysicsObject, RefTarget, AutoCloseable, Comparable<JoltPhysicsObject>

public class SixDofConstraintSettings extends TwoBodyConstraintSettings
Settings used to construct a SixDofConstraint. (native type: SixDOFConstraintSettings)
  • Constructor Details

    • SixDofConstraintSettings

      public SixDofConstraintSettings()
      Instantiate default settings.
  • Method Details

    • getAxisX1

      public Vec3 getAxisX1()
      Copy the X axis for body 1. The settings are unaffected. (native attribute: mAxisX1)
      Returns:
      a new direction vector
    • getAxisX2

      public Vec3 getAxisX2()
      Copy the X axis for body 2. The settings are unaffected. (native attribute: mAxisX2)
      Returns:
      a new direction vector
    • getAxisY1

      public Vec3 getAxisY1()
      Copy the Y axis for body 1. The settings are unaffected. (native attribute: mAxisY1)
      Returns:
      a new direction vector
    • getAxisY2

      public Vec3 getAxisY2()
      Copy the Y axis for body 2. The settings are unaffected. (native attribute: mAxisY2)
      Returns:
      a new direction vector
    • getLimitMax

      public float getLimitMax(EAxis dof)
      Return the upper limit of the specified degree of freedom. The settings are unaffected. (native attribute: mLimitMax)
      Parameters:
      dof - which DOF (not null)
      Returns:
      the upper limit
    • getLimitMax

      public float getLimitMax(int dofIndex)
      Return the upper limit of the specified degree of freedom. The settings are unaffected. (native attribute: mLimitMax)
      Parameters:
      dofIndex - which DOF (≥0, <6)
      Returns:
      the upper limit
    • getLimitMin

      public float getLimitMin(EAxis dof)
      Return the lower limit of the specified degree of freedom. The settings are unaffected. (native attribute: mLimitMin)
      Parameters:
      dof - which DOF (not null)
      Returns:
      the lower limit
    • getLimitMin

      public float getLimitMin(int dofIndex)
      Return the lower limit of the specified degree of freedom. The settings are unaffected. (native attribute: mLimitMin)
      Parameters:
      dofIndex - which DOF (≥0,<6)
      Returns:
      the lower limit
    • getLimitsSpringSettings

      public SpringSettings getLimitsSpringSettings(EAxis translationDof)
      Access the spring settings for the specified degree of freedom. (native attribute: mLimitsSpringSettings)
      Parameters:
      translationDof - which DOF (not null, not a rotation DOF)
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getMaxFriction

      public float getMaxFriction(EAxis dof)
      Return the maximum friction of the specified degree of freedom. The settings are unaffected. (native attribute: mMaxFriction)
      Parameters:
      dof - which DOF (not null)
      Returns:
      the maximum friction value
    • getMotorSettings

      public MotorSettings getMotorSettings(EAxis dof)
      Access the motor settings for the specified degree of freedom. (native attribute: mMotorSettings)
      Parameters:
      dof - which DOF (not null)
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getMotorSettings

      public MotorSettings getMotorSettings(int dofIndex)
      Access the motor settings for the specified degree of freedom. (native attribute: mMotorSettings)
      Parameters:
      dofIndex - which DOF (≥0, <6)
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getPosition1

      public RVec3 getPosition1()
      Copy the constraint location for body 1. The settings are unaffected. (native attribute: mPosition1)
      Returns:
      a new location vector
    • getPosition2

      public RVec3 getPosition2()
      Copy the constraint location for body 2. The settings are unaffected. (native attribute: mPosition2)
      Returns:
      a new location vector
    • getSpace

      public EConstraintSpace getSpace()
      Return which space the other properties are specified in. The settings are unaffected. (native attribute: mSpace)
      Returns:
      an enum value (not null)
    • getSwingType

      public ESwingType getSwingType()
      Return type of swing constraint. The settings are unaffected. (native attribute: mSwingType)
      Returns:
      an enum value (not null)
    • isFixedAxis

      public boolean isFixedAxis(EAxis dof)
      Test whether the specified degree of freedom is fixed. The settings are unaffected.
      Parameters:
      dof - which DOF to test (not null)
      Returns:
      true if fixed, otherwise false
    • isFreeAxis

      public boolean isFreeAxis(EAxis dof)
      Test whether the specified degree of freedom is free. The settings are unaffected.
      Parameters:
      dof - which DOF to test (not null)
      Returns:
      true if free, otherwise false
    • makeFixedAxis

      public void makeFixedAxis(EAxis dof)
      Make the specified degree of freedom a fixed one.
      Parameters:
      dof - which DOF to modify (not null)
    • makeFixedAxis

      public void makeFixedAxis(int dofIndex)
      Make the specified degree of freedom a fixed one.
      Parameters:
      dofIndex - which DOF to modify (≥0, <6)
    • makeFreeAxis

      public void makeFreeAxis(EAxis dof)
      Make the specified degree of freedom a free one.
      Parameters:
      dof - which DOF to modify (not null)
    • makeFreeAxis

      public void makeFreeAxis(int dofIndex)
      Make the specified degree of freedom a free one.
      Parameters:
      dofIndex - which DOF to modify (≥0, <5)
    • setAxisX1

      public Vec3Arg setAxisX1(Vec3Arg axis)
      Alter the X axis for body 1. (native attribute: mAxisX1)
      Parameters:
      axis - the desired direction vector (default=(1,0,0))
      Returns:
      the argument, for chaining
    • setAxisX2

      public Vec3Arg setAxisX2(Vec3Arg axis)
      Alter the X axis for body 2. (native attribute: mAxisX2)
      Parameters:
      axis - the desired direction vector (default=(1,0,0))
      Returns:
      the argument, for chaining
    • setAxisY1

      public Vec3Arg setAxisY1(Vec3Arg axis)
      Alter the Y axis for body 1. (native attribute: mAxisY1)
      Parameters:
      axis - the desired direction vector (default=(0,1,0))
      Returns:
      the argument, for chaining
    • setAxisY2

      public Vec3Arg setAxisY2(Vec3Arg axis)
      Alter the Y axis for body 2. (native attribute: mAxisY2)
      Parameters:
      axis - the desired direction vector (default=(0,1,0))
      Returns:
      the argument, for chaining
    • setLimitedAxis

      public void setLimitedAxis(EAxis dof, float min, float max)
      Alter the limits of the specified degree of freedom.
      Parameters:
      dof - which DOF to modify (not null)
      min - the desired minimum value
      max - the desired maximum value
    • setLimitedAxis

      public void setLimitedAxis(int dofIndex, float min, float max)
      Alter the limits of the specified degree of freedom.
      Parameters:
      dofIndex - which DOF to modify (≥0, <6)
      min - the desired minimum value
      max - the desired maximum value
    • setLimitMax

      public void setLimitMax(EAxis dof, float max)
      Alter the upper limit of the specified degree of freedom. (native attribute: mLimitMax)
      Parameters:
      dof - which DOF to modify (not null)
      max - the desired limit value (default=MAX_VALUE)
    • setLimitMin

      public void setLimitMin(EAxis dof, float min)
      Alter the lower limit of the specified DOF. (native attribute: mLimitMin)
      Parameters:
      dof - which DOF to modify (not null)
      min - the desired limit value (default=-MAX_VALUE)
    • setMaxFriction

      public void setMaxFriction(EAxis dof, float friction)
      Alter the maximum friction of the specified degree of freedom. (native attribute: mMaxFriction)
      Parameters:
      dof - which DOF to modify (not null)
      friction - the desired value (default=0)
    • setMotorSettings

      public MotorSettings setMotorSettings(EAxis dof, MotorSettings motorSettings)
      Alter the motor settings for the specified degree of freedom. (native attribute: mMotorSettings)
      Parameters:
      dof - which DOF (not null)
      motorSettings - the settings to copy (not null, unaffected)
      Returns:
      the motor settings, for chaining
    • setMotorSettings

      public void setMotorSettings(int dofIndex, MotorSettings motorSettings)
      Alter the motor settings for the specified degree of freedom. (native attribute: mMotorSettings)
      Parameters:
      dofIndex - which DOF (≥0, <6)
      motorSettings - the settings to copy (not null, unaffected)
    • setPosition1

      public RVec3Arg setPosition1(RVec3Arg location)
      Alter the constraint location for body 1. (native attribute: mPosition1)
      Parameters:
      location - the desired location (not null, unaffected, default=(0,0,0))
      Returns:
      the argument, for chaining
    • setPosition2

      public RVec3Arg setPosition2(RVec3Arg location)
      Alter the constraint location for body 2. (native attribute: mPosition2)
      Parameters:
      location - the desired location (not null, unaffected, default=(0,0,0))
      Returns:
      the argument, for chaining
    • setSpace

      public void setSpace(EConstraintSpace space)
      Alter which space the other properties are specified in. (native attribute: mSpace)
      Parameters:
      space - an enum value (not null, default=WorldSpace)
    • setSwingType

      public void setSwingType(ESwingType swingType)
      Alter the type of swing constraint. (native attribute: mSwingType)
      Parameters:
      swingType - an enum value (not null, default=Cone)