Individual particle of the particle system.
More...
#include <particles/Particle.h>
|
void | clear () |
| Delete all sprites, i.e. remove them from the scene. More...
|
|
float | dist (Particle &p) |
| Get distance between this and another particle. More...
|
|
const core::vector3df & | getPos () |
| Get current particle position. More...
|
|
| Particle () |
| Default constructor. More...
|
|
| Particle (scene::ISceneManager *mgr, s32 id, const core::vector3df &position, std::vector< video::ITexture * > &textures, int numSprites, float temp, video::SColor &color, float size, int lifetime, bool dynamicLights=false) |
| Constructor for particles with sprites. More...
|
|
| Particle (const core::vector3df &position, float temp, int lifetime) |
| Constructor for particles without sprites. More...
|
|
void | setColor (const video::SColor &c) |
| Set the color for all assigned sprites. More...
|
|
void | setSize (float sz) |
| Set the size for all assigned sprites. More...
|
|
void | setSmoke (float colorCoeff) |
|
void | setTexture (std::vector< video::ITexture * > &textures) |
|
void | updatePos (const core::vector3df &d) |
| Update particle position, including assigned sprites. More...
|
|
virtual | ~Particle () |
| Destructor. More...
|
|
Individual particle of the particle system.
Has a configurable number of sprites (display primitives) assigned to it.
Definition at line 29 of file Particle.h.
particles::Particle::Particle |
( |
| ) |
|
|
inline |
Default constructor.
Does nothing.
Definition at line 46 of file Particle.h.
particles::Particle::Particle |
( |
scene::ISceneManager * |
mgr, |
|
|
s32 |
id, |
|
|
const core::vector3df & |
position, |
|
|
std::vector< video::ITexture * > & |
textures, |
|
|
int |
numSprites, |
|
|
float |
temp, |
|
|
video::SColor & |
color, |
|
|
float |
size, |
|
|
int |
lifetime, |
|
|
bool |
dynamicLights = false |
|
) |
| |
Constructor for particles with sprites.
- Parameters
-
[in] | mgr | Pointer to irrlicht scene manager |
[in] | id | Particle ID |
[in] | position | Initial particle position |
[in] | texture | Texture to assign to sprites of this particle |
[in] | numSprites | Number of sprites assigned to each particle instance |
[in] | temp | Initial particle temperature |
[in] | color | Initial particle color |
[in] | lifetime | Particle lifetime (in timesteps) |
[in] | dynamicLights | Turn dynamic lighting on / off |
Definition at line 9 of file Particle.cpp.
References sprites_.
particles::Particle::Particle |
( |
const core::vector3df & |
position, |
|
|
float |
temp, |
|
|
int |
lifetime |
|
) |
| |
|
inline |
Constructor for particles without sprites.
- Parameters
-
[in] | position | Initial particle position |
[in] | temp | Initial particle temperature |
[in] | lifetime | Particle lifetime (in timesteps) |
Definition at line 77 of file Particle.h.
virtual particles::Particle::~Particle |
( |
| ) |
|
|
inlinevirtual |
Destructor.
Does nothing.
Definition at line 88 of file Particle.h.
void particles::Particle::clear |
( |
| ) |
|
|
inline |
Delete all sprites, i.e. remove them from the scene.
Definition at line 174 of file Particle.h.
float particles::Particle::dist |
( |
Particle & |
p | ) |
|
|
inline |
Get distance between this and another particle.
- Parameters
-
- Returns
- Distance between this and given particle
Definition at line 99 of file Particle.h.
References pos_.
const core::vector3df& particles::Particle::getPos |
( |
| ) |
|
|
inline |
Get current particle position.
- Returns
- Current particle position as vector
Definition at line 110 of file Particle.h.
void particles::Particle::setColor |
( |
const video::SColor & |
c | ) |
|
|
inline |
Set the color for all assigned sprites.
- Parameters
-
[in] | c | Color to assign to all assigned sprites |
Definition at line 135 of file Particle.h.
void particles::Particle::setSize |
( |
float |
sz | ) |
|
|
inline |
Set the size for all assigned sprites.
- Parameters
-
[in] | sz | Size to assign to all assigned sprites |
Definition at line 146 of file Particle.h.
void particles::Particle::setSmoke |
( |
float |
colorCoeff | ) |
|
|
inline |
void particles::Particle::setTexture |
( |
std::vector< video::ITexture * > & |
textures | ) |
|
|
inline |
void particles::Particle::updatePos |
( |
const core::vector3df & |
d | ) |
|
|
inline |
Update particle position, including assigned sprites.
- Parameters
-
[in] | d | Displacement vector by which particle is to be moved |
Definition at line 122 of file Particle.h.
References RAND1.
int particles::Particle::lifetime_ |
|
protected |
Current particle lifetime, decreased every timestep.
Definition at line 200 of file Particle.h.
core::vector3df particles::Particle::pos_ |
|
protected |
std::vector< scene::IBillboardSceneNode* > particles::Particle::sprites_ |
|
protected |
Vector of sprites (display primitives) assigned to this particle.
Definition at line 188 of file Particle.h.
Referenced by Particle().
float particles::Particle::temp_ |
|
protected |
Current particle temperature.
Definition at line 197 of file Particle.h.
The documentation for this class was generated from the following files: