- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgParticle/SmokeTrailEffect.cpp
r8500 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 2 * 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 25 25 26 26 SmokeTrailEffect::SmokeTrailEffect(bool automaticSetup): 27 ParticleEffect(automaticSetup) 27 ParticleEffect(automaticSetup) 28 28 { 29 29 setDefaults(); 30 30 31 31 _position.set(0.0f,0.0f,0.0f); 32 32 _scale = 1.0f; … … 35 35 _emitterDuration = 65.0; 36 36 _defaultParticleTemplate.setLifeTime(5.0*_scale); 37 37 38 38 if (_automaticSetup) buildEffect(); 39 39 } … … 42 42 { 43 43 setDefaults(); 44 44 45 45 _position = position; 46 46 _scale = scale; … … 49 49 _emitterDuration = 65.0; 50 50 _defaultParticleTemplate.setLifeTime(5.0*_scale); 51 51 52 52 if (_automaticSetup) buildEffect(); 53 53 } … … 62 62 { 63 63 ParticleEffect::setDefaults(); 64 65 _textureFileName = "Images/continous_smoke.rgb"; 64 65 _textureFileName = "Images/continous_smoke.rgb"; 66 66 _emitterDuration = 65.0; 67 67 … … 71 71 _defaultParticleTemplate.setAlphaRange(osgParticle::rangef(0.7f, 1.0f)); 72 72 _defaultParticleTemplate.setColorRange(osgParticle::rangev4( 73 osg::Vec4(1, 1.0f, 1.0f, 1.0f), 73 osg::Vec4(1, 1.0f, 1.0f, 1.0f), 74 74 osg::Vec4(1, 1.0f, 1.f, 0.0f))); 75 75 … … 91 91 osgParticle::Particle& ptemplate = _particleSystem->getDefaultParticleTemplate(); 92 92 93 float radius = 0.5f*_scale; 93 float radius = 0.5f*_scale; 94 94 float density = 1.0f; // 1.0kg/m^3 95 95 96 96 ptemplate.setLifeTime(_defaultParticleTemplate.getLifeTime()); 97 97 98 // the following ranges set the envelope of the respective 98 // the following ranges set the envelope of the respective 99 99 // graphical properties in time. 100 100 ptemplate.setSizeRange(osgParticle::rangef(radius*_defaultParticleTemplate.getSizeRange().minimum, … … 154 154 // set up program. 155 155 if (!_program) 156 { 156 { 157 157 _program = new osgParticle::FluidProgram; 158 158 } 159 159 160 160 if (_program.valid()) 161 161 {
