OrientedBounds

class OrientedBounds

An oriented bounding box is a rotated rectangle.

An oriented bounding box is modelled by rotating its (axis-aligned) OrientedBounds#innerBounds by an angle OrientedBounds#angle around its center. The center of an oriented bounding box and its axis-aligned inner-bounds coincide.

Constructor


new OrientedBounds(innerBounds: number | AxisAlignedBounds, angle: number) → {}
Parameters:
Name Type Default Description
innerBounds number | AxisAlignedBounds 0
angle number 0
new OrientedBounds(x: number, y: number, width: number, height: number, angle: number) → {}
Parameters:
Name Type Attributes Description
x number

<optional>

y number

<optional>

width number

<optional>

height number

<optional>

angle number

<optional>

Summary


Properties from OrientedBounds

PIXI.Point
bottomLeft

The bottom-left corner of this bounding box. The returned instance should not be modified directly.

PIXI.Point
bottomRight

The bottom-right corner of this bounding box. The returned instance should not be modified directly.

PIXI.Point
center

The center of this bounding box.

[PIXI.Point, PIXI.Point, PIXI.Point, PIXI.Point]
hull

The four-corners of this bounding, in clockwise order starting from the top-left.

innerBounds

The unrotated version of this bounding box.

number
rotation

The angle, in radians, by which this bounding box is tilted.

PIXI.Point
topLeft

The top-left corner of this bounding box. The returned instance should not be modified directly.

PIXI.Point
topRight

The top-right corner of this bounding box. The returned instance should not be modified directly.

Methods from OrientedBounds

boolean
contains(point: PIXI.Point | number)

Whether this bounding box contains the given point

this
copyFrom(bounds: OrientedBounds)

Copies bounds into this instance.

boolean
equals(bounds: OrientedBounds)

Checks whether the given bounds are equal to this.

boolean
protected isDirty()

Whether any internal state needs to be recalculated.

void
protected update()

Public Properties


bottomLeft OrientedBounds.ts:146
bottomLeft: PIXI.Point

The bottom-left corner of this bounding box. The returned instance should not be modified directly.

bottomRight OrientedBounds.ts:136
bottomRight: PIXI.Point

The bottom-right corner of this bounding box. The returned instance should not be modified directly.

center OrientedBounds.ts:82
center: PIXI.Point

The center of this bounding box.

The center of this and this.innerBounds will always coincide.

hull OrientedBounds.ts:100
hull: [PIXI.Point, PIXI.Point, PIXI.Point, PIXI.Point]

The four-corners of this bounding, in clockwise order starting from the top-left.

innerBounds OrientedBounds.ts:54
innerBounds

The unrotated version of this bounding box.

rotation OrientedBounds.ts:68
rotation: number

The angle, in radians, by which this bounding box is tilted.

topLeft OrientedBounds.ts:112
topLeft: PIXI.Point

The top-left corner of this bounding box. The returned instance should not be modified directly.

topRight OrientedBounds.ts:124
topRight: PIXI.Point

The top-right corner of this bounding box. The returned instance should not be modified directly.

Public Methods


contains OrientedBounds.ts:169
contains(point: PIXI.Point | number) → {boolean}

Whether this bounding box contains the given point

Parameters:
Name Type Description
point PIXI.Point | number
Returns:
Type Description
boolean
copyFrom OrientedBounds.ts:187
copyFrom(bounds: OrientedBounds) → {this}

Copies bounds into this instance.

Parameters:
Name Type Description
bounds OrientedBounds
Returns:
Type Description
this
equals OrientedBounds.ts:156
equals(bounds: OrientedBounds) → {boolean}

Checks whether the given bounds are equal to this.

Parameters:
Name Type Description
bounds OrientedBounds
Returns:
Type Description
boolean

Protected Methods


isDirty OrientedBounds.ts:201
protected isDirty() → {boolean}

Whether any internal state needs to be recalculated.

Returns:
Type Description
boolean
update OrientedBounds.ts:209
protected update() → {void}

This will recalculate the center, orientation matrix, and the hull vertices. It should be called only if this.isDirty returns true.

Returns:
Type Description
void

Powered by webdoc!