Class SixDofConstraint

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

public class SixDofConstraint extends TwoBodyConstraint
A TwoBodyConstraint that can constrain all 6 degrees of freedom. (native type: SixDOFConstraint)
  • Method Details

    • getLimitsMax

      public float getLimitsMax(EAxis dof)
      Return the upper limit of the specified degree of freedom. The constraint is unaffected.
      Parameters:
      dof - which DOF to query (not null)
      Returns:
      the limit value
    • getLimitsMin

      public float getLimitsMin(EAxis dof)
      Return the lower limit of the specified degree of freedom. The constraint is unaffected.
      Parameters:
      dof - which DOF to query (not null)
      Returns:
      the limit value
    • getLimitsSpringSettings

      public SpringSettings getLimitsSpringSettings(EAxis dof)
      Access the spring settings of the specified degree of freedom. The constraint is unaffected.
      Parameters:
      dof - which degree of freedom to query (not null)
      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 constraint is unaffected.
      Parameters:
      dof - which DPF to alter (not null)
      Returns:
      the friction value
    • getMotorSettings

      public MotorSettings getMotorSettings(EAxis dof)
      Access the motor settings of the specified degree of freedom. The constraint is unaffected.
      Parameters:
      dof - which degree of freedom to query (not null)
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getMotorState

      public EMotorState getMotorState(EAxis dof)
      Return the motor state of the specified degree of freedom.
      Parameters:
      dof - which DOF to alter (not null)
      Returns:
      an enum value (not null)
    • getRotationInConstraintSpace

      public Quat getRotationInConstraintSpace()
      Copy the rotation of the constraint. The constraint is unaffected.
      Returns:
      a new rotation quaternion
    • getRotationLimitsMax

      public Vec3 getRotationLimitsMax()
      Return the rotation upper limits. The constraint is unaffected.
      Returns:
      the upper limit for each axis (not null)
    • getRotationLimitsMin

      public Vec3 getRotationLimitsMin()
      Return the rotation lower limits. The constraint is unaffected.
      Returns:
      the lower limit for each axis (not null)
    • getTargetAngularVelocityCs

      public Vec3 getTargetAngularVelocityCs()
      Copy the target velocities of the angular motors. The constraint is unaffected. (native method: GetTargetAngularVelocityCS)
      Returns:
      a new angular velocity vector (radians per second in body 2 constraint space)
    • getTargetPositionCs

      public Vec3 getTargetPositionCs()
      Copy the target position of the linear motors. The constraint is unaffected. (native method: GetTargetPositionCS)
      Returns:
      a new offset vector (meters in body 1 constraint space)
    • getTargetOrientationCs

      public Quat getTargetOrientationCs()
      Copy the target orientation of the angular motors. The constraint is unaffected. (native method: GetTargetOrientationCS)
      Returns:
      the target orientation (in constraint space)
    • getTargetVelocityCs

      public Vec3 getTargetVelocityCs()
      Copy the target velocities of the linear motors. The constraint is unaffected. (native method: GetTargetVelocityCS)
      Returns:
      a new linear velocity vector (meters per second in body 1 constraint space)
    • getTranslationLimitsMax

      public Vec3 getTranslationLimitsMax()
      Return the translation upper limits. The constraint is unaffected.
      Returns:
      the upper limit for each axis (not null)
    • getTranslationLimitsMin

      public Vec3 getTranslationLimitsMin()
      Return the translation lower limits. The constraint is unaffected.
      Returns:
      the lower limit for each axis (not null)
    • isFixedAxis

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

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

      public void setLimitsSpringSettings(EAxis dof, SpringSettings springSettings)
      Alter the spring settings of the specified degree of freedom.
      Parameters:
      dof - which DOF to alter (not null)
      springSettings - the desired settings (not null, unaffected)
    • setMaxFriction

      public void setMaxFriction(EAxis dof, float friction)
      Alter the maximum friction of the specified degree of freedom.
      Parameters:
      dof - which DOF to alter (not null)
      friction - the desired value
    • setMotorState

      public void setMotorState(EAxis dof, EMotorState state)
      Alter the motor state of the specified degree of freedom.
      Parameters:
      dof - which DOF to alter (not null)
      state - the desired state (not null)
    • setRotationLimits

      public void setRotationLimits(Vec3Arg min, Vec3Arg max)
      Alter the rotation limits.
      Parameters:
      min - the lower limit for each axis (not null, unaffected)
      max - the upper limit for each axis (not null, unaffected)
    • setTargetVelocityCs

      public void setTargetVelocityCs(Vec3Arg velocity)
      Alter the target velocities of the linear motors. (native method: SetTargetVelocityCS)
      Parameters:
      velocity - the desired linear velocity (meters per second in body 1 constraint space, not null)
    • setTargetAngularVelocityCs

      public void setTargetAngularVelocityCs(Vec3Arg omega)
      Alter the target velocities of the angular motors. (native method: SetTargetAngularVelocityCS)
      Parameters:
      omega - the desired angular velocity (radians per second in body 2 constraint space, not null)
    • setTargetPositionCs

      public void setTargetPositionCs(Vec3Arg offsets)
      Alter the target position of the linear motors. (native method: SetTargetPositionCS)
      Parameters:
      offsets - the desired offsets (meters in body 1 constraint space)
    • setTargetOrientationBs

      public void setTargetOrientationBs(QuatArg orientation)
      Alter the target orientation of the angular motors in body space. (native method: SetTargetOrientationBS)
      Parameters:
      orientation - the desired target orientation (not null, unaffected)
    • setTargetOrientationCs

      public void setTargetOrientationCs(QuatArg orientation)
      Alter the target orientation of the angular motors. (native method: SetTargetOrientationCS)
      Parameters:
      orientation - the desired orientation (in body 1 constraint space)
    • setTranslationLimits

      public void setTranslationLimits(Vec3Arg min, Vec3Arg max)
      Alter the translation limits.
      Parameters:
      min - the lower limit for each axis (not null, unaffected)
      max - the upper limit for each axis (not null, unaffected)