15#ifndef OSGPARTICLE_EXPLOSIONOPERATOR
16#define OSGPARTICLE_EXPLOSIONOPERATOR
101 float length = dir.
length();
102 float distanceFromWave2 = (
_radius - length) * (
_radius - length);
119 float oneOverSigma = (
_sigma!=0.0f ? (1.0f /
_sigma) : 1.0f);
120 _inexp = -0.5f * oneOverSigma * oneOverSigma;
Vec3f Vec3
Definition Vec3:21
const double PI
Definition Math:30
The osgParticle library is a NodeKit that extends the core scene graph to support particle effects.
Definition AccelOperator:27
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
value_type length() const
Length of the vector = sqrt( vec .
Definition Vec3f:176
void setEpsilon(float eps)
Set the acceleration epsilon.
Definition ExplosionOperator:65
osg::Vec3 _xf_center
Definition ExplosionOperator:87
osg::Vec3 _center
Definition ExplosionOperator:86
void beginOperate(Program *prg)
Perform some initializations. Do not call this method manually.
Definition ExplosionOperator:108
float _radius
Definition ExplosionOperator:88
void setCenter(const osg::Vec3 &c)
Set the center of shock wave.
Definition ExplosionOperator:47
void setMagnitude(float mag)
Set the acceleration scale.
Definition ExplosionOperator:59
float _inexp
Definition ExplosionOperator:92
float _magnitude
Definition ExplosionOperator:89
const osg::Vec3 & getCenter() const
Get the center of shock wave.
Definition ExplosionOperator:50
virtual ~ExplosionOperator()
Definition ExplosionOperator:83
void setRadius(float r)
Set the radius of wave peak.
Definition ExplosionOperator:53
ExplosionOperator()
Definition ExplosionOperator:32
META_Object(osgParticle, ExplosionOperator)
void setSigma(float s)
Set broadness of the strength of the wave.
Definition ExplosionOperator:71
float _outexp
Definition ExplosionOperator:93
float getSigma() const
Get broadness of the strength of the wave.
Definition ExplosionOperator:74
float getRadius() const
Get the radius of wave peak.
Definition ExplosionOperator:56
float _sigma
Definition ExplosionOperator:91
ExplosionOperator & operator=(const ExplosionOperator &)
Definition ExplosionOperator:84
ExplosionOperator(const ExplosionOperator ©, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
Definition ExplosionOperator:38
float getEpsilon() const
Get the acceleration epsilon.
Definition ExplosionOperator:68
void operate(Particle *P, double dt)
Apply the acceleration to a particle. Do not call this method manually.
Definition ExplosionOperator:98
float getMagnitude() const
Get the acceleration scale.
Definition ExplosionOperator:62
float _epsilon
Definition ExplosionOperator:90
Operator()
Definition Operator:92
Implementation of a particle.
Definition Particle:47
void addVelocity(const osg::Vec3 &dv)
Add a vector to the velocity vector.
Definition Particle:493
const osg::Vec3 & getPosition() const
Get the position vector.
Definition Particle:403
@ RELATIVE_RF
Definition ParticleProcessor:42
ReferenceFrame getReferenceFrame() const
Get the reference frame.
Definition ParticleProcessor:179
osg::Vec3 transformLocalToWorld(const osg::Vec3 &P)
Transform a point from local to world coordinates (valid only during cull traversal).
Definition ParticleProcessor:305
An abstract ParticleProcessor descendant for modifying particles "on the fly" during the cull travers...
Definition Program:36