15#ifndef OSGPARTICLE_RADIAL_SHOOTER
16#define OSGPARTICLE_RADIAL_SHOOTER 1
97 _theta_range(0, 0.5f*
osg::PI_4),
98 _phi_range(0, 2*
osg::PI),
100 _rot_speed_range(
osg::Vec3(0,0,0),
osg::Vec3(0,0,0))
106 _theta_range(copy._theta_range),
107 _phi_range(copy._phi_range),
108 _speed_range(copy._speed_range),
109 _rot_speed_range(copy._rot_speed_range)
130 return _rot_speed_range;
141 _theta_range.maximum = r2;
152 _phi_range.maximum = r2;
163 _speed_range.maximum = r2;
168 _rot_speed_range = r;
174 _rot_speed_range.maximum = r2;
179 float theta = _theta_range.get_random();
180 float phi = _phi_range.get_random();
181 float speed = _speed_range.get_random();
182 osg::Vec3 rot_speed = _rot_speed_range.get_random();
185 speed * sinf(theta) * cosf(phi),
186 speed * sinf(theta) * sinf(phi),
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
Vec3f Vec3
Definition Vec3:21
The osgParticle library is a NodeKit that extends the core scene graph to support particle effects.
Definition AccelOperator:27
range< osg::Vec3 > rangev3
Range of osg::Vec3s.
Definition range:82
range< float > rangef
Range of floats.
Definition range:76
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
Implementation of a particle.
Definition Particle:47
void setVelocity(const osg::Vec3 &v)
Set the velocity vector.
Definition Particle:488
void setAngularVelocity(const osg::Vec3 &v)
Set the angular velocity vector.
Definition Particle:520
void setPhiRange(const rangef &r)
Set the range of possible values for phi angle.
Definition RadialShooter:144
RadialShooter & operator=(const RadialShooter &)
Definition RadialShooter:84
void shoot(Particle *P) const
Shoot a particle. Do not call this method manually.
Definition RadialShooter:177
const rangev3 & getInitialRotationalSpeedRange() const
Get the range of possible values for initial rotational speed of particles.
Definition RadialShooter:128
META_Object(osgParticle, RadialShooter)
virtual ~RadialShooter()
Definition RadialShooter:83
const rangef & getThetaRange() const
Get the range of possible values for theta angle.
Definition RadialShooter:113
const rangef & getInitialSpeedRange() const
Get the range of possible values for initial speed of particles.
Definition RadialShooter:123
void setThetaRange(const rangef &r)
Set the range of possible values for theta angle.
Definition RadialShooter:133
void setInitialRotationalSpeedRange(const rangev3 &r)
Set the range of possible values for initial rotational speed of particles.
Definition RadialShooter:166
RadialShooter()
Definition RadialShooter:95
const rangef & getPhiRange() const
Get the range of possible values for phi angle.
Definition RadialShooter:118
void setInitialSpeedRange(const rangef &r)
Set the range of possible values for initial speed of particles.
Definition RadialShooter:155
ValueType minimum
Lower bound.
Definition range:42
Shooter()
Definition Shooter:52