API Reference

Class List

pc.ZoneComponent

Extends: pc.Component

The ZoneComponent allows you to define an area in world space of certain size. This can be used in various ways, such as affecting audio reverb when audiolistener is within zone. Or create culling system with portals between zones to hide whole indoor sections for performance reasons. And many other possible options. Zones are building blocks and meant to be used in many different ways.

Summary

Events

disableFired when Component becomes disabled Note: this event does not takes in account entity or any of its parent enabled state
enableFired when Component becomes enabled Note: this event does not takes in account entity or any of its parent enabled state
removeFired when a zone is removed from an entity
stateFired when Component changes state to enabled or disabled Note: this event does not takes in account entity or any of its parent enabled state

Inherited

Properties

enabledEnables or disables the component.

Details

Constructor

ZoneComponent(system, size)

Parameters

systempc.ZoneComponentSystemThe ComponentSystem that created this Component
sizepc.Vec3The Size of Box of a Zone.

Events

disable

Fired when Component becomes disabled Note: this event does not takes in account entity or any of its parent enabled state

enable

Fired when Component becomes enabled Note: this event does not takes in account entity or any of its parent enabled state

remove

Fired when a zone is removed from an entity

state

Fired when Component changes state to enabled or disabled Note: this event does not takes in account entity or any of its parent enabled state

Parameters

enabledBooleanTrue if now enabled, False if disabled

Inherited

Properties

Booleanenabled

Enables or disables the component.