Class DistanceConstraint

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

public class DistanceConstraint extends TwoBodyConstraint
A TwoBodyConstraint that holds 2 points at a fixed distance from each other.
  • Method Details

    • getLimitsSpringSettings

      public SpringSettings getLimitsSpringSettings()
      Access the spring settings.
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getMaxDistance

      public float getMaxDistance()
      Return the maximum distance. The constraint is unaffected.
      Returns:
      the distance
    • getMinDistance

      public float getMinDistance()
      Return the minimum distance. The constraint is unaffected.
      Returns:
      the distance
    • setDistance

      public void setDistance(float min, float max)
      Alter the limits.
      Parameters:
      min - the desired lower limit (in meters)
      max - the desired upper limit (in meters)