Module org.dyn4j

Class ManifoldPoint


  • public class ManifoldPoint
    extends java.lang.Object
    Represents a single contact point in a contact Manifold.

    The depth represents the distance along the Manifold normal to this contact point. This can vary for every ManifoldPoint in a Manifold.

    Since:
    1.0.0
    Version:
    3.1.5
    Author:
    William Bittle
    See Also:
    Manifold
    • Field Detail

      • point

        protected Vector2 point
        The point in world coordinates
      • depth

        protected double depth
        The penetration depth
    • Constructor Detail

      • ManifoldPoint

        public ManifoldPoint​(ManifoldPointId id)
        Minimal constructor.
        Parameters:
        id - the id for this manifold point
      • ManifoldPoint

        public ManifoldPoint​(ManifoldPointId id,
                             Vector2 point,
                             double depth)
        Full constructor.
        Parameters:
        id - the id for this manifold point
        point - the manifold point in world coordinates
        depth - the penetration depth
    • Method Detail

      • toString

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

        public Vector2 getPoint()
        Returns the contact point.
        Returns:
        Vector2 the point in world coordinates
      • setPoint

        public void setPoint​(Vector2 point)
        Sets the contact point.
        Parameters:
        point - the point in world coordinates
        Since:
        3.1.5
      • getDepth

        public double getDepth()
        Returns the collision depth of the manifold point.
        Returns:
        double
      • setDepth

        public void setDepth​(double depth)
        Sets the collision depth of the manifold point.
        Parameters:
        depth - the depth
        Since:
        3.1.5