Changeset 13041 for OpenSceneGraph/trunk/include/osgParticle/BounceOperator
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgParticle/BounceOperator
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 */ … … 32 32 : DomainOperator(), _friction(1.0f), _resilience(0.0f), _cutoff(0.0f) 33 33 {} 34 34 35 35 BounceOperator( const BounceOperator& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY ) 36 36 : DomainOperator(copy, copyop), 37 37 _friction(copy._friction), _resilience(copy._resilience), _cutoff(copy._cutoff) 38 38 {} 39 39 40 40 META_Object( osgParticle, BounceOperator ); 41 41 42 42 /// Set the friction 43 43 void setFriction( float f ) { _friction = f; } 44 44 45 45 /// Get the friction 46 46 float getFriction() const { return _friction; } 47 47 48 48 /// Set the resilience 49 49 void setResilience( float r ) { _resilience = r; } 50 50 51 51 /// Get the velocity cutoff factor 52 52 float getResilience() const { return _resilience; } 53 53 54 54 /// Set the velocity cutoff factor 55 55 void setCutoff( float v ) { _cutoff = v; } 56 56 57 57 /// Get the velocity cutoff factor 58 58 float getCutoff() const { return _cutoff; } 59 59 60 60 protected: 61 61 virtual ~BounceOperator() {} 62 62 BounceOperator& operator=( const BounceOperator& ) { return *this; } 63 63 64 64 virtual void handleTriangle( const Domain& domain, Particle* P, double dt ); 65 65 virtual void handleRectangle( const Domain& domain, Particle* P, double dt ); … … 67 67 virtual void handleSphere( const Domain& domain, Particle* P, double dt ); 68 68 virtual void handleDisk( const Domain& domain, Particle* P, double dt ); 69 69 70 70 float _friction; 71 71 float _resilience;
