Changeset 13041 for OpenSceneGraph/trunk/src/osgParticle/SmokeEffect.cpp
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgParticle/SmokeEffect.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 */ … … 27 27 { 28 28 setDefaults(); 29 29 30 30 _position.set(0.0f,0.0f,0.0f); 31 31 _scale = 1.0f; … … 34 34 _emitterDuration = 65.0; 35 35 _defaultParticleTemplate.setLifeTime(5.0*_scale); 36 36 37 37 if (_automaticSetup) buildEffect(); 38 38 } … … 41 41 { 42 42 setDefaults(); 43 43 44 44 _position = position; 45 45 _scale = scale; … … 48 48 _emitterDuration = 65.0; 49 49 _defaultParticleTemplate.setLifeTime(5.0*_scale); 50 50 51 51 if (_automaticSetup) buildEffect(); 52 52 } … … 61 61 { 62 62 ParticleEffect::setDefaults(); 63 64 _textureFileName = "Images/smoke.rgb"; 63 64 _textureFileName = "Images/smoke.rgb"; 65 65 _emitterDuration = 65.0; 66 66 … … 70 70 _defaultParticleTemplate.setAlphaRange(osgParticle::rangef(0.1f, 1.0f)); 71 71 _defaultParticleTemplate.setColorRange(osgParticle::rangev4( 72 osg::Vec4(1, 1.0f, 1.0f, 1.0f), 72 osg::Vec4(1, 1.0f, 1.0f, 1.0f), 73 73 osg::Vec4(1, 1.0f, 1.f, 0.0f))); 74 74 … … 90 90 osgParticle::Particle& ptemplate = _particleSystem->getDefaultParticleTemplate(); 91 91 92 float radius = 0.5f*_scale; 92 float radius = 0.5f*_scale; 93 93 float density = 1.0f; // 1.0kg/m^3 94 94 95 95 ptemplate.setLifeTime(_defaultParticleTemplate.getLifeTime()); 96 96 97 // the following ranges set the envelope of the respective 97 // the following ranges set the envelope of the respective 98 98 // graphical properties in time. 99 99 ptemplate.setSizeRange(osgParticle::rangef(radius*_defaultParticleTemplate.getSizeRange().minimum, … … 153 153 // set up program. 154 154 if (!_program) 155 { 155 { 156 156 _program = new osgParticle::FluidProgram; 157 157 } 158 158 159 159 if (_program.valid()) 160 160 {
