Module org.dyn4j

Class Penetration

    • Constructor Detail

      • Penetration

        public Penetration()
        Default constructor.
    • Method Detail

      • clear

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

        public Vector2 getNormal()
        Returns the penetration normal.
        Returns:
        Vector2
      • getDepth

        public double getDepth()
        Returns the penetration depth.
        Returns:
        double
      • setNormal

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

        Must be normalized.

        Parameters:
        normal - the penetration normal
      • setDepth

        public void setDepth​(double depth)
        Sets the penetration depth.
        Parameters:
        depth - the penetration depth
      • copy

        public void copy​(Penetration penetration)
        Copies (deep) the given Penetration information to this Penetration.
        Parameters:
        penetration - the penetration 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