Module org.dyn4j

Interface Convex

    • Method Detail

      • getAxes

        Vector2[] getAxes​(Vector2[] foci,
                          Transform transform)
        Returns an array of separating axes to test for this Shape.

        The foci parameter is an array of circular focal points of the other Shape.

        If foci points are given, this method will return the separating axes for this Shape's voronoi regions also. The points in the foci array are assumed to be in world space.

        The returned axes are normalized and in world space.

        Parameters:
        foci - the world space points representing foci of curved Shapes; can be null
        transform - the local to world space Transform of this Convex Shape
        Returns:
        Vector2[]
        Throws:
        java.lang.UnsupportedOperationException - if this shape doesn't support this method
      • getFoci

        Vector2[] getFoci​(Transform transform)
        Returns an array of world space foci points for circular curved edges.

        This method returns null if the Shape has zero curved edges.

        The returned points are in world space.

        Parameters:
        transform - the local to world space Transform of this Convex Shape
        Returns:
        Vector2[]
        Throws:
        java.lang.UnsupportedOperationException - if this shape doesn't support this method
      • getFarthestFeature

        Feature getFarthestFeature​(Vector2 vector,
                                   Transform transform)
        Returns the Feature farthest in the direction of the given vector.

        The returned feature is in world space.

        Parameters:
        vector - the direction
        transform - the local to world space Transform of this Convex Shape
        Returns:
        Feature
      • getFarthestPoint

        Vector2 getFarthestPoint​(Vector2 vector,
                                 Transform transform)
        Returns the point farthest in the direction of the given vector. If two points are equally distant along the given Vector2 the first one is used.

        The returned point is in world space.

        Parameters:
        vector - the direction
        transform - the local to world space Transform of this Convex Shape
        Returns:
        Vector2