BGE/QuickHull

Methods

(static) addSegments(line, points, hull, line, points) → {void}

Recursively adds hull segments

Parameters:
Name Type Description
line
points
hull object
line object
points object
Source:

(static) distalPoints(points, line, line, points) → {object}

Determines the set of points that lay outside the line (positive), and the most distal point Returns: {points: [ [x1, y1], ... ], max: [x,y] ]

Parameters:
Name Type Description
points
line
line object
points object
Source:

(static) distanceFromLine(point, line) → {float}

Calculates the distance of a point from a line modified from https:'github.com/claytongulick/quickhull return {float}

Parameters:
Name Type Description
point Array

Array [x,y]

line Array

Array of two points [ [x1,y1], [x2,y2] ]

Source:

(static) getMaxHeightAndVerticalOffset(pointsArrayopt) → {object}

Gets the total height from first point to last point vertically, and the offset of the first point

Parameters:
Name Type Attributes Default Description
pointsArray object <optional>
[]

array of {x,y} objects

Source:

(static) getMaxWidthAndHorizontalOffset(pointsArrayopt) → {object}

Gets the total width from first point to last point horizontally, and the offset of the first point

Parameters:
Name Type Attributes Default Description
pointsArray object <optional>
[]

array of {x,y} objects

Source:

(static) getMinMaxPoints(pointsArrayopt, verticalopt) → {object}

Gets the min and max points in the set along the X axis modified from https:'github.com/claytongulick/quickhull

Parameters:
Name Type Attributes Default Description
pointsArray Array <optional>
[]

An array of {x,y} objects

vertical boolean <optional>
false
Source:

(static) getTrianglesFromPoints(pointsArrayopt, hullopt) → {object}

Gets a series of triangles for the convex space defined by an array of {x,y} points

Parameters:
Name Type Attributes Default Description
pointsArray object <optional>
[]

array of {x,y} objects

hull boolean <optional>
true

perform a quick hull operation

Source:

(static) QuickHull(pointsArrayopt) → {object}

Implementation of the QuickHull algorithm for finding convex hull of a set of points Modified from: https://github.com/claytongulick/quickhull Original author Clay Gulick

Parameters:
Name Type Attributes Default Description
pointsArray object <optional>
[]

array of {x,y} objects

Source: