A shooter class that shoots particles radially with a Gaussian distribution (selected for speed or lifetime).
More...
Public Member Functions |
| | DtGaussShooter () |
| | Default CTOR.
|
| | DtGaussShooter (const DtGaussShooter ©, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY) |
| | Copy CTOR.
|
| | META_Object (osgParticle, DtGaussShooter) |
| void | setDistributionType (DistributionType distType) |
| | Set the property type that has a Gaussian distribution applied.
|
| DistributionType | distributionType () const |
| | Get the property type that has a Gaussian distribution applied.
|
| void | setOneSigmaDistance (const osg::Vec3d &dist) |
| | Set the one-sigma distance per orthogonal direction.
|
| const osg::Vec3d & | oneSigmaDistance () const |
| | Get the one-sigma distance per orthogonal direction.
|
| void | setPhiRange (const osgParticle::rangef &range) |
| | Set the range of possible values for phi angle.
|
| void | setPhiRange (float min, float max) |
| | Set the range of possible values for phi angle.
|
| const osgParticle::rangef & | getPhiRange () const |
| | Get the range of possible values for phi angle.
|
| void | setThetaRange (const osgParticle::rangef &range) |
| | Set the range of possible values for theta angle.
|
| void | setThetaRange (float min, float max) |
| | Set the range of possible values for theta angle.
|
| const osgParticle::rangef & | getThetaRange () const |
| | Get the range of possible values for theta angle.
|
| void | setInitialSpeedRange (const osgParticle::rangef &range) |
| | Set the range of possible values for initial speed of particles.
|
| void | setInitialSpeedRange (float min, float max) |
| | Set the range of possible values for initial speed of particles.
|
| const osgParticle::rangef & | getInitialSpeedRange () const |
| | Get the range of possible values for initial speed of particles.
|
| void | setInitialRotationalSpeedRange (const osgParticle::rangev3 &range) |
| | Set the range of possible values for initial rotational speed.
|
| void | setInitialRotationalSpeedRange (const osg::Vec3d &min, const osg::Vec3d &max) |
| | Set the range of possible values for initial rotational speed.
|
| const osgParticle::rangev3 & | getInitialRotationalSpeedRange () const |
| | Get the range of possible values for initial rotational speed.
|
| void | shoot (osgParticle::Particle *particle) const |
| | Shoot a particle.
|
| void | setSeed (unsigned int seed) |
| | Set the seed of the random number generator.
|
A shooter class that shoots particles radially with a Gaussian distribution (selected for speed or lifetime).
This shooter mimics the osgParticle::RadialShooter with the exception that the random selection of speed or lifetime has a normal (or Gaussian) distribution. Setting a speed range for a Gaussian distribution of a property will set the probability of each particle to be within that range to one sigma of the normal distribution. For instance setting a speed range to [0.0, 10.0] will set the probability of 68.3% (one sigma) of the particles to be shot within the zero to ten meters-per-second range. Note that approximately 32% of the particles will be shot outside of the zero to ten range.
Since particle speeds are considered to always move at a positive speed, a caveat to the range is that the Mean of the normal distribution is always set to zero, the Standard Deviation is set to one and the result is multiplied by the maximum range value. The minimum range value is then, in fact, used as a hard boundary. For example, a range from one to ten [1.0, 10.0] will shoot particles where 68.3% are shot at ten meters-per-second or less, 32.7% are faster, but no particle will be moving slower than one meter-per-second.
mean = 0.0; stdDeviation = 1.0; speed = abs(normalDistribution(mean, stdDeviation)) * range.maximum; if (speed < range.minimum) speed = range.minimum;
If the shooter is flagged to have a normal distribution of lifetimes the speed will have a uniform distribution (same as a RadialShooter) over the given speed-range. Distribution over lifetime uses the maximum lifetime defined in the default particle template (found in the particle system), not defined in this shooter.
This shooter also defines a distance (in meters) in each of the three orthogonal directions (X, Y, Z) which are the one-sigma distances for distribution in that direction. For instance a normal distribution over the lifetime of the particle and a one-sigma distance of (10, 15 20) will result in 68.3% (one sigma) of the particles living to within ten meters in the X direction, fifteen meters in the Y direction and twenty meters in the Z direction from their starting point.