Changeset 13041 for OpenSceneGraph/trunk/include/osgParticle/SinkOperator
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgParticle/SinkOperator
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 */ … … 31 31 enum SinkTarget { SINK_POSITION, SINK_VELOCITY, SINK_ANGULAR_VELOCITY }; 32 32 enum SinkStrategy { SINK_INSIDE, SINK_OUTSIDE }; 33 33 34 34 SinkOperator() 35 35 : DomainOperator(), _sinkTarget(SINK_POSITION), _sinkStrategy(SINK_INSIDE) 36 36 {} 37 37 38 38 SinkOperator( const SinkOperator& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY ) 39 39 : DomainOperator(copy, copyop), _sinkTarget(copy._sinkTarget), _sinkStrategy(copy._sinkStrategy) 40 40 {} 41 41 42 42 META_Object( osgParticle, SinkOperator ); 43 43 44 44 /// Set the sink strategy 45 45 void setSinkTarget( SinkTarget so ) { _sinkTarget = so; } 46 46 47 47 /// Get the sink strategy 48 48 SinkTarget getSinkTarget() const { return _sinkTarget; } 49 49 50 50 /// Set the sink strategy 51 51 void setSinkStrategy( SinkStrategy ss ) { _sinkStrategy = ss; } 52 52 53 53 /// Get the sink strategy 54 54 SinkStrategy getSinkStrategy() const { return _sinkStrategy; } 55 55 56 56 /// Perform some initializations. Do not call this method manually. 57 57 void beginOperate( Program* prg ); 58 58 59 59 protected: 60 60 virtual ~SinkOperator() {} 61 61 SinkOperator& operator=( const SinkOperator& ) { return *this; } 62 62 63 63 virtual void handlePoint( const Domain& domain, Particle* P, double dt ); 64 64 virtual void handleLineSegment( const Domain& domain, Particle* P, double dt ); … … 69 69 virtual void handleBox( const Domain& domain, Particle* P, double dt ); 70 70 virtual void handleDisk( const Domain& domain, Particle* P, double dt ); 71 71 72 72 inline const osg::Vec3& getValue( Particle* P ); 73 73 inline void kill( Particle* P, bool insideDomain ); 74 74 75 75 SinkTarget _sinkTarget; 76 76 SinkStrategy _sinkStrategy;
