Module org.dyn4j

Class Separation

    • Constructor Detail

      • Separation

        public Separation()
        Default constructor.
    • Method Detail

      • clear

        public void clear()
        Clears the separation information.
      • getNormal

        public Vector2 getNormal()
        Returns the separation normal.
        Returns:
        Vector2
      • getDistance

        public double getDistance()
        Returns the separation distance.
        Returns:
        double
      • setNormal

        public void setNormal​(Vector2 normal)
        Sets the separation normal.

        Must be normalized.

        Parameters:
        normal - the separation normal
      • setDistance

        public void setDistance​(double distance)
        Sets the separation distance.
        Parameters:
        distance - the separation distance
      • setPoint1

        public void setPoint1​(Vector2 point1)
        Sets the closest point on the first Convex Shape.
        Parameters:
        point1 - the closest point on the first Convex Shape
      • setPoint2

        public void setPoint2​(Vector2 point2)
        Sets the closest point on the second Convex Shape.
        Parameters:
        point2 - the closest point on the second Convex Shape
      • copy

        public void copy​(Separation separation)
        Copies (deep) the given Separation information to this Separation.
        Parameters:
        separation - the separation to copy
        Since:
        4.0.0
      • 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