Particle Class Reference
#include <Particle.h>
![](../class_particle.png)
# Public Types | |
typedef const ParticleSpec | ParticleROMSpec |
# Public Member Functions | |
void | constructor (const ParticleSpec *particleSpec) |
override void | removedComponent (Component component) |
override bool | collisionStarts (const CollisionInformation *collisionInformation) |
override uint32 | getInGameType () |
void | setup (const ComponentSpec *visualComponentSpec, const ComponentSpec *physicsComponentSpec, const ComponentSpec *colliderComponentSpec, int16 lifeSpan, const Vector3D *position, const Vector3D *force, uint32 movementType) |
void | resume (const ComponentSpec *visualComponentSpec) |
void | suspend () |
Prepares the particle to become inactive in this state. | |
void | expire () |
Force the particle to expire. | |
bool | isVisible () |
void | playAnimation (const char *animationName) |
virtual bool | update (uint32 elapsedTime) |
# Protected Attributes | |
int16 | lifeSpan |
Remaining life span in milliseconds. | |
bool | expired |
If true the particle is set to be destroyed or recycled. | |
const ParticleSpec * | particleSpec |
ParticleSpec used to configure the particle. | |
VisualComponent | visualComponent |
Cache the VisualComponent to bypass the ComponentManager's usage. |
# Additional Inherited Members | |
![]() | |
void | constructor () |
Class' constructor. | |
override bool | handleMessage (Telegram telegram) |
void | clearComponentLists (uint32 componentType) |
Component | addComponent (const ComponentSpec *componentSpec) |
void | removeComponent (Component component) |
void | addComponents (ComponentSpec **componentSpecs, uint32 componentType) |
void | removeComponents (uint32 componentType) |
Component | getComponentAtIndex (uint32 componentType, int16 componentIndex) |
VirtualList | getComponents (uint32 componentType) |
bool | getComponentsOfClass (ClassPointer classPointer, VirtualList components, uint32 componentType) |
uint16 | getComponentsCount (uint32 componentType) |
void | resetComponents () |
Reset components. | |
void | setVisible () |
Set this instance's visibility flag up. | |
const Transformation * | getTransformation () |
const Vector3D * | getPosition () |
const Rotation * | getRotation () |
const Scale * | getScale () |
Body | getBody () |
bool | isMoving () |
void | stopAllMovement () |
Stop all entity's movement. | |
void | stopMovement (uint16 axis) |
bool | setVelocity (const Vector3D *velocity, bool checkIfCanMove) |
const Vector3D * | getVelocity () |
fixed_t | getSpeed () |
fixed_t | getMaximumSpeed () |
fixed_t | getBounciness () |
fixed_t | getFrictionCoefficient () |
void | enableCollisions () |
Enable collision detection on the entity's colliders. | |
void | disableCollisions () |
Disable collision detection on the entity's colliders. | |
void | checkCollisions (bool activate) |
void | registerCollisions (bool activate) |
void | setCollidersLayers (uint32 layers) |
uint32 | getCollidersLayers () |
void | setCollidersLayersToIgnore (uint32 layersToIgnore) |
uint32 | getCollidersLayersToIgnore () |
bool | hasColliders () |
void | showColliders () |
Make the entity's colliders visible. | |
void | hideColliders () |
Make the entity's colliders invisible. | |
virtual void | createComponents (ComponentSpec **componentSpecs) |
virtual void | destroyComponents () |
Destroy the components that attach to this container. | |
virtual void | addedComponent (Component component) |
virtual void | show () |
Make this instance visible. | |
virtual void | hide () |
Make this instance invisible. | |
virtual void | setTransparency (uint8 transparency) |
virtual void | calculateSize () |
Configure the entity's size. | |
virtual fixed_t | getRadius () |
virtual void | setPosition (const Vector3D *position) |
virtual void | setRotation (const Rotation *rotation) |
virtual void | setScale (const Scale *scale) |
virtual void | setDirection (const Vector3D *direction) |
virtual const Vector3D * | getDirection () |
virtual bool | applyForce (const Vector3D *force, bool checkIfCanMove) |
virtual bool | canMoveTowards (Vector3D direction) |
virtual bool | isSensibleToCollidingObjectBouncinessOnCollision (Entity collidingEntity) |
virtual bool | isSensibleToCollidingObjectFrictionOnCollision (Entity collidingEntity) |
virtual bool | isSubjectToGravity (Vector3D gravity) |
virtual void | collisionPersists (const CollisionInformation *collisionInformation) |
virtual void | collisionEnds (const CollisionInformation *collisionInformation) |
![]() | |
VirtualList * | components |
Linked list of attached components. | |
Transformation | transformation |
3D transformation | |
Body | body |
bool | isVisible |
Flag used for streaming purposes. |
# Detailed Description
Class Particle
Inherits from Entity
Implements a particle that is spawned by particle systems.
Definition at line 69 of file Particle.h.
# Member Typedef Documentation
# ParticleROMSpec
typedef const ParticleSpec ParticleROMSpec |
A Particle spec that is stored in ROM
Definition at line 58 of file Particle.h.
# Member Function Documentation
# collisionStarts()
|
virtual |
Process a newly detected collision by one of the component colliders.
- Parameters
-
collisionInformation Information struct about the collision to resolve
Reimplemented from Entity.
Definition at line 78 of file Particle.c.
# constructor()
void Particle::constructor | ( | const ParticleSpec * | particleSpec | ) |
Class' constructor
- Parameters
-
particleSpec Specification that determines how to configure the particle
Definition at line 36 of file Particle.c.
# expire()
void Particle::expire | ( | ) |
Force the particle to expire.
Definition at line 167 of file Particle.c.
# getInGameType()
|
virtual |
Retrieve the enum that determines the type of game object.
- Returns
- The enum that determines the type of game object
Reimplemented from Entity.
Definition at line 71 of file Particle.c.
# isVisible()
bool Particle::isVisible | ( | ) |
Check if the visual components are visible.
- Returns
- True if the the particle's sprite or wireframe are visible; false otherwise
Definition at line 179 of file Particle.c.
# playAnimation()
void Particle::playAnimation | ( | const char * | animationName | ) |
Play an animation.
- Parameters
-
animationName Animation to play
Definition at line 214 of file Particle.c.
# removedComponent()
|
virtual |
A component has been removed from this particle.
- Parameters
-
component Removed component
Reimplemented from Entity.
Definition at line 61 of file Particle.c.
# resume()
void Particle::resume | ( | const ComponentSpec * | visualComponentSpec | ) |
Configure the particle with the provided arguments after unpausing the game.
- Parameters
-
visualComponentSpec Specification for a sprite to add to the particle wireframeSpec Specification for a wireframe to add to the particle
Definition at line 150 of file Particle.c.
# setup()
void Particle::setup | ( | const ComponentSpec * | visualComponentSpec, |
const ComponentSpec * | physicsComponentSpec, | ||
const ComponentSpec * | colliderComponentSpec, | ||
int16 | lifeSpan, | ||
const Vector3D * | position, | ||
const Vector3D * | force, | ||
uint32 | movementType ) |
Configure the particle with the provided arguments.
- Parameters
-
visualComponentSpec Specification for a sprite to add to the particle wireframeSpec Specification for a wireframe to add to the particle lifeSpan Time that the particle must live position Starting position force Force to apply movementType Movement type on each axis animationName Animation to play
Definition at line 93 of file Particle.c.
# suspend()
void Particle::suspend | ( | ) |
Prepares the particle to become inactive in this state.
Definition at line 157 of file Particle.c.
# update()
Update the particle's state.
- Parameters
-
elapsedTime Elapsed time since the last call
Definition at line 226 of file Particle.c.
# Member Data Documentation
# expired
|
protected |
If true the particle is set to be destroyed or recycled.
Definition at line 77 of file Particle.h.
# lifeSpan
|
protected |
Remaining life span in milliseconds.
Definition at line 74 of file Particle.h.
# particleSpec
|
protected |
ParticleSpec used to configure the particle.
Definition at line 80 of file Particle.h.
# visualComponent
|
protected |
Cache the VisualComponent to bypass the ComponentManager's usage.
Definition at line 83 of file Particle.h.
The documentation for this class was generated from the following files:
- VUEngine-Core/source/Entity/Particle/Particle.h
- VUEngine-Core/source/Entity/Particle/Particle.c