RectangularTriggerRegion(size)

Class for representing a rectangular trigger region as an AABB.

new RectangularTriggerRegion(size)

Constructs a new rectangular trigger region with the given values.

Parameters:
Name Type Description
size Vector3

The size of the region.

Author:

Extends

Members

size :Vector3

The size of the region.

Methods

fromJSON(json) → {RectangularTriggerRegion}

Restores this instance from the given JSON object.

Parameters:
Name Type Description
json Object

The JSON object.

Returns:
RectangularTriggerRegion -

A reference to this trigger region.

Overrides:

toJSON() → {Object}

Transforms this instance into a JSON object.

Returns:
Object -

The JSON object.

Overrides:

touching(entity) → {Boolean}

Returns true if the bounding volume of the given game entity touches/intersects the trigger region.

Parameters:
Name Type Description
entity GameEntity

The entity to test.

Returns:
Boolean -

Whether this trigger touches the given game entity or not.

Overrides:

update(trigger) → {RectangularTriggerRegion}

Updates this trigger region.

Parameters:
Name Type Description
trigger Trigger

The trigger that owns this region.

Returns:
RectangularTriggerRegion -

A reference to this trigger region.

Overrides: