|
Public Types |
enum | { INVALID_INDEX = -1
} |
enum | Shape {
POINT,
QUAD,
QUAD_TRIANGLESTRIP,
HEXAGON,
LINE
} |
Public Member Functions |
| Particle () |
Shape | getShape () const |
| Get the shape of the particle.
|
void | setShape (Shape s) |
| Set the shape of the particle.
|
bool | isAlive () const |
| Get whether the particle is still alive.
|
double | getLifeTime () const |
| Get the life time of the particle (in seconds).
|
double | getAge () const |
| Get the age of the particle (in seconds).
|
const rangef & | getSizeRange () const |
| Get the minimum and maximum values for polygon size.
|
const rangef & | getAlphaRange () const |
| Get the minimum and maximum values for alpha.
|
const rangev4 & | getColorRange () const |
| Get the minimum and maximum values for color.
|
const Interpolator * | getSizeInterpolator () const |
| Get the interpolator for computing the size of polygons.
|
const Interpolator * | getAlphaInterpolator () const |
| Get the interpolator for computing alpha values.
|
const Interpolator * | getColorInterpolator () const |
| Get the interpolator for computing color values.
|
float | getRadius () const |
float | getMass () const |
float | getMassInv () const |
| Get 1 / getMass() .
|
const osg::Vec3 & | getPosition () const |
| Get the position vector.
|
const osg::Vec3 & | getVelocity () const |
const osg::Vec3 & | getPreviousPosition () const |
| Get the previous position (the position before last update).
|
const osg::Vec3 & | getAngle () const |
| Get the angle vector.
|
const osg::Vec3 & | getAngularVelocity () const |
| Get the rotational velocity vector.
|
const osg::Vec3 & | getPreviousAngle () const |
| Get the previous angle vector.
|
const osg::Vec4 & | getCurrentColor () const |
| Get the current color.
|
float | getCurrentAlpha () const |
| Get the current alpha.
|
const float | getSTexCoord () const |
| Get the s texture coordinate of the bottom left of the particle.
|
float | getTCoord () const |
| Get the t texture coordinate of the bottom left of the particle.
|
int | getTileS () const |
| Get width of texture tile.
|
int | getTileT () const |
| Get height of texture tile.
|
int | getNumTiles () const |
| Get number of texture tiles.
|
void | kill () |
void | setLifeTime (double t) |
| Set the life time of the particle.
|
void | setSizeRange (const rangef &r) |
| Set the minimum and maximum values for polygon size.
|
void | setAlphaRange (const rangef &r) |
| Set the minimum and maximum values for alpha.
|
void | setColorRange (const rangev4 &r) |
| Set the minimum and maximum values for color.
|
void | setSizeInterpolator (Interpolator *ri) |
| Set the interpolator for computing size values.
|
void | setAlphaInterpolator (Interpolator *ai) |
| Set the interpolator for computing alpha values.
|
void | setColorInterpolator (Interpolator *ci) |
| Set the interpolator for computing color values.
|
void | setRadius (float r) |
void | setMass (float m) |
void | setPosition (const osg::Vec3 &p) |
| Set the position vector.
|
void | setVelocity (const osg::Vec3 &v) |
void | addVelocity (const osg::Vec3 &dv) |
| Add a vector to the velocity vector.
|
void | transformPositionVelocity (const osg::Matrix &xform) |
| Transform position and velocity vectors by a matrix.
|
void | transformPositionVelocity (const osg::Matrix &xform1, const osg::Matrix &xform2, float r) |
| Transform position and velocity vectors by a combination of two matrices.
|
void | setAngle (const osg::Vec3 &a) |
| Set the angle vector.
|
void | setAngularVelocity (const osg::Vec3 &v) |
void | addAngularVelocity (const osg::Vec3 &dv) |
| Add a vector to the angular velocity vector.
|
void | transformAngleVelocity (const osg::Matrix &xform) |
| Transform angle and angularVelocity vectors by a matrix.
|
bool | update (double dt) |
void | beginRender () const |
| Perform some pre-rendering tasks. Called automatically by particle systems.
|
void | render (const osg::Vec3 &xpos, const osg::Vec3 &px, const osg::Vec3 &py, float scale=1.0f) const |
| Render the particle. Called automatically by particle systems.
|
void | endRender () const |
| Perform some post-rendering tasks. Called automatically by particle systems.
|
float | getCurrentSize () const |
| Get the current (interpolated) polygon size. Valid only after the first call to update().
|
void | setTextureTile (int sTile, int tTile, int numTiles=0) |
| Specify how the particle texture is tiled.
|
void | setPreviousParticle (int previous) |
| Set the previous particle.
|
int | getPreviousParticle () const |
| Get the previous particle.
|
void | setNextParticle (int next) |
| Set the next particle.
|
int | getNextParticle () const |
| Get the const next particle.
|
void | setUpTexCoordsAsPartOfConnectedParticleSystem (ParticleSystem *ps) |
| Method for initializing a particles texture coords as part of a connected particle system.
|
Protected Attributes |
Shape | _shape |
rangef | _sr |
rangef | _ar |
rangev4 | _cr |
osg::ref_ptr< Interpolator > | _si |
osg::ref_ptr< Interpolator > | _ai |
osg::ref_ptr< Interpolator > | _ci |
bool | _alive |
bool | _mustdie |
double | _lifeTime |
float | _radius |
float | _mass |
float | _massinv |
osg::Vec3 | _prev_pos |
osg::Vec3 | _position |
osg::Vec3 | _velocity |
osg::Vec3 | _prev_angle |
osg::Vec3 | _angle |
osg::Vec3 | _angul_arvel |
double | _t0 |
float | _current_size |
float | _current_alpha |
osg::Vec4 | _current_color |
float | _s_tile |
float | _t_tile |
int | _num_tile |
int | _cur_tile |
float | _s_coord |
float | _t_coord |
int | _previousParticle |
int | _nextParticle |