Module org.dyn4j

Class Torque


  • public class Torque
    extends java.lang.Object
    Represents a torque about the z-axis.
    Since:
    1.0.0
    Version:
    3.2.0
    Author:
    William Bittle
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected double torque
      The point where the Force is applied in world coordinates
    • Constructor Summary

      Constructors 
      Constructor Description
      Torque()
      Default constructor.
      Torque​(double torque)
      Creates a Torque using specified torque value.
      Torque​(Torque torque)
      Copy constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getTorque()
      Returns the torque value.
      boolean isComplete​(double elapsedTime)
      Returns true if this torque should be removed.
      void set​(double torque)
      Sets this Torque to the given torque value.
      void set​(Torque torque)
      Sets this Torque to the given Torque.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • torque

        protected double torque
        The point where the Force is applied in world coordinates
    • Constructor Detail

      • Torque

        public Torque()
        Default constructor.
        Since:
        1.0.2
      • Torque

        public Torque​(double torque)
        Creates a Torque using specified torque value.
        Parameters:
        torque - the torque
      • Torque

        public Torque​(Torque torque)
        Copy constructor.
        Parameters:
        torque - the Torque to copy
        Throws:
        java.lang.NullPointerException - if torque is null
    • Method Detail

      • set

        public void set​(double torque)
        Sets this Torque to the given torque value.
        Parameters:
        torque - the torque
      • set

        public void set​(Torque torque)
        Sets this Torque to the given Torque.
        Parameters:
        torque - the Torque to copy
        Throws:
        java.lang.NullPointerException - if torque is null
      • isComplete

        public boolean isComplete​(double elapsedTime)
        Returns true if this torque should be removed.

        Implement this method to create Torque objects that are not cleared each iteration by the World.

        The default implementation always returns true.

        Parameters:
        elapsedTime - the elapsed time since the last call to this method
        Returns:
        boolean true if this torque should be removed
        Since:
        3.1.0
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getTorque

        public double getTorque()
        Returns the torque value.
        Returns:
        double