Module org.dyn4j

Interface AngularSpringJoint

  • All Known Implementing Classes:
    WeldJoint

    public interface AngularSpringJoint
    Represents a joint that has an angular spring at the pivot point.
    Since:
    5.0.0
    Version:
    5.0.0
    Author:
    William Bittle
    • Method Detail

      • setSpringEnabled

        void setSpringEnabled​(boolean enabled)
        Sets whether the spring is enabled or not.
        Parameters:
        enabled - true if the spring should be enabled
      • isSpringEnabled

        boolean isSpringEnabled()
        Returns true if the spring is enabled.
        Returns:
        boolean
      • setSpringDamperEnabled

        void setSpringDamperEnabled​(boolean enabled)
        Sets whether the spring's damper is enabled or not.

        NOTE: for the damper to have any effect, the spring must be enabled.

        Parameters:
        enabled - true if the damper should be enabled
        See Also:
        setSpringEnabled(boolean)
      • isSpringDamperEnabled

        boolean isSpringDamperEnabled()
        Returns true if the damper is enabled for the spring.

        NOTE: for the damper to have any effect, the spring must be enabled.

        Returns:
        boolean
        Since:
        4.0.0
        See Also:
        isSpringEnabled()
      • getSpringDampingRatio

        double getSpringDampingRatio()
        Returns the damping ratio for the spring's damper.
        Returns:
        double
      • setSpringDampingRatio

        void setSpringDampingRatio​(double dampingRatio)
        Sets the damping ratio.

        Larger values reduce the oscillation of the spring.

        Parameters:
        dampingRatio - the damping ratio; in the range (0, 1]
        Throws:
        IllegalArgumentException - if damping ratio is less than or equal to zero or greater than 1
      • getSpringFrequency

        double getSpringFrequency()
        Returns the spring frequency.
        Returns:
        double
      • setSpringFrequency

        void setSpringFrequency​(double frequency)
        Sets the spring frequency.

        Larger values increase the stiffness of the spring.

        Calling this method puts the spring into fixed frequency mode. In this mode, the spring stiffness is computed based on the frequency.

        Parameters:
        frequency - the spring frequency in hz; must be greater than zero
        Throws:
        IllegalArgumentException - if frequency is less than or equal to zero
      • getSpringStiffness

        double getSpringStiffness()
        Returns the spring stiffness.
        Returns:
        double
      • setSpringStiffness

        void setSpringStiffness​(double stiffness)
        Sets the spring stiffness.

        Larger values increase the stiffness of the spring.

        Calling this method puts the spring into fixed stiffness mode. In this mode, the spring frequency is computed based on the stiffness.

        Parameters:
        stiffness - the spring stiffness (k); must be greater than zero
        Throws:
        IllegalArgumentException - if stiffness is less than or equal to zero
      • isMaximumSpringTorqueEnabled

        boolean isMaximumSpringTorqueEnabled()
        Returns true if the maximum spring torque is enabled.
        Returns:
        boolean
      • setMaximumSpringTorqueEnabled

        void setMaximumSpringTorqueEnabled​(boolean enabled)
        Sets whether the spring torque is limited to a maximum torque.
        Parameters:
        enabled - true if the spring torque should be limited
      • getMaximumSpringTorque

        double getMaximumSpringTorque()
        Returns the maximum spring torque in Newton-meters.
        Returns:
        double
      • setMaximumSpringTorque

        void setMaximumSpringTorque​(double maximum)
        Sets the maximum spring torque the spring is allowed to exert.
        Parameters:
        maximum - the maximum spring torque
        Throws:
        IllegalArgumentException - if maximum is less than or equal to zero
      • getSpringTorque

        double getSpringTorque​(double invdt)
        Returns the torque applied to by the spring in the last step.
        Parameters:
        invdt - the inverse delta time
        Returns:
        double