SkeletonBounds

spine.SkeletonBounds (Class)

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.

Instance Members

spine
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.

Name Type Description
skeleton Skeleton
updateAabb Bool If true, the axis aligned bounding box containing all the polygons is computed. If false, the SkeletonBounds AABB methods will always return true.

spine
aabbContainsPoint(x: Float, y: Float): Bool

Returns true if the axis aligned bounding box contains the point.

Name Type
x Float
y Float
Returns
Bool

spine
aabbIntersectsSegment(x1: Float, y1: Float, x2: Float, y2: Float): Bool

Returns true if the axis aligned bounding box intersects the line segment.

Name Type
x1 Float
y1 Float
x2 Float
y2 Float
Returns
Bool

spine
aabbIntersectsSkeleton(bounds: SkeletonBounds): Bool

Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds.

Name Type
bounds SkeletonBounds
Returns
Bool

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.

Name Type
x Float
y Float
Returns
spine.attachments.BoundingBoxAttachment

spine
polygonContainsPoint(polygon: spine.support.utils.FloatArray, x: Float, y: Float): Bool

Returns true if the polygon contains the point.

Name Type
polygon spine.support.utils.FloatArray
x Float
y Float
Returns
Bool

spine
intersectsSegment(x1: Float, y1: Float, x2: Float, y2: Float): spine.attachments.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.

Name Type
x1 Float
y1 Float
x2 Float
y2 Float
Returns
spine.attachments.BoundingBoxAttachment

spine
polygonIntersectsSegment(polygon: spine.support.utils.FloatArray, x1: Float, y1: Float, x2: Float, y2: Float): Bool

Returns true if the polygon contains any part of the line segment.

Name Type
polygon spine.support.utils.FloatArray
x1 Float
y1 Float
x2 Float
y2 Float
Returns
Bool

spine
getMinX(): Float

The left edge of the axis aligned bounding box.

Returns
Float

spine
getMinY(): Float

The bottom edge of the axis aligned bounding box.

Returns
Float

spine
getMaxX(): Float

The right edge of the axis aligned bounding box.

Returns
Float

spine
getMaxY(): Float

The top edge of the axis aligned bounding box.

Returns
Float

spine
getWidth(): Float

The width of the axis aligned bounding box.

Returns
Float

spine
getHeight(): Float

The height of the axis aligned bounding box.

Returns
Float

The visible bounding boxes.

Returns
spine.support.utils.Array<spine.attachments.BoundingBoxAttachment>

The world vertices for the bounding box polygons.

Returns
spine.support.utils.FloatArray2D

Returns the polygon for the specified bounding box, or null.

Name Type
boundingBox spine.attachments.BoundingBoxAttachment
Returns
spine.support.utils.FloatArray

spine
new(): Void

Private Members

spine
minX: Float

spine
minY: Float

spine
maxX: Float

spine
maxY: Float




spine
aabbCompute(): Void