Module org.dyn4j

Class ManifoldPoint

    • Field Detail

      • point

        protected final Vector2 point
        The point in world coordinates
      • depth

        protected double depth
        The penetration depth
    • Constructor Detail

      • ManifoldPoint

        public ManifoldPoint​(ManifoldPointId id)
        Optional constructor.
        Parameters:
        id - the id for this manifold point; cannot be null
      • ManifoldPoint

        protected 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

      • 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
      • 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