An oriented box: axis-aligned by default, or rotated about the vertical axis by heading.

The natural shape for building interiors, garages and parking bays, where an axis-aligned bounding box would either miss corners or spill into the street. Give it the same heading as the building and the fit is exact.

size is the full extent along each axis, not the half-extent — a size of (4, 8, 3) is 4 m wide, 8 m deep and 3 m tall.

Constructor

@:value({ heading : 0 })new(center:Vector3, size:Vector3, heading:Float = 0, ?id:String)

Variables

heading:Float

Rotation about the Z axis in degrees, using the same convention as entity headings.

size:Vector3

Full width, depth and height.

Methods

cacheRotation():Void

Recomputes the cached rotation. Call this after assigning heading directly; the constructor and rotateTo do it for you.

rotateTo(degrees:Float):Void

Inherited Variables

Defined by ColShape

center:Vector3

The shape's centre point.

data:Dynamic

Arbitrary user data carried along with the shape.

read onlyid:String

An identifier for this shape, useful for keying zone state. Assigned automatically if not given.

Inherited Methods

Defined by ColShape

inlinemightContain(point:Vector3):Bool

A cheap conservative test: false means point is definitely outside, true means contains is worth calling.