Changeset 13041 for OpenSceneGraph/trunk/src/osgParticle/FireEffect.cpp
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgParticle/FireEffect.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 */ … … 31 31 { 32 32 setDefaults(); 33 33 34 34 _position.set(0.0f,0.0f,0.0f); 35 35 _scale = 1.0f; 36 36 _intensity = 1.0f; 37 37 38 38 _emitterDuration = 60.0; 39 39 _defaultParticleTemplate.setLifeTime(0.5+0.1*_scale); 40 40 41 41 if (_automaticSetup) buildEffect(); 42 42 } … … 45 45 { 46 46 setDefaults(); 47 47 48 48 _position = position; 49 49 _scale = scale; 50 50 _intensity = intensity; 51 51 52 52 _emitterDuration = 60.0; 53 53 _defaultParticleTemplate.setLifeTime(0.5+0.1*_scale); 54 54 55 55 if (_automaticSetup) buildEffect(); 56 56 } … … 65 65 { 66 66 ParticleEffect::setDefaults(); 67 68 _textureFileName = "Images/smoke.rgb"; 67 68 _textureFileName = "Images/smoke.rgb"; 69 69 _emitterDuration = 60.0; 70 70 … … 74 74 _defaultParticleTemplate.setAlphaRange(osgParticle::rangef(0.1f, 1.0f)); 75 75 _defaultParticleTemplate.setColorRange(osgParticle::rangev4( 76 osg::Vec4(1, 0.8f, 0.2f, 1.0f), 76 osg::Vec4(1, 0.8f, 0.2f, 1.0f), 77 77 osg::Vec4(1, 0.3f, 0.2f, 0.0f))); 78 78 } … … 93 93 osgParticle::Particle& ptemplate = _particleSystem->getDefaultParticleTemplate(); 94 94 95 float radius = 0.25f*_scale; 95 float radius = 0.25f*_scale; 96 96 float density = 0.5f; // 0.5kg/m^3 97 97 98 98 ptemplate.setLifeTime(_defaultParticleTemplate.getLifeTime()); 99 99 100 // the following ranges set the envelope of the respective 100 // the following ranges set the envelope of the respective 101 101 // graphical properties in time. 102 102 ptemplate.setSizeRange(osgParticle::rangef(radius*_defaultParticleTemplate.getSizeRange().minimum, … … 158 158 // set up program. 159 159 if (!_program) 160 { 160 { 161 161 _program = new osgParticle::FluidProgram; 162 162 } 163 163 164 164 if (_program.valid()) 165 165 {
