- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgParticle/ParticleSystemUpdater
r12056 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 */ … … 41 41 ParticleSystemUpdater(); 42 42 ParticleSystemUpdater(const ParticleSystemUpdater& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY); 43 43 44 44 META_Node(osgParticle,ParticleSystemUpdater); 45 45 46 46 /// Add a particle system to the list. 47 47 virtual bool addParticleSystem(ParticleSystem* ps); … … 52 52 /// Remove a particle system(s) from the list (by index). 53 53 virtual bool removeParticleSystem(unsigned int i, unsigned int numParticleSystemsToRemove=1); 54 54 55 55 /// Replace ParticleSystem with another ParticleSystem. 56 56 virtual bool replaceParticleSystem(ParticleSystem* origPS, ParticleSystem* newPS); … … 64 64 /// Get a particle system from the list. 65 65 inline ParticleSystem* getParticleSystem(unsigned int i); 66 66 67 67 /// Get a particle system from the list. 68 68 inline const ParticleSystem* getParticleSystem(unsigned int i) const; … … 73 73 /// get index number of ParticleSystem. 74 74 inline unsigned int getParticleSystemIndex( const ParticleSystem* ps ) const; 75 75 76 76 virtual void traverse(osg::NodeVisitor& nv); 77 78 virtual osg::BoundingSphere computeBound() const; 77 78 virtual osg::BoundingSphere computeBound() const; 79 79 80 80 protected: 81 81 virtual ~ParticleSystemUpdater() {} 82 82 ParticleSystemUpdater &operator=(const ParticleSystemUpdater &) { return *this; } 83 83 84 84 private: 85 85 typedef std::vector<osg::ref_ptr<ParticleSystem> > ParticleSystem_Vector; 86 86 87 87 ParticleSystem_Vector _psv; 88 88 double _t0; 89 89 90 90 //added 1/17/06- bgandere@nps.edu 91 91 //a var to keep from doing multiple updates per frame 92 92 unsigned int _frameNumber; 93 93 }; 94 94 95 95 // INLINE FUNCTIONS 96 96 97 97 inline unsigned int ParticleSystemUpdater::getNumParticleSystems() const 98 98 { 99 99 return static_cast<int>(_psv.size()); 100 100 } 101 101 102 102 inline ParticleSystem* ParticleSystemUpdater::getParticleSystem(unsigned int i) 103 103 {
