Particle Class Reference

#include <Particle.h>

Inheritance diagram for Particle:
Entity

# 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 ParticleSpecparticleSpec
 ParticleSpec used to configure the particle.
VisualComponent visualComponent
 Cache the VisualComponent to bypass the ComponentManager's usage.

# Additional Inherited Members

- Private Member Functions inherited from Entity
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 TransformationgetTransformation ()
const Vector3DgetPosition ()
const RotationgetRotation ()
const ScalegetScale ()
Body getBody ()
bool isMoving ()
void stopAllMovement ()
 Stop all entity's movement.
void stopMovement (uint16 axis)
bool setVelocity (const Vector3D *velocity, bool checkIfCanMove)
const Vector3DgetVelocity ()
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 Vector3DgetDirection ()
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)
- Private Attributes inherited from Entity
VirtualListcomponents
 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

A Particle spec that is stored in ROM

Definition at line 58 of file Particle.h.

# Member Function Documentation

# collisionStarts()

bool Particle::collisionStarts ( const CollisionInformation * collisionInformation)
virtual

Process a newly detected collision by one of the component colliders.

Parameters
collisionInformationInformation 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
particleSpecSpecification 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()

uint32 Particle::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
animationNameAnimation to play

Definition at line 214 of file Particle.c.

# removedComponent()

void Particle::removedComponent ( Component component)
virtual

A component has been removed from this particle.

Parameters
componentRemoved 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
visualComponentSpecSpecification for a sprite to add to the particle
wireframeSpecSpecification 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
visualComponentSpecSpecification for a sprite to add to the particle
wireframeSpecSpecification for a wireframe to add to the particle
lifeSpanTime that the particle must live
positionStarting position
forceForce to apply
movementTypeMovement type on each axis
animationNameAnimation 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()

bool Particle::update ( uint32 elapsedTime)
virtual

Update the particle's state.

Parameters
elapsedTimeElapsed time since the last call

Definition at line 226 of file Particle.c.

# Member Data Documentation

# expired

bool Particle::expired
protected

If true the particle is set to be destroyed or recycled.

Definition at line 77 of file Particle.h.

# lifeSpan

int16 Particle::lifeSpan
protected

Remaining life span in milliseconds.

Definition at line 74 of file Particle.h.

# particleSpec

const ParticleSpec* Particle::particleSpec
protected

ParticleSpec used to configure the particle.

Definition at line 80 of file Particle.h.

# visualComponent

VisualComponent Particle::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: