AnimationSystem
MRSystem
AnimationSystem ⇐ Handles specific needs for setting up the masking for all necessary items.
Kind: global class
Extends: MRSystem
- AnimationSystem ⇐
MRSystem
animationSystem.AnimationSystem
Kind: instance class of AnimationSystem
new exports.AnimationSystem()
AnimationSystem’s default constructor.
animationSystem.update(deltaTime, frame)
Updates each animation mixer in the registry. This function should be called within the main animation loop of the application. It iterates through all the animation mixers stored in the registry and updates them with the given deltaTime. The deltaTime parameter is typically the time elapsed since the last frame which is used to ensure smooth animation playback.
Kind: instance method of AnimationSystem
Param | Type | Description |
---|---|---|
deltaTime | number |
The time elapsed since the last update call, used to update the animation mixers. |
frame | object |
Additional frame information, not used in the current implementation but can be utilized for future enhancements. |
animationSystem.attachedComponent(entity)
(async) Called when the entity component is initialized
Kind: instance method of AnimationSystem
Param | Type | Description |
---|---|---|
entity | object |
the entity being attached/initialized. |
animationSystem.updatedComponent(entity)
Called when the entity component is updated
Kind: instance method of AnimationSystem
Param | Type | Description |
---|---|---|
entity | object |
the entity being updated based on the component. |
animationSystem.detachedComponent(entity)
Called when the entity component is detached
Kind: instance method of AnimationSystem
Param | Type | Description |
---|---|---|
entity | object |
the entity being updated based on the component being detached. |
animationSystem.onNewEntity(entity)
When the system swaps to a new entity, this handles setting up the animations for the system runs.
Kind: instance method of AnimationSystem
Param | Type | Description |
---|---|---|
entity | object |
given entity that might be handled by the system. |
animationSystem.setAnimation(entity, comp)
Sets the Animation of the entity object based on the component value associated with it. Otherwise lets those be handled by the threejs default setup. (Always looping, always playing based on browser type, etc).
Kind: instance method of AnimationSystem
Param | Type | Description |
---|---|---|
entity | object |
the entity being updated based on the component being detached. |
comp | object |
component that contains the values of ‘action’, ‘loop’, and/or ‘loopMode’ |