OpenSceneGraph
3.0.1
|
An explosion operator exerts force on each particle away from the explosion center. More...
Public Member Functions | |
ExplosionOperator () | |
ExplosionOperator (const ExplosionOperator ©, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY) | |
META_Object (osgParticle, ExplosionOperator) | |
void | setCenter (const osg::Vec3 &c) |
Set the center of shock wave. | |
const osg::Vec3 & | getCenter () const |
Get the center of shock wave. | |
void | setRadius (float r) |
Set the radius of wave peak. | |
float | getRadius () const |
Get the radius of wave peak. | |
void | setMagnitude (float mag) |
Set the acceleration scale. | |
float | getMagnitude () const |
Get the acceleration scale. | |
void | setEpsilon (float eps) |
Set the acceleration epsilon. | |
float | getEpsilon () const |
Get the acceleration epsilon. | |
void | setSigma (float s) |
Set broadness of the strength of the wave. | |
float | getSigma () const |
Get broadness of the strength of the wave. | |
void | operate (Particle *P, double dt) |
Apply the acceleration to a particle. Do not call this method manually. | |
void | beginOperate (Program *prg) |
Perform some initializations. Do not call this method manually. | |
Protected Member Functions | |
virtual | ~ExplosionOperator () |
ExplosionOperator & | operator= (const ExplosionOperator &) |
Protected Attributes | |
osg::Vec3 | _center |
osg::Vec3 | _xf_center |
float | _radius |
float | _magnitude |
float | _epsilon |
float | _sigma |
float | _inexp |
float | _outexp |
An explosion operator exerts force on each particle away from the explosion center.
Refer to David McAllister's Particle System API (http://www.particlesystems.org)
osgParticle::ExplosionOperator::ExplosionOperator | ( | ) | [inline] |
osgParticle::ExplosionOperator::ExplosionOperator | ( | const ExplosionOperator & | copy, |
const osg::CopyOp & | copyop = osg::CopyOp::SHALLOW_COPY |
||
) | [inline] |
virtual osgParticle::ExplosionOperator::~ExplosionOperator | ( | ) | [inline, protected, virtual] |
void osgParticle::ExplosionOperator::beginOperate | ( | Program * | prg | ) | [inline, virtual] |
Perform some initializations. Do not call this method manually.
Reimplemented from osgParticle::Operator.
References osgParticle::ParticleProcessor::getReferenceFrame(), _xf_center, osgParticle::ParticleProcessor::transformLocalToWorld(), _center, _sigma, _inexp, _outexp, and osg::PI.
const osg::Vec3& osgParticle::ExplosionOperator::getCenter | ( | ) | const [inline] |
Get the center of shock wave.
References _center.
float osgParticle::ExplosionOperator::getEpsilon | ( | ) | const [inline] |
Get the acceleration epsilon.
References _epsilon.
float osgParticle::ExplosionOperator::getMagnitude | ( | ) | const [inline] |
Get the acceleration scale.
References _magnitude.
float osgParticle::ExplosionOperator::getRadius | ( | ) | const [inline] |
Get the radius of wave peak.
References _radius.
float osgParticle::ExplosionOperator::getSigma | ( | ) | const [inline] |
Get broadness of the strength of the wave.
References _sigma.
osgParticle::ExplosionOperator::META_Object | ( | osgParticle | , |
ExplosionOperator | |||
) |
void osgParticle::ExplosionOperator::operate | ( | Particle * | P, |
double | dt | ||
) | [inline, virtual] |
Apply the acceleration to a particle. Do not call this method manually.
Implements osgParticle::Operator.
References osgParticle::Particle::getPosition(), _xf_center, osg::Vec3f::length(), _radius, _inexp, _outexp, _magnitude, _epsilon, and osgParticle::Particle::addVelocity().
ExplosionOperator& osgParticle::ExplosionOperator::operator= | ( | const ExplosionOperator & | ) | [inline, protected] |
void osgParticle::ExplosionOperator::setCenter | ( | const osg::Vec3 & | c | ) | [inline] |
Set the center of shock wave.
References _center.
void osgParticle::ExplosionOperator::setEpsilon | ( | float | eps | ) | [inline] |
Set the acceleration epsilon.
References _epsilon.
void osgParticle::ExplosionOperator::setMagnitude | ( | float | mag | ) | [inline] |
Set the acceleration scale.
References _magnitude.
void osgParticle::ExplosionOperator::setRadius | ( | float | r | ) | [inline] |
Set the radius of wave peak.
References _radius.
void osgParticle::ExplosionOperator::setSigma | ( | float | s | ) | [inline] |
Set broadness of the strength of the wave.
References _sigma.
osg::Vec3 osgParticle::ExplosionOperator::_center [protected] |
Referenced by setCenter(), getCenter(), and beginOperate().
float osgParticle::ExplosionOperator::_epsilon [protected] |
Referenced by setEpsilon(), getEpsilon(), and operate().
float osgParticle::ExplosionOperator::_inexp [protected] |
Referenced by operate(), and beginOperate().
float osgParticle::ExplosionOperator::_magnitude [protected] |
Referenced by setMagnitude(), getMagnitude(), and operate().
float osgParticle::ExplosionOperator::_outexp [protected] |
Referenced by operate(), and beginOperate().
float osgParticle::ExplosionOperator::_radius [protected] |
Referenced by setRadius(), getRadius(), and operate().
float osgParticle::ExplosionOperator::_sigma [protected] |
Referenced by setSigma(), getSigma(), and beginOperate().
osg::Vec3 osgParticle::ExplosionOperator::_xf_center [protected] |
Referenced by operate(), and beginOperate().
![]() | Generated at Mon Oct 3 2011 12:39:48 for the OpenSceneGraph by doxygen 1.7.5. |