Show
Ignore:
Timestamp:
11/24/09 16:00:11 (5 years ago)
Author:
robert
Message:

From Martin Scheffler, "osgParticle: method to set start and end tile for particle texture (for animated particles). I also updated examples/osgParticle to show the feature.
The texture in data/Images should be copied to osg-data. I created the texture myself with the help of an explosion generator, so no license issues there.
"

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgParticle/Particle.cpp

    r10660 r10827  
    4646    _s_tile(1.0f), 
    4747    _t_tile(1.0f), 
    48     _num_tile(1), 
     48    _start_tile(0), 
     49    _end_tile(0), 
    4950    _cur_tile(-1), 
    5051    _s_coord(0.0f), 
     
    8081 
    8182    //Compute the current texture tile based on our normalized age 
    82     int currentTile = static_cast<int>(x * _num_tile); 
     83    int currentTile = _start_tile + static_cast<int>(x * getNumTiles()); 
    8384     
    8485    //If the current texture tile is different from previous, then compute new texture coords