- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgParticle/ConstantRateCounter
r5328 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 */ … … 26 26 public: 27 27 ConstantRateCounter(): 28 Counter(), 28 Counter(), 29 29 _minimumNumberOfParticlesToCreate(0), 30 30 _numberOfParticlesPerSecondToCreate(0), … … 34 34 35 35 ConstantRateCounter(const ConstantRateCounter& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY): 36 Counter(copy, copyop), 36 Counter(copy, copyop), 37 37 _minimumNumberOfParticlesToCreate(copy._minimumNumberOfParticlesToCreate), 38 38 _numberOfParticlesPerSecondToCreate(copy._numberOfParticlesPerSecondToCreate), … … 40 40 { 41 41 } 42 43 42 43 44 44 META_Object(osgParticle, ConstantRateCounter); 45 45 46 46 void setMinimumNumberOfParticlesToCreate(int minNumToCreate) { _minimumNumberOfParticlesToCreate = minNumToCreate; } 47 47 int getMinimumNumberOfParticlesToCreate() const { return _minimumNumberOfParticlesToCreate; } 48 48 49 49 void setNumberOfParticlesPerSecondToCreate(double numPerSecond) { _numberOfParticlesPerSecondToCreate = numPerSecond; } 50 50 double getNumberOfParticlesPerSecondToCreate() const { return _numberOfParticlesPerSecondToCreate; } … … 63 63 return osg::maximum(_minimumNumberOfParticlesToCreate, i); 64 64 } 65 65 66 66 protected: 67 67 virtual ~ConstantRateCounter() {} 68 68 69 69 int _minimumNumberOfParticlesToCreate; 70 70 double _numberOfParticlesPerSecondToCreate; 71 71 mutable double _carryOver; 72 72 }; 73 73 74 74 } 75 75
