ParticleSystem Class Reference
#include <ParticleSystem.h>
# Public Types | |
| typedef const ParticleSystemSpec | ParticleSystemROMSpec |
# Public Member Functions | |
| void | constructor (const ParticleSystemSpec *particleSystemSpec, int16 internalId, const char *const name) |
| override void | show () |
| Make this instance visible. | |
| override void | hide () |
| Make this instance invisible. | |
| override void | update () |
| Update this instance's logic. | |
| override void | suspend () |
| Prepare to suspend this instance's logic. | |
| override void | resume () |
| Prepare to resume this instance's logic. | |
| override void | setTransparency (uint8 transparency) |
| override void | setSpec (void *particleSystemSpec) |
| void | start () |
| Start spawning particles. | |
| void | pause () |
| Pause the spawning of particles. | |
| void | unpause () |
| Resume the spawning of particles. | |
| bool | isPaused () |
| void | deleteAllParticles () |
| Delete all spawned particles. | |
| void | setLoop (bool loop) |
| bool | getLoop () |
| void | setSelfDestroyWhenDone (bool selfDestroyWhenDone) |
| void | setElapsedTime (uint32 elapsedTime) |
| void | print (int16 x, int16 y) |
| virtual void | particleSpawned (Particle particle) |
| virtual void | particleRecycled (Particle particle) |
# Protected Attributes | |
| VirtualList | particles |
| Linked list of particles. | |
| Vector3D | spawnPositionDisplacement |
| Range for random displacement upon particle spawning. | |
| Vector3D | spawnForceDelta |
| uint32 | elapsedTime |
| Elapsed time per tick. | |
| int32 | nextSpawnTime |
| Time when the next particle has to be spawned. | |
| int8 | numberOfVisualComponentSpecs |
| Number of available visual component specs for particles. | |
| int8 | numberOfWireframeSpecs |
| Number of available wireframes specs for particles. | |
| int8 | aliveParticlesCount |
| Number of alive particles. | |
| int8 | totalSpawnedParticles |
| Counter of total spawned particles. | |
| uint8 | maximumNumberOfAliveParticles |
| Maximum number of alive particles at any given moment. | |
| bool | paused |
| Flag to pause the generation of particles. | |
| bool | loop |
| bool | selfDestroyWhenDone |
| bool | applyForceToParticles |
| Flag to prevent computing force when not necessary. | |
# Additional Inherited Members | |
Private Types inherited from Actor | |
| typedef const ActorSpec | ActorROMSpec |
| typedef const PositionedActor | PositionedActorROMSpec |
Private Member Functions inherited from Actor | |
| void | constructor (const ActorSpec *actorSpec, int16 internalId, const char *const name) |
| override bool | onEvent (ListenerObject eventFirer, uint16 eventCode) |
| override void | createComponents (ComponentSpec **componentSpecs) |
| override void | destroyComponents () |
| Destroy the components that attach to this actor. | |
| override void | calculateSize () |
| Configure the actor's size. | |
| override fixed_t | getRadius () |
| override uint32 | getInGameType () |
| override void | ready (bool recursive) |
| override void | handleCommand (int32 command, va_list args) |
| override bool | handlePropagatedString (const char *string) |
| const ActorSpec * | getSpec () |
| ActorFactory | getActorFactory () |
| Actor | spawnChildActor (const PositionedActor *const positionedActor) |
| void | addChildActors (const PositionedActor *childrenSpecs) |
| void | addChildActorsDeferred (const PositionedActor *childrenSpecs) |
| fixed_t | getWidth () |
| fixed_t | getHeight () |
| fixed_t | getDepth () |
| bool | isInCameraRange (int16 padding, bool recursive) |
| void | playAnimation (const char *animationName) |
| void | pauseAnimation (bool pause) |
| void | stopAnimation () |
| Stop any playing animation if any. | |
| bool | isPlaying () |
| bool | isPlayingAnimation (char *animationName) |
| const char * | getPlayingAnimationName () |
| void | setActualFrame (int16 frame) |
| void | nextFrame () |
| Skip the currently playing animation to the next frame. | |
| void | previousFrame () |
| Rewind the currently playing animation to the previous frame. | |
| int16 | getActualFrame () |
| int32 | getNumberOfFrames () |
| virtual void | setExtraInfo (void *extraInfo) |
| virtual bool | alwaysStreamIn () |
Static Private Member Functions inherited from Actor | |
| static Actor | createActor (const PositionedActor *const positionedActor, int16 internalId) |
| static Actor | createActorDeferred (const PositionedActor *const positionedActor, int16 internalId) |
| static RightBox | getRightBoxFromSpec (const PositionedActor *positionedActor, const Vector3D *environmentPosition) |
| static bool | isInsideFrustrum (Vector3D vector3D, RightBox rightBox) |
Private Attributes inherited from Actor | |
| Size | size |
| ActorFactory | actorFactory |
| Factory to create this actor's children. | |
| const ActorSpec * | actorSpec |
| Pointer to the spec that defines how to initialize the actor. | |
| Vector3D * | centerDisplacement |
| const char * | playingAnimationName |
# Detailed Description
Class ParticleSystem
Inherits from Actor
Implements an actor that generates particles.
Definition at line 90 of file ParticleSystem.h.
# Member Typedef Documentation
# ParticleSystemROMSpec
| typedef const ParticleSystemSpec ParticleSystemROMSpec |
A ParticleSystem spec that is stored in ROM
Definition at line 79 of file ParticleSystem.h.
# Member Function Documentation
# constructor()
| void ParticleSystem::constructor | ( | const ParticleSystemSpec * | particleSystemSpec, |
| int16 | internalId, | ||
| const char *const | name ) |
Class' constructor
- Parameters
-
particleSystemSpec Specification that determines how to configure the particle system internalId ID to internally identify this instance name Instance's name
Definition at line 36 of file ParticleSystem.c.
# deleteAllParticles()
| void ParticleSystem::deleteAllParticles | ( | ) |
Delete all spawned particles.
Definition at line 346 of file ParticleSystem.c.
# getLoop()
| bool ParticleSystem::getLoop | ( | ) |
Check the looping behavior of the particle system.
- Returns
- False if the spawning or particles stops once the total number of spawned particles equals the maximum number of alive particles
Definition at line 365 of file ParticleSystem.c.
# hide()
|
virtual |
Make this instance invisible.
Reimplemented from Container.
Definition at line 103 of file ParticleSystem.c.
# isPaused()
| bool ParticleSystem::isPaused | ( | ) |
Check if the spawning of particles is paused.
- Returns
- True if the spawning of particles is paused; false otherwise
Definition at line 339 of file ParticleSystem.c.
# particleRecycled()
|
virtual |
Informs itself when a particle is recycled.
- Parameters
-
particle The recycled particle
Definition at line 405 of file ParticleSystem.c.
# particleSpawned()
|
virtual |
Informs itself when a particle is spawned.
- Parameters
-
particle The newly spawned particle
Definition at line 400 of file ParticleSystem.c.
# pause()
| void ParticleSystem::pause | ( | ) |
Pause the spawning of particles.
Definition at line 319 of file ParticleSystem.c.
# print()
Print the particle system's status.
- Parameters
-
x Screen x coordinate where to print y Screen y coordinate where to print
Definition at line 386 of file ParticleSystem.c.
# resume()
|
virtual |
Prepare to resume this instance's logic.
Reimplemented from Actor.
Definition at line 257 of file ParticleSystem.c.
# setElapsedTime()
| void ParticleSystem::setElapsedTime | ( | uint32 | elapsedTime | ) |
Set the elapsed time between calls to the update method.
- Parameters
-
elapsedTime Elapsed time between calls to the update method
Definition at line 379 of file ParticleSystem.c.
# setLoop()
| void ParticleSystem::setLoop | ( | bool | loop | ) |
Set the looping behavior of the particle system.
- Parameters
-
loop If false, the spawning or particles stops once the total number of spawned particles equals the maximum number of alive particles
Definition at line 358 of file ParticleSystem.c.
# setSelfDestroyWhenDone()
| void ParticleSystem::setSelfDestroyWhenDone | ( | bool | selfDestroyWhenDone | ) |
Set the particle system to auto destroy or not when the total number of spawned particles equals the maximum number of alive particles.
- Parameters
-
selfDestroyWhenDone If true, the particle system auto destroys when the total number of spawned particles equals the maximum number of alive particles.
Definition at line 372 of file ParticleSystem.c.
# setSpec()
|
virtual |
Set the particle systems's spec.
- Parameters
-
particleSystemSpec Specification that determines how to configure the particle system
Reimplemented from Actor.
Definition at line 296 of file ParticleSystem.c.
# setTransparency()
|
virtual |
Set this instance's transparency effects.
- Parameters
-
transparency Transparecy effect (__TRANSPARENCY_NONE, __TRANSPARENCY_EVEN or __TRANSPARENCY_ODD)
Reimplemented from Container.
Definition at line 279 of file ParticleSystem.c.
# show()
|
virtual |
Make this instance visible.
Reimplemented from Container.
Definition at line 74 of file ParticleSystem.c.
# start()
| void ParticleSystem::start | ( | ) |
Start spawning particles.
Definition at line 309 of file ParticleSystem.c.
# suspend()
|
virtual |
Prepare to suspend this instance's logic.
Reimplemented from Actor.
Definition at line 238 of file ParticleSystem.c.
# unpause()
| void ParticleSystem::unpause | ( | ) |
Resume the spawning of particles.
Definition at line 326 of file ParticleSystem.c.
# update()
|
virtual |
Update this instance's logic.
Reimplemented from Container.
Definition at line 125 of file ParticleSystem.c.
# Member Data Documentation
# aliveParticlesCount
|
protected |
Number of alive particles.
Definition at line 117 of file ParticleSystem.h.
# applyForceToParticles
|
protected |
Flag to prevent computing force when not necessary.
Definition at line 137 of file ParticleSystem.h.
# elapsedTime
|
protected |
Elapsed time per tick.
Definition at line 105 of file ParticleSystem.h.
# loop
|
protected |
If false, the spawning or particles stops once the total number of spawned particles equals the maximum number of alive particles
Definition at line 130 of file ParticleSystem.h.
# maximumNumberOfAliveParticles
|
protected |
Maximum number of alive particles at any given moment.
Definition at line 123 of file ParticleSystem.h.
# nextSpawnTime
|
protected |
Time when the next particle has to be spawned.
Definition at line 108 of file ParticleSystem.h.
# numberOfVisualComponentSpecs
|
protected |
Number of available visual component specs for particles.
Definition at line 111 of file ParticleSystem.h.
# numberOfWireframeSpecs
|
protected |
Number of available wireframes specs for particles.
Definition at line 114 of file ParticleSystem.h.
# particles
|
protected |
Linked list of particles.
Definition at line 95 of file ParticleSystem.h.
# paused
|
protected |
Flag to pause the generation of particles.
Definition at line 126 of file ParticleSystem.h.
# selfDestroyWhenDone
|
protected |
If true, the particle system auto destroys when the total number of spawned particles equals the maximum number of alive particles
Definition at line 134 of file ParticleSystem.h.
# spawnForceDelta
|
protected |
Range for random force delta to be adde to the force applied to newly spawned particles
Definition at line 102 of file ParticleSystem.h.
# spawnPositionDisplacement
|
protected |
Range for random displacement upon particle spawning.
Definition at line 98 of file ParticleSystem.h.
# totalSpawnedParticles
|
protected |
Counter of total spawned particles.
Definition at line 120 of file ParticleSystem.h.
The documentation for this class was generated from the following files:
- VUEngine-Core/source/Entity/Container/Actor/ParticleSystem/ParticleSystem.h
- VUEngine-Core/source/Entity/Container/Actor/ParticleSystem/ParticleSystem.c
Private Types inherited from