Module org.dyn4j

Interface AngularLimitsJoint

  • All Known Implementing Classes:
    AngleJoint, RevoluteJoint, WeldJoint

    public interface AngularLimitsJoint
    Represents a joint with a single set of angular limits.
    Since:
    5.0.0
    Version:
    5.0.0
    Author:
    William Bittle
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      double getLimitsReferenceAngle()
      Returns the limits reference angle.
      double getLowerLimit()
      Returns the lower angular limit in radians.
      double getUpperLimit()
      Returns the upper angular limit in radians.
      boolean isLimitsEnabled()
      Returns true if the angular limits are enabled.
      void setLimits​(double limit)
      Sets both the lower and upper limits to the given limit.
      void setLimits​(double lowerLimit, double upperLimit)
      Sets the upper and lower angular limits.
      void setLimitsEnabled​(boolean flag)
      Enables or disables the angular limits.
      void setLimitsEnabled​(double limit)
      Sets both the lower and upper limits to the given limit and enables them.
      void setLimitsEnabled​(double lowerLimit, double upperLimit)
      Sets both the lower and upper limits and enables them.
      void setLimitsReferenceAngle​(double angle)
      Sets the limits reference angle.
      void setLowerLimit​(double lowerLimit)
      Sets the lower angular limit.
      void setUpperLimit​(double upperLimit)
      Sets the upper angular limit.
    • Method Detail

      • isLimitsEnabled

        boolean isLimitsEnabled()
        Returns true if the angular limits are enabled.
        Returns:
        boolean
      • setLimitsEnabled

        void setLimitsEnabled​(boolean flag)
        Enables or disables the angular limits.
        Parameters:
        flag - true if the limit should be enabled
      • getUpperLimit

        double getUpperLimit()
        Returns the upper angular limit in radians.
        Returns:
        double
      • setUpperLimit

        void setUpperLimit​(double upperLimit)
        Sets the upper angular limit.

        Must be greater than or equal to the lower angular limit.

        See the class documentation for more details on the limit ranges.

        Parameters:
        upperLimit - the upper angular limit in radians
        Throws:
        IllegalArgumentException - if upperLimit is less than the current lower limit
      • getLowerLimit

        double getLowerLimit()
        Returns the lower angular limit in radians.
        Returns:
        double
      • setLowerLimit

        void setLowerLimit​(double lowerLimit)
        Sets the lower angular limit.

        Must be less than or equal to the upper angular limit.

        See the class documentation for more details on the limit ranges.

        Parameters:
        lowerLimit - the lower angular limit in radians
        Throws:
        IllegalArgumentException - if lowerLimit is greater than the current upper limit
      • setLimits

        void setLimits​(double lowerLimit,
                       double upperLimit)
        Sets the upper and lower angular limits.

        The lower limit must be less than or equal to the upper limit.

        See the class documentation for more details on the limit ranges.

        Parameters:
        lowerLimit - the lower limit in radians
        upperLimit - the upper limit in radians
        Throws:
        IllegalArgumentException - if the lowerLimit is greater than upperLimit
      • setLimitsEnabled

        void setLimitsEnabled​(double lowerLimit,
                              double upperLimit)
        Sets both the lower and upper limits and enables them.

        See the class documentation for more details on the limit ranges.

        Parameters:
        lowerLimit - the lower limit in radians
        upperLimit - the upper limit in radians
        Throws:
        IllegalArgumentException - if lowerLimit is greater than upperLimit
        Since:
        4.2.0
      • setLimitsEnabled

        void setLimitsEnabled​(double limit)
        Sets both the lower and upper limits to the given limit and enables them.

        See the class documentation for more details on the limit ranges.

        Parameters:
        limit - the desired limit
        Since:
        4.2.0
      • setLimits

        void setLimits​(double limit)
        Sets both the lower and upper limits to the given limit.

        See the class documentation for more details on the limit ranges.

        Parameters:
        limit - the desired limit
        Since:
        4.2.0
      • getLimitsReferenceAngle

        double getLimitsReferenceAngle()
        Returns the limits reference angle.

        The reference angle is the angle calculated when the joint was created from the two joined bodies. The reference angle is the angular difference between the bodies.

        Returns:
        double
        Since:
        3.0.1
      • setLimitsReferenceAngle

        void setLimitsReferenceAngle​(double angle)
        Sets the limits reference angle.

        This method can be used to set the reference angle to override the computed reference angle from the constructor. This is useful in recreating the joint from a current state or when adjusting the limits.

        See the class documentation for more details.

        Parameters:
        angle - the reference angle in radians
        Since:
        3.0.1
        See Also:
        getLimitsReferenceAngle()