Collects each visible {@link BoundingBoxAttachment} and computes the world vertices for its polygon. The polygon vertices are provided along with convenience methods for doing hit detection.
Constructor
Methods
update(skeleton:Skeleton, updateAabb:Bool):Void
Clears any previous polygons, finds all visible bounding box attachments, and computes the world vertices for each bounding box's polygon.
Parameters:
updateAabb | If true, the axis aligned bounding box containing all the polygons is computed. If false, the SkeletonBounds AABB methods will always return true. |
---|
aabbContainsPoint(x:Float, y:Float):Bool
Returns true if the axis aligned bounding box contains the point.
aabbIntersectsSegment(x1:Float, y1:Float, x2:Float, y2:Float):Bool
Returns true if the axis aligned bounding box intersects the line segment.
aabbIntersectsSkeleton(bounds:SkeletonBounds):Bool
Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds.
containsPoint(x:Float, y:Float):BoundingBoxAttachment
Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true.
polygonContainsPoint(polygon:FloatArray, x:Float, y:Float):Bool
Returns true if the polygon contains the point.
intersectsSegment(x1:Float, y1:Float, x2:Float, y2:Float):BoundingBoxAttachment
Returns the first bounding box attachment that contains any part of the line segment, or null. When doing many checks, it is usually more efficient to only call this method if {@link #aabbIntersectsSegment(float, float, float, float)} returns true.
polygonIntersectsSegment(polygon:FloatArray, x1:Float, y1:Float, x2:Float, y2:Float):Bool
Returns true if the polygon contains any part of the line segment.
getPolygon(boundingBox:BoundingBoxAttachment):FloatArray
Returns the polygon for the specified bounding box, or null.