Class SwingTwistConstraintSettings

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

public class SwingTwistConstraintSettings extends TwoBodyConstraintSettings
Settings used to construct a SwingTwistConstraint.
  • Constructor Details

    • SwingTwistConstraintSettings

      public SwingTwistConstraintSettings()
      Instantiate default settings.
  • Method Details

    • getMaxFrictionTorque

      public float getMaxFrictionTorque()
      Return the maximum friction torque when not driven by a motor. The settings are unaffected. (native attribute: mMaxFrictionTorque)
      Returns:
      the torque (in Newton.meters)
    • getNormalHalfConeAngle

      public float getNormalHalfConeAngle()
      Return the half angle of the normal cone. The settings are unaffected. (native attribute: mNormalHalfConeAngle)
      Returns:
      the half angle (in radians)
    • getPlaneAxis1

      public Vec3 getPlaneAxis1()
      Copy the plane axis of body 1. The settings are unaffected. (native attribute: mPlaneAxis1)
      Returns:
      a new direction vector
    • getPlaneAxis2

      public Vec3 getPlaneAxis2()
      Copy the plane axis of body 2. The settings are unaffected. (native attribute: mPlaneAxis2)
      Returns:
      a new direction vector
    • getPlaneHalfConeAngle

      public float getPlaneHalfConeAngle()
      Return one-half the maximum angle between the twist axes of body 1 and body 2. The settings are unaffected. (native attribute: mPlaneHalfConeAngle)
      Returns:
      the half angle (in radians)
    • getPosition1

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

      public RVec3 getPosition2()
      Copy the initial location of 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)
    • getSwingMotorSettings

      public MotorSettings getSwingMotorSettings()
      Access the swing motor settings. (native attribute: mSwingMotorSettings)
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getSwingType

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

      public Vec3 getTwistAxis1()
      Copy the twist axis of body 1. The settings are unaffected. (native attribute: mTwistAxis1)
      Returns:
      a new direction vector
    • getTwistAxis2

      public Vec3 getTwistAxis2()
      Copy the twist axis of body 2. The settings are unaffected. (native attribute: mTwistAxis2)
      Returns:
      a new direction vector
    • getTwistMaxAngle

      public float getTwistMaxAngle()
      Return the maximum twist angle. The settings are unaffected. (native attribute: mTwistMaxAngle)
      Returns:
      the angle (in radians)
    • getTwistMinAngle

      public float getTwistMinAngle()
      Return the minimum twist angle. The settings are unaffected. (native attribute: mTwistMinAngle)
      Returns:
      the angle (in radians)
    • getTwistMotorSettings

      public MotorSettings getTwistMotorSettings()
      Access the twist motor settings. (native attribute: mTwistMotorSettings)
      Returns:
      a new JVM object with the pre-existing native object assigned
    • setMaxFrictionTorque

      public void setMaxFrictionTorque(float torque)
      Alter the maximum friction torque when not driven by a motor. (native attribute: mMaxFrictionTorque)
      Parameters:
      torque - the desired limit (in Newton.meters, default=0)
    • setNormalHalfConeAngle

      public void setNormalHalfConeAngle(float angle)
      Alter the half angle of the normal cone. (native attribute: mNormalHalfConeAngle)
      Parameters:
      angle - the desired half angle (in radians, default=0)
    • setPlaneAxis1

      public Vec3Arg setPlaneAxis1(Vec3Arg axisDirection)
      Alter the plane axis of body 1. (native attribute: mPlaneAxis1)
      Parameters:
      axisDirection - the desired direction (not null, unaffected, default=(0,1,0))
      Returns:
      the argument, for chaining
    • setPlaneAxis2

      public Vec3Arg setPlaneAxis2(Vec3Arg axisDirection)
      Alter the plane axis of body 2. (native attribute: mPlaneAxis2)
      Parameters:
      axisDirection - the desired direction (not null, unaffected, default=(0,1,0))
      Returns:
      the argument, for chaining
    • setPlaneHalfConeAngle

      public void setPlaneHalfConeAngle(float angle)
      Alter the half-angle of the plane cone. (native attribute: mPlaneHalfConeAngle)
      Parameters:
      angle - the desired limit (in radians, default=0)
    • setPosition1

      public RVec3Arg setPosition1(RVec3Arg location)
      Alter the initial location of the 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 initial location of 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 - enum value (not null, default=WorldSpace)
    • setSwingMotorSettings

      public MotorSettings setSwingMotorSettings(MotorSettings motorSettings)
      Alter the settings for the swing motor. (native attribute: mSwingMotorSettings)
      Parameters:
      motorSettings - the desired settings (not null, unaffected)
      Returns:
      the argument, for chaining
    • setSwingType

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

      public Vec3Arg setTwistAxis1(Vec3Arg axisDirection)
      Alter the twist axis of the body 1. (native attribute: mTwistAxis1)
      Parameters:
      axisDirection - the desired direction (not null, unaffected, default=(1,0,0))
      Returns:
      the argument, for chaining
    • setTwistAxis2

      public Vec3Arg setTwistAxis2(Vec3Arg axisDirection)
      Alter the twist axis of body 2. (native attribute: mTwistAxis2)
      Parameters:
      axisDirection - the desired direction (not null, unaffected, default=(1,0,0))
      Returns:
      the argument, for chaining
    • setTwistMaxAngle

      public void setTwistMaxAngle(float angle)
      Alter the maximum twist angle. (native attribute: mTwistMaxAngle)
      Parameters:
      angle - the desired limit (in radians, ≥-Pi, ≤Pi, default=0)
    • setTwistMinAngle

      public void setTwistMinAngle(float angle)
      Alter the minimum twist angle. (native attribute: mTwistMinAngle)
      Parameters:
      angle - the desired limit (in radians, ≥-Pi, ≤Pi, default=0)
    • setTwistMotorSettings

      public MotorSettings setTwistMotorSettings(MotorSettings motorSettings)
      Alter the settings for the twist motor. (native attribute: mTwistMotorSetting)
      Parameters:
      motorSettings - the desired settings (not null, unaffected)
      Returns:
      the argument, for chaining