Module org.dyn4j

Class Manifold


  • public class Manifold
    extends java.lang.Object
    Represents a contact Manifold for a collision between two Convex Shapes.

    A Manifold has a list of ManifoldPoints for a given Penetration normal. In two dimensions there will only be 1 or 2 contact points.

    All ManifoldPoints are in world space coordinates.

    Since:
    1.0.0
    Version:
    3.0.2
    Author:
    William Bittle
    • Constructor Detail

      • Manifold

        public Manifold()
        Default constructor.
      • Manifold

        public Manifold​(java.util.List<ManifoldPoint> points,
                        Vector2 normal)
        Full constructor.
        Parameters:
        points - the manifold points
        normal - the manifold normal
    • Method Detail

      • toString

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

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

        public Vector2 getNormal()
        Returns the normal.
        Returns:
        Vector2
      • setPoints

        public void setPoints​(java.util.List<ManifoldPoint> points)
        Sets the point list of this Manifold.
        Parameters:
        points - the point list
      • setNormal

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

        Must be normalized.

        Parameters:
        normal - the manifold normal