MRSystem

MRSystem

The default representation of an MRSystem to be expanded upon by actual details ECS System items.

Kind: global class

mrSystem.MRSystem

Kind: instance class of MRSystem

new exports.MRSystem(useComponents, frameRate)

Constructor for MRSystem. Sets up appropriate document event listeners, component defaults, and system defaults that will be used for system runs ever frame.

Param Type Default Description
useComponents boolean true Default to true. Determines whether comonents need to be maintained (attached/updated/detached) with the system.
frameRate number Default to null. When set, used and updated as part of the System’s update function.

mrSystem.onRegister(app)

Called when a new entity is added to the scene

Kind: instance method of MRSystem

Param Type Description
app object the app the system is registered to.

mrSystem.onUnregister(app)

Called when the system is registered to an app is added.

Kind: instance method of MRSystem

Param Type Description
app object the app the system is registered to.

mrSystem._update(deltaTime, frame)

The actual system update call.

Kind: instance method of MRSystem

Param Type Description
deltaTime number given timestep to be used for any feature changes
frame object given frame information to be used for any feature changes

mrSystem.update(deltaTime, frame)

The generic system update call per render-frame.

Kind: instance method of MRSystem

Param Type Description
deltaTime number given timestep to be used for any feature changes
frame object given frame information to be used for any feature changes

mrSystem.eventUpdate()

An event triggered update, called when any global scene level events occur. See GLOBAL_UPDATE_EVENTS of MRSystem.js

Kind: instance method of MRSystem

mrSystem._onNewEntity(entity)

internal function, called when a new entity is added to the scene

Kind: instance method of MRSystem

Param Type Description
entity MREntity the entity being added.

mrSystem.onNewEntity(entity)

Called when a new entity is added to the scene

Kind: instance method of MRSystem

Param Type Description
entity MREntity the entity being added.

mrSystem._entityRemoved(entity)

internal function, called when a new entity is added to the scene

Kind: instance method of MRSystem

Param Type Description
entity MREntity the entity being added.

mrSystem.entityRemoved(entity)

Called when a new entity is added to the scene

Kind: instance method of MRSystem

Param Type Description
entity MREntity the entity being added.

mrSystem.attachedComponent(entity)

(async) Called when the entity component is initialized

Kind: instance method of MRSystem

Param Type Description
entity MREntity the entity being attached/initialized.

mrSystem.updatedComponent(entity, oldData)

Called when a specific entity component is being updated

Kind: instance method of MRSystem

Param Type Description
entity MREntity the entity being updated
oldData object the

mrSystem.detachedComponent(entity)

Called when the entity component is removed

Kind: instance method of MRSystem

Param Type Description
entity MREntity the entity component being removed.

mrSystem.onAttach(event)

(async) Handles the component and registry aspect of the event when an entity component attaches to this system.

Kind: instance method of MRSystem

Param Type Description
event object the attach event

mrSystem.onUpdate(event)

Handles the component and registry update of the even when an entity component needs to change.

Kind: instance method of MRSystem

Param Type Description
event object the update event

mrSystem.onDetach(event)

Handles the component and registry aspect of the even when an entity component detaches from this system.

Kind: instance method of MRSystem

Param Type Description
event object the detach event