Changeset 13041 for OpenSceneGraph/trunk/include/osgParticle/AccelOperator
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgParticle/AccelOperator
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 */ … … 38 38 /// Get the acceleration vector. 39 39 inline const osg::Vec3& getAcceleration() const; 40 40 41 41 /// Set the acceleration vector. 42 42 inline void setAcceleration(const osg::Vec3& v); 43 43 44 44 /** Quickly set the acceleration vector to the gravity on earth (0, 0, -9.81). 45 45 The acceleration will be multiplied by the <CODE>scale</CODE> parameter. 46 46 */ 47 47 inline void setToGravity(float scale = 1); 48 48 49 49 /// Apply the acceleration to a particle. Do not call this method manually. 50 50 inline void operate(Particle* P, double dt); 51 51 52 52 /// Perform some initializations. Do not call this method manually. 53 53 inline void beginOperate(Program *prg); … … 55 55 protected: 56 56 virtual ~AccelOperator() {} 57 AccelOperator &operator=(const AccelOperator &) { return *this; } 57 AccelOperator &operator=(const AccelOperator &) { return *this; } 58 58 59 59 private: … … 63 63 64 64 // INLINE FUNCTIONS 65 65 66 66 inline AccelOperator::AccelOperator() 67 67 : Operator(), _accel(0, 0, 0) 68 68 { 69 69 } 70 70 71 71 inline AccelOperator::AccelOperator(const AccelOperator& copy, const osg::CopyOp& copyop) 72 72 : Operator(copy, copyop), _accel(copy._accel) … … 83 83 _accel = v; 84 84 } 85 85 86 86 inline void AccelOperator::setToGravity(float scale) 87 87 { … … 93 93 P->addVelocity(_xf_accel * dt); 94 94 } 95 95 96 96 inline void AccelOperator::beginOperate(Program *prg) 97 97 {
