Changeset 3211
- Timestamp:
- 08/02/04 09:25:28 (9 years ago)
- Location:
- OpenSceneGraph/trunk
- Files:
-
- 3 modified
-
include/osgParticle/SectorPlacer (modified) (1 diff)
-
include/osgParticle/range (modified) (1 diff)
-
src/osgParticle/Particle.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgParticle/SectorPlacer
r1529 r3211 117 117 inline void SectorPlacer::place(Particle *P) const 118 118 { 119 float rad = rad_range_.get_random ();119 float rad = rad_range_.get_random_sqrtf(); 120 120 float phi = phi_range_.get_random(); 121 121 -
OpenSceneGraph/trunk/include/osgParticle/range
r1529 r3211 65 65 } 66 66 67 /// Get a random square root value between min and max. 68 T_ get_random_sqrtf() const 69 { 70 return minimum + (maximum - minimum) * sqrtf( static_cast<float>(rand()) / static_cast<float>(RAND_MAX) ); 71 } 72 67 73 }; 68 74 -
OpenSceneGraph/trunk/src/osgParticle/Particle.cpp
r2778 r3211 87 87 88 88 // compute the current values for size, alpha and color. 89 current_size_ = si_.get()->interpolate(x, sr_); 90 current_alpha_ = ai_.get()->interpolate(x, ar_); 91 current_color_ = ci_.get()->interpolate(x, cr_); 89 if (lifetime_ <= 0) { 90 if (dt == t0_) { 91 current_size_ = sr_.get_random(); 92 current_alpha_ = ar_.get_random(); 93 current_color_ = cr_.get_random(); 94 } 95 } else { 96 current_size_ = si_.get()->interpolate(x, sr_); 97 current_alpha_ = ai_.get()->interpolate(x, ar_); 98 current_color_ = ci_.get()->interpolate(x, cr_); 99 } 92 100 93 101 // update position
