Module org.dyn4j

Class AbstractBounds

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Vector2 getTranslation()
      Returns the translation of the bounds.
      void shift​(Vector2 shift)
      Translates the object to match the given coordinate shift.
      void translate​(double x, double y)
      Translates the object the given amounts in the respective directions.
      void translate​(Vector2 vector)
      Translates the object along the given vector.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractBounds

        public AbstractBounds()
        Default constructor.
      • AbstractBounds

        public AbstractBounds​(double x,
                              double y)
        Optional constructor.
        Parameters:
        x - the initial x translation of the bounds
        y - the initial x translation of the bounds
      • AbstractBounds

        public AbstractBounds​(Vector2 translation)
        Optional constructor.
        Parameters:
        translation - the initial translation of the bounds
    • Method Detail

      • getTranslation

        public Vector2 getTranslation()
        Description copied from interface: Bounds
        Returns the translation of the bounds.
        Specified by:
        getTranslation in interface Bounds
        Returns:
        Vector2
      • translate

        public void translate​(double x,
                              double y)
        Description copied from interface: Translatable
        Translates the object the given amounts in the respective directions.
        Specified by:
        translate in interface Translatable
        Parameters:
        x - the translation in the x direction
        y - the translation in the y direction
      • translate

        public void translate​(Vector2 vector)
        Description copied from interface: Translatable
        Translates the object along the given vector.
        Specified by:
        translate in interface Translatable
        Parameters:
        vector - the translation along a vector
      • shift

        public void shift​(Vector2 shift)
        Description copied from interface: Shiftable
        Translates the object to match the given coordinate shift.
        Specified by:
        shift in interface Shiftable
        Parameters:
        shift - the amount to shift along the x and y axes