Represents a shape made from multiple shapes.
WARNING: It is only meant to work with polygons for now.
0.1.0
.Constructor
Variables
shapes:Array<Shape> = []
An array of nb.shape.Shape
containing the individual shapes of this instance.
union:Array<Shape> = []
An array of nb.shape.Shape
containing the shapes resulting from the union of shapes
.
Methods
clearDebugDraw():Void
Removes the debug visualizations of this instanceby calling the debugDraw
functions of each shape in union
.
debugDraw(?color:Int):Void
Draws the debug visualizations of this instance by calling the debugDraw
functions of each shape in union
.
getFarthestPoints(vector:Point):Array<Point>
Returns the farthest points in the direction defined by vector
.
getFarthestPointsFrom(fromCentroid:Bool = true):Array<Point>
Returns the farthest points of this shape from its center or centroid.
Parameters:
fromCentroid | If |
---|
Returns:
An array of h2d.col.Point
. Only the points that are the farthest are returned,
not all the points of this shape from the farthest to the closest.
updateFields():Void
Updates fields related to this instance's current attributes, as deduced from the shapes it contains.