Class PxDistanceJoint


public class PxDistanceJoint extends PxJoint
a joint that maintains an upper or lower bound (or both) on the distance between two points on different objects
See Also:
  • Field Details

    • SIZEOF

      public static final int SIZEOF
    • ALIGNOF

      public static final int ALIGNOF
      See Also:
  • Constructor Details

    • PxDistanceJoint

      protected PxDistanceJoint()
    • PxDistanceJoint

      protected PxDistanceJoint(long address)
  • Method Details

    • wrapPointer

      public static PxDistanceJoint wrapPointer(long address)
    • arrayGet

      public static PxDistanceJoint arrayGet(long baseAddress, int index)
    • destroy

      public void destroy()
    • getDistance

      public float getDistance()
      Return the current distance of the joint
    • setMinDistance

      public void setMinDistance(float distance)
      Set the allowed minimum distance for the joint.

      The minimum distance must be no more than the maximum distance

      Default 0.0f Range [0, PX_MAX_F32)

      Parameters:
      distance - the minimum distance
      See Also:
    • getMinDistance

      public float getMinDistance()
      Get the allowed minimum distance for the joint.
      Returns:
      the allowed minimum distance
      See Also:
    • setMaxDistance

      public void setMaxDistance(float distance)
      Set the allowed maximum distance for the joint.

      The maximum distance must be no less than the minimum distance.

      Default 0.0f Range [0, PX_MAX_F32)

      Parameters:
      distance - the maximum distance
      See Also:
    • getMaxDistance

      public float getMaxDistance()
      Get the allowed maximum distance for the joint.
      Returns:
      the allowed maximum distance
      See Also:
    • setTolerance

      public void setTolerance(float tolerance)
      Set the error tolerance of the joint.
      Parameters:
      tolerance - the distance beyond the allowed range at which the joint becomes active
      See Also:
    • getTolerance

      public float getTolerance()
      Get the error tolerance of the joint.

      the distance beyond the joint's [min, max] range before the joint becomes active.

      Default 0.25f * PxTolerancesScale::length Range (0, PX_MAX_F32)

      This value should be used to ensure that if the minimum distance is zero and the spring function is in use, the rest length of the spring is non-zero.

      See Also:
    • setStiffness

      public void setStiffness(float stiffness)
      Set the strength of the joint spring.

      The spring is used if enabled, and the distance exceeds the range [min-error, max+error].

      Default 0.0f Range [0, PX_MAX_F32)

      Parameters:
      stiffness - the spring strength of the joint
      See Also:
    • getStiffness

      public float getStiffness()
      Get the strength of the joint spring.
      Returns:
      stiffness the spring strength of the joint
      See Also:
    • setDamping

      public void setDamping(float damping)
      Set the damping of the joint spring.

      The spring is used if enabled, and the distance exceeds the range [min-error, max+error].

      Default 0.0f Range [0, PX_MAX_F32)

      Parameters:
      damping - the degree of damping of the joint spring of the joint
      See Also:
    • getDamping

      public float getDamping()
      Get the damping of the joint spring.
      Returns:
      the degree of damping of the joint spring of the joint
      See Also:
    • setDistanceJointFlags

      public void setDistanceJointFlags(PxDistanceJointFlags flags)
      Set the flags specific to the Distance Joint.

      Default PxDistanceJointFlag::eMAX_DISTANCE_ENABLED

      Parameters:
      flags - The joint flags.
    • setDistanceJointFlag

      public void setDistanceJointFlag(PxDistanceJointFlagEnum flag, boolean value)
      Set a single flag specific to a Distance Joint to true or false.
      Parameters:
      flag - The flag to set or clear.
      value - the value to which to set the flag
    • getDistanceJointFlags

      public PxDistanceJointFlags getDistanceJointFlags()
      Get the flags specific to the Distance Joint.
      Returns:
      the joint flags