Changeset 13041 for OpenSceneGraph/trunk/include/osgParticle/OrbitOperator
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgParticle/OrbitOperator
r12139 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2010 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2010 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 */ … … 33 33 : Operator(), _magnitude(1.0f), _epsilon(1e-3), _maxRadius(FLT_MAX) 34 34 {} 35 35 36 36 OrbitOperator( const OrbitOperator& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY ) 37 37 : Operator(copy, copyop), _center(copy._center), _magnitude(copy._magnitude), 38 38 _epsilon(copy._epsilon), _maxRadius(copy._maxRadius) 39 39 {} 40 40 41 41 META_Object( osgParticle, OrbitOperator ); 42 42 43 43 /// Set the center of orbit 44 44 void setCenter( const osg::Vec3& c ) { _center = c; } 45 45 46 46 /// Get the center of orbit 47 47 const osg::Vec3& getCenter() const { return _center; } 48 48 49 49 /// Set the acceleration scale 50 50 void setMagnitude( float mag ) { _magnitude = mag; } 51 51 52 52 /// Get the acceleration scale 53 53 float getMagnitude() const { return _magnitude; } 54 54 55 55 /// Set the acceleration epsilon 56 56 void setEpsilon( float eps ) { _epsilon = eps; } 57 57 58 58 /// Get the acceleration epsilon 59 59 float getEpsilon() const { return _epsilon; } 60 60 61 61 /// Set max radius between the center and the particle 62 62 void setMaxRadius( float max ) { _maxRadius = max; } 63 63 64 64 /// Get max radius between the center and the particle 65 65 float getMaxRadius() const { return _maxRadius; } 66 66 67 67 /// Apply the acceleration to a particle. Do not call this method manually. 68 68 inline void operate( Particle* P, double dt ); 69 69 70 70 /// Perform some initializations. Do not call this method manually. 71 71 inline void beginOperate( Program* prg ); 72 72 73 73 protected: 74 74 virtual ~OrbitOperator() {} 75 75 OrbitOperator& operator=( const OrbitOperator& ) { return *this; } 76 76 77 77 osg::Vec3 _center; 78 78 osg::Vec3 _xf_center;
