Changeset 13041 for OpenSceneGraph/trunk/src/osgParticle/ParticleEffect.cpp
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgParticle/ParticleEffect.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 */ … … 36 36 { 37 37 if (_useLocalParticleSystem==local) return; 38 38 39 39 _useLocalParticleSystem = local; 40 40 … … 86 86 { 87 87 if (_startTime==startTime) return; 88 88 89 89 _startTime =startTime; 90 90 … … 106 106 107 107 _defaultParticleTemplate.setLifeTime(duration); 108 108 109 109 if (_automaticSetup) setUpEmitterAndProgram(); 110 110 } … … 122 122 { 123 123 if (_particleSystem==ps) return; 124 124 125 125 _particleSystem = ps; 126 126 … … 146 146 osg::ref_ptr<ParticleSystem> particleSystem = getParticleSystem(); 147 147 148 if (!emitter || !particleSystem || !program) return; 148 if (!emitter || !particleSystem || !program) return; 149 149 150 150 151 151 // clear the children. 152 152 removeChildren(0,getNumChildren()); 153 153 154 154 // add the emitter 155 155 addChild(emitter.get()); 156 156 157 157 // add the program to update the particles 158 158 addChild(program.get()); … … 166 166 { 167 167 particleSystem->setParticleScaleReferenceFrame(ParticleSystem::LOCAL_COORDINATES); 168 168 169 169 // add the geode to the scene graph 170 170 osg::Geode* geode = new osg::Geode;
