Changeset 13041 for OpenSceneGraph/trunk/include/osgParticle/ModularEmitter
- Timestamp:
- 03/21/12 18:36:20 (15 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgParticle/ModularEmitter
r11687 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 */ … … 37 37 /** An emitter class that holds three objects to control the creation of particles. 38 38 These objects are a <I>counter</I>, a <I>placer</I> and a <I>shooter</I>. 39 The counter controls the number of particles to be emitted at each frame; 40 the placer must initialize the particle's position vector, while the shooter initializes 39 The counter controls the number of particles to be emitted at each frame; 40 the placer must initialize the particle's position vector, while the shooter initializes 41 41 its velocity vector. 42 42 You can use the predefined counter/placer/shooter classes, or you can create your own. … … 46 46 ModularEmitter(); 47 47 ModularEmitter(const ModularEmitter& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY); 48 48 49 49 META_Node(osgParticle,ModularEmitter); 50 50 51 51 /// Get the counter object. 52 52 inline Counter* getCounter(); 53 53 54 54 /// Get the const Counter object. 55 55 inline const Counter* getCounter() const; 56 56 57 57 /// Set the Counter object. 58 58 inline void setCounter(Counter* c); 59 59 60 60 /// Get the ratio between number of particle to create in compensation for movement of the emitter 61 61 inline float getNumParticlesToCreateMovementCompensationRatio() const; … … 67 67 /// Get the Placer object. 68 68 inline Placer* getPlacer(); 69 70 /// Get the const Placer object. 69 70 /// Get the const Placer object. 71 71 inline const Placer* getPlacer() const; 72 72 73 73 /// Set the Placer object. 74 74 inline void setPlacer(Placer* p); 75 75 76 76 /// Get the Shooter object. 77 77 inline Shooter *getShooter(); 78 78 79 79 /// Get the const Shooter object. 80 80 inline const Shooter *getShooter() const; 81 81 82 82 /// Set the Shooter object. 83 inline void setShooter(Shooter *s); 83 inline void setShooter(Shooter *s); 84 84 85 85 protected: 86 86 virtual ~ModularEmitter() {} 87 87 ModularEmitter &operator=(const ModularEmitter &) { return *this; } 88 88 89 89 virtual void emitParticles(double dt); 90 90 91 91 private: 92 92 93 93 float _numParticleToCreateMovementCompensationRatio; 94 94 osg::ref_ptr<Counter> _counter; … … 96 96 osg::ref_ptr<Shooter> _shooter; 97 97 }; 98 98 99 99 // INLINE FUNCTIONS 100 100 101 101 inline Counter* ModularEmitter::getCounter() 102 102 { 103 103 return _counter.get(); 104 104 } 105 105 106 106 inline const Counter* ModularEmitter::getCounter() const 107 107 { … … 153 153 _shooter = s; 154 154 } 155 155 156 156 } 157 157
