![]() |
VR-Forces 4.8 Class Documentation
|
A shooter class that shoots particles radially with a Gaussian distribution (selected for speed or lifetime). More...

Public Types | |
| enum | DistributionType { NONE = 0, SPEED = 1, LIFE = 2 } |
Public Member Functions | |
| DtGaussShooter () | |
| Default CTOR. More... | |
| DtGaussShooter (const DtGaussShooter ©, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY) | |
| Copy CTOR. More... | |
| META_Object (osgParticle, DtGaussShooter) | |
| void | setDistributionType (DistributionType distType) |
| Set the property type that has a Gaussian distribution applied. More... | |
| DistributionType | distributionType () const |
| Get the property type that has a Gaussian distribution applied. More... | |
| void | setOneSigmaDistance (const osg::Vec3d &dist) |
| Set the one-sigma distance per orthogonal direction. More... | |
| const osg::Vec3d & | oneSigmaDistance () const |
| Get the one-sigma distance per orthogonal direction. More... | |
| void | setPhiRange (const osgParticle::rangef &range) |
Set the range of possible values for phi angle. More... | |
| void | setPhiRange (float min, float max) |
Set the range of possible values for phi angle. More... | |
| const osgParticle::rangef & | getPhiRange () const |
Get the range of possible values for phi angle. More... | |
| void | setThetaRange (const osgParticle::rangef &range) |
Set the range of possible values for theta angle. More... | |
| void | setThetaRange (float min, float max) |
Set the range of possible values for theta angle. More... | |
| const osgParticle::rangef & | getThetaRange () const |
Get the range of possible values for theta angle. More... | |
| void | setInitialSpeedRange (const osgParticle::rangef &range) |
| Set the range of possible values for initial speed of particles. More... | |
| void | setInitialSpeedRange (float min, float max) |
| Set the range of possible values for initial speed of particles. More... | |
| const osgParticle::rangef & | getInitialSpeedRange () const |
| Get the range of possible values for initial speed of particles. More... | |
| void | setInitialRotationalSpeedRange (const osgParticle::rangev3 &range) |
| Set the range of possible values for initial rotational speed. More... | |
| void | setInitialRotationalSpeedRange (const osg::Vec3d &min, const osg::Vec3d &max) |
| Set the range of possible values for initial rotational speed. More... | |
| const osgParticle::rangev3 & | getInitialRotationalSpeedRange () const |
| Get the range of possible values for initial rotational speed. More... | |
| void | shoot (osgParticle::Particle *particle) const |
| Shoot a particle. More... | |
| void | setSeed (unsigned int seed) |
| Set the seed of the random number generator. More... | |
Protected Member Functions | |
| virtual | ~DtGaussShooter () |
| protected virtual destructor More... | |
| DtGaussShooter & | operator= (const DtGaussShooter &) |
| Protected copy operator. More... | |
Private Attributes | |
| DistributionType | myDistributionType |
| DtGaussianDistributionGenerator | myGauss |
| osgParticle::rangef | myPhiRange |
| osgParticle::rangef | myThetaRange |
| osgParticle::rangef | mySpeedRange |
| osgParticle::rangev3 | myRotationRange |
| osg::Vec3d | myOneSigmaDistance |
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.
|
inline |
Default CTOR.
|
inline |
Copy CTOR.
|
inlineprotectedvirtual |
protected virtual destructor
| makVrv::DtGaussShooter::META_Object | ( | osgParticle | , |
| DtGaussShooter | |||
| ) |
|
inline |
Set the property type that has a Gaussian distribution applied.
| [in] | distType | is the property type for normal distribution, default is SPEED. |
|
inline |
Get the property type that has a Gaussian distribution applied.
|
inline |
Set the one-sigma distance per orthogonal direction.
| [in] | dist | is the distance in each direction where the probability of particle distribution within that distance is one-sigma (68.3%), default is Vec3(10, 10, 10). |
|
inline |
Get the one-sigma distance per orthogonal direction.
|
inline |
Set the range of possible values for phi angle.
Phi is the angle in the XY plane from the X axis towards the Y axis.
| [in] | range | is the range of possible values, default [0, 2*PI]. |
|
inline |
Set the range of possible values for phi angle.
| [in] | min | is the minimum possible value. |
| [in] | max | is the maximum possible value. |
|
inline |
Get the range of possible values for phi angle.
|
inline |
Set the range of possible values for theta angle.
Theta is the angle from the XY plane towards the Z axis.
| [in] | range | is the range of possible values, default [0, PI]. |
|
inline |
Set the range of possible values for theta angle.
| [in] | min | is the minimum possible value. |
| [in] | max | is the maximum possible value. |
|
inline |
Get the range of possible values for theta angle.
|
inline |
Set the range of possible values for initial speed of particles.
| [in] | range | is the range of possible values in meters-per-second, default [0.0, 1.0]. |
|
inline |
Set the range of possible values for initial speed of particles.
| [in] | min | is the minimum possible value. |
| [in] | max | is the maximum possible value. |
|
inline |
Get the range of possible values for initial speed of particles.
|
inline |
Set the range of possible values for initial rotational speed.
| [in] | range | is the range of possible values, default [Vec3(0, 0, 0), Vec3(0, 0, 0)]. |
|
inline |
Set the range of possible values for initial rotational speed.
| [in] | min | is the minimum possible value. |
| [in] | max | is the maximum possible value. |
|
inline |
Get the range of possible values for initial rotational speed.
|
inline |
Shoot a particle.
Do not call this method.
| [in] | particle | is the particle to receive speed and angle. |
Set the seed of the random number generator.
| [in] | seed | is the seed to set the generator. |
|
inlineprotected |
Protected copy operator.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |