Changeset 13041 for OpenSceneGraph/trunk/src/osgParticle/Particle.cpp
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/src/osgParticle/Particle.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgParticle/Particle.cpp
r11814 r13041 26 26 _ar(1, 0), 27 27 _cr(osg::Vec4(1, 1, 1, 1), osg::Vec4(1, 1, 1, 1)), 28 _si(new LinearInterpolator), 29 _ai(new LinearInterpolator), 28 _si(new LinearInterpolator), 29 _ai(new LinearInterpolator), 30 30 _ci(new LinearInterpolator), 31 31 _mustdie(false), … … 66 66 } 67 67 68 double x = 0; 68 double x = 0; 69 69 70 70 // if we don't live forever, compute our normalized age. … … 80 80 return false; 81 81 } 82 82 83 83 // compute the current values for size, alpha and color. 84 84 if (_lifeTime <= 0) { … … 93 93 _current_color = _ci.get()->interpolate(x, _cr); 94 94 } 95 95 96 96 // update position 97 97 _prev_pos = _position; 98 98 _position += _velocity * dt; 99 99 100 100 // return now if we indicate that only time stamp should be updated 101 101 // the shader will handle remain properties in this case … … 104 104 //Compute the current texture tile based on our normalized age 105 105 int currentTile = _start_tile + static_cast<int>(x * getNumTiles()); 106 106 107 107 //If the current texture tile is different from previous, then compute new texture coords 108 108 if(currentTile != _cur_tile) 109 109 { 110 110 111 111 _cur_tile = currentTile; 112 112 _s_coord = _s_tile * fmod(_cur_tile , 1.0 / _s_tile); … … 115 115 // OSG_NOTICE<<this<<" setting tex coords "<<_s_coord<<" "<<_t_coord<<std::endl; 116 116 } 117 117 118 118 // update angle 119 119 _prev_angle = _angle;
