Module org.dyn4j

Interface HullGenerator

  • All Known Implementing Classes:
    DivideAndConquer, GiftWrap, GrahamScan, MonotoneChain

    public interface HullGenerator
    Represents an algorithm used to create a convex hull of a given point set.

    The hulls are returned as Vector2[]s that can then be used to create a Convex Shape.

    Algorithms implementing this interface are intended for general use but does not imply that the results produced would be appropriate for the core dyn4j engine.

    Since:
    2.2.0
    Version:
    3.4.0
    Author:
    William Bittle
    • Method Detail

      • generate

        Vector2[] generate​(Vector2... points)
        Returns a convex hull generated from the given point set in counter-clockwise point order.

        Returns null if the given points array is null.

        Returns the array unchanged if the length is less than or equal to 2.

        Parameters:
        points - the point set or cloud
        Returns:
        Vector2[] the convex hull vertices
        Throws:
        NullPointerException - if points is null or contains null points