SphericalTriggerRegion(radius)

Class for representing a spherical trigger region as a bounding sphere.

new SphericalTriggerRegion(radius)

Constructs a new spherical trigger region.

Parameters:
Name Type Default Description
radius Number 0

The radius of the region.

Author:

Extends

Members

radius :Number

The radius of the region.

Default Value:
  • 0

Methods

fromJSON(json) → {SphericalTriggerRegion}

Restores this instance from the given JSON object.

Parameters:
Name Type Description
json Object

The JSON object.

Returns:
SphericalTriggerRegion -

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) → {SphericalTriggerRegion}

Updates this trigger region.

Parameters:
Name Type Description
trigger Trigger

The trigger that owns this region.

Returns:
SphericalTriggerRegion -

A reference to this trigger region.

Overrides: