OpenSceneGraph 3.6.5
BounceOperator
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2010 Robert Osfield
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
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13// Written by Wang Rui, (C) 2010
14
15#ifndef OSGPARTICLE_BOUNCEOPERATOR
16#define OSGPARTICLE_BOUNCEOPERATOR
17
18#include <osgParticle/Particle>
20
21namespace osgParticle
22{
23
24
29{
30public:
32 : DomainOperator(), _friction(1.0f), _resilience(0.0f), _cutoff(0.0f)
33 {}
34
36 : DomainOperator(copy, copyop),
38 {}
39
41
43 void setFriction( float f ) { _friction = f; }
44
46 float getFriction() const { return _friction; }
47
49 void setResilience( float r ) { _resilience = r; }
50
52 float getResilience() const { return _resilience; }
53
55 void setCutoff( float v ) { _cutoff = v; }
56
58 float getCutoff() const { return _cutoff; }
59
60protected:
61 virtual ~BounceOperator() {}
62 BounceOperator& operator=( const BounceOperator& ) { return *this; }
63
64 virtual void handleTriangle( const Domain& domain, Particle* P, double dt );
65 virtual void handleRectangle( const Domain& domain, Particle* P, double dt );
66 virtual void handlePlane( const Domain& domain, Particle* P, double dt );
67 virtual void handleSphere( const Domain& domain, Particle* P, double dt );
68 virtual void handleDisk( const Domain& domain, Particle* P, double dt );
69
70 float _friction;
72 float _cutoff;
73};
74
75
76}
77
78#endif
The osgParticle library is a NodeKit that extends the core scene graph to support particle effects.
Definition AccelOperator:27
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
META_Object(osgParticle, BounceOperator)
virtual void handleRectangle(const Domain &domain, Particle *P, double dt)
float _cutoff
Definition BounceOperator:72
virtual ~BounceOperator()
Definition BounceOperator:61
virtual void handleSphere(const Domain &domain, Particle *P, double dt)
void setFriction(float f)
Set the friction.
Definition BounceOperator:43
void setCutoff(float v)
Set the velocity cutoff factor.
Definition BounceOperator:55
virtual void handleDisk(const Domain &domain, Particle *P, double dt)
BounceOperator(const BounceOperator &copy, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
Definition BounceOperator:35
virtual void handleTriangle(const Domain &domain, Particle *P, double dt)
BounceOperator & operator=(const BounceOperator &)
Definition BounceOperator:62
BounceOperator()
Definition BounceOperator:31
float getFriction() const
Get the friction.
Definition BounceOperator:46
void setResilience(float r)
Set the resilience.
Definition BounceOperator:49
float getCutoff() const
Get the velocity cutoff factor.
Definition BounceOperator:58
virtual void handlePlane(const Domain &domain, Particle *P, double dt)
float getResilience() const
Get the velocity cutoff factor.
Definition BounceOperator:52
float _resilience
Definition BounceOperator:71
float _friction
Definition BounceOperator:70
DomainOperator()
Definition DomainOperator:60
Definition DomainOperator:34
Implementation of a particle.
Definition Particle:47
#define OSGPARTICLE_EXPORT
Definition Export:40

osg logo
Generated at Sun Jul 27 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.