BounceOperator
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2010 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
// Written by Wang Rui, (C) 2010
#ifndef OSGPARTICLE_BOUNCEOPERATOR
#define OSGPARTICLE_BOUNCEOPERATOR
#include <osgParticle/Particle>
#include <osgParticle/DomainOperator>
namespace osgParticle
{
class OSGPARTICLE_EXPORT BounceOperator : public DomainOperator
{
public:
BounceOperator()
: DomainOperator(), _friction(1.0f), _resilience(0.0f), _cutoff(0.0f)
{}
BounceOperator( const BounceOperator& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY )
: DomainOperator(copy, copyop),
_friction(copy._friction), _resilience(copy._resilience), _cutoff(copy._cutoff)
{}
META_Object( osgParticle, BounceOperator );
void setFriction( float f ) { _friction = f; }
float getFriction() const { return _friction; }
void setResilience( float r ) { _resilience = r; }
float getResilience() const { return _resilience; }
void setCutoff( float v ) { _cutoff = v; }
float getCutoff() const { return _cutoff; }
protected:
virtual ~BounceOperator() {}
BounceOperator& operator=( const BounceOperator& ) { return *this; }
virtual void handleTriangle( const Domain& domain, Particle* P, double dt );
virtual void handleRectangle( const Domain& domain, Particle* P, double dt );
virtual void handlePlane( const Domain& domain, Particle* P, double dt );
virtual void handleSphere( const Domain& domain, Particle* P, double dt );
virtual void handleDisk( const Domain& domain, Particle* P, double dt );
float _friction;
float _resilience;
float _cutoff;
};
}
#endif
DomainOperator
Particle
osgParticle::BounceOperator::META_Object
META_Object(osgParticle, BounceOperator)
osgParticle::BounceOperator::handleRectangle
virtual void handleRectangle(const Domain &domain, Particle *P, double dt)
osgParticle::BounceOperator::_cutoff
float _cutoff
Definition BounceOperator:72
osgParticle::BounceOperator::~BounceOperator
virtual ~BounceOperator()
Definition BounceOperator:61
osgParticle::BounceOperator::handleSphere
virtual void handleSphere(const Domain &domain, Particle *P, double dt)
osgParticle::BounceOperator::setFriction
void setFriction(float f)
Set the friction.
Definition BounceOperator:43
osgParticle::BounceOperator::setCutoff
void setCutoff(float v)
Set the velocity cutoff factor.
Definition BounceOperator:55
osgParticle::BounceOperator::handleDisk
virtual void handleDisk(const Domain &domain, Particle *P, double dt)
osgParticle::BounceOperator::BounceOperator
BounceOperator(const BounceOperator &copy, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
Definition BounceOperator:35
osgParticle::BounceOperator::handleTriangle
virtual void handleTriangle(const Domain &domain, Particle *P, double dt)
osgParticle::BounceOperator::operator=
BounceOperator & operator=(const BounceOperator &)
Definition BounceOperator:62
osgParticle::BounceOperator::BounceOperator
BounceOperator()
Definition BounceOperator:31
osgParticle::BounceOperator::getFriction
float getFriction() const
Get the friction.
Definition BounceOperator:46
osgParticle::BounceOperator::setResilience
void setResilience(float r)
Set the resilience.
Definition BounceOperator:49
osgParticle::BounceOperator::getCutoff
float getCutoff() const
Get the velocity cutoff factor.
Definition BounceOperator:58
osgParticle::BounceOperator::handlePlane
virtual void handlePlane(const Domain &domain, Particle *P, double dt)
osgParticle::BounceOperator::getResilience
float getResilience() const
Get the velocity cutoff factor.
Definition BounceOperator:52
osgParticle::BounceOperator::_resilience
float _resilience
Definition BounceOperator:71
osgParticle::BounceOperator::_friction
float _friction
Definition BounceOperator:70
osgParticle::DomainOperator::DomainOperator
DomainOperator()
Definition DomainOperator:60
osgParticle::Particle
Definition Particle:47
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osgParticle
Definition AccelOperator:27
OSGPARTICLE_EXPORT
#define OSGPARTICLE_EXPORT
Definition osgParticle/Export:40
osgParticle::DomainOperator::Domain
Definition DomainOperator:34