com.badlogic.gdx.math
Class ConvexHull
java.lang.Object
com.badlogic.gdx.math.ConvexHull
public class ConvexHull
- extends Object
Computes the convex hull of a set of points using the monotone chain convex hull algorithm (aka Andrew's algorithm).
- Author:
- Nathan Sweet
ConvexHull
public ConvexHull()
computePolygon
public FloatArray computePolygon(FloatArray points,
boolean sorted)
- See Also:
computePolygon(float[], int, int, boolean)
computePolygon
public FloatArray computePolygon(float[] polygon,
boolean sorted)
- See Also:
computePolygon(float[], int, int, boolean)
computePolygon
public FloatArray computePolygon(float[] points,
int offset,
int count,
boolean sorted)
- Returns the convex hull polygon for the given point cloud.
- Parameters:
points
- x,y pairs describing points. Duplicate points will result in undefined behavior.sorted
- If false, the points will be sorted by the x coordinate then the y coordinate, which is required by the convex
hull algorithm. If sorting is done the input array is not modified and count additional working memory is needed.
- Returns:
- pairs of coordinates that describe the convex hull polygon in counterclockwise order. Note the returned array is
reused for later calls to the same method.
Copyright © 2013. All Rights Reserved.