Ran script to remove trailing spaces and tabs
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 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
|
||||
* 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
//osgParticle - Copyright (C) 2002 Marco Jez
|
||||
@@ -25,62 +25,62 @@
|
||||
namespace osgParticle
|
||||
{
|
||||
|
||||
class Particle;
|
||||
class Particle;
|
||||
|
||||
/** An operator that simulates the friction of a fluid.
|
||||
By using this operator you can let the particles move in a fluid of a given <I>density</I>
|
||||
and <I>viscosity</I>. There are two functions to quickly setup the parameters for pure water
|
||||
and air. You can decide whether to compute the forces using the particle's physical
|
||||
and air. You can decide whether to compute the forces using the particle's physical
|
||||
radius or another value, by calling the <CODE>setOverrideRadius()</CODE> method.
|
||||
*/
|
||||
class OSGPARTICLE_EXPORT FluidFrictionOperator: public Operator {
|
||||
public:
|
||||
|
||||
|
||||
FluidFrictionOperator();
|
||||
FluidFrictionOperator(const FluidFrictionOperator& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
|
||||
|
||||
|
||||
META_Object(osgParticle, FluidFrictionOperator);
|
||||
|
||||
|
||||
/// Set the density of the fluid.
|
||||
inline void setFluidDensity(float d);
|
||||
|
||||
/// Get the density of the fluid.
|
||||
inline float getFluidDensity() const;
|
||||
|
||||
|
||||
/// Set the viscosity of the fluid.
|
||||
inline void setFluidViscosity(float v);
|
||||
|
||||
|
||||
/// Get the viscosity of the fluid.
|
||||
inline float getFluidViscosity() const;
|
||||
|
||||
|
||||
/// Set the wind vector.
|
||||
inline void setWind(const osg::Vec3& wind) { _wind = wind; }
|
||||
|
||||
|
||||
/// Get the wind vector.
|
||||
inline const osg::Vec3& getWind() const { return _wind; }
|
||||
|
||||
|
||||
/// Set the overriden radius value (pass 0 if you want to use particle's radius).
|
||||
inline void setOverrideRadius(float r);
|
||||
|
||||
/// Get the overriden radius value.
|
||||
inline float getOverrideRadius() const;
|
||||
|
||||
inline float getOverrideRadius() const;
|
||||
|
||||
/// Set the fluid parameters as for air (20<32>C temperature).
|
||||
inline void setFluidToAir();
|
||||
|
||||
|
||||
/// Set the fluid parameters as for pure water (20<32>C temperature).
|
||||
inline void setFluidToWater();
|
||||
|
||||
|
||||
/// Apply the friction forces to a particle. Do not call this method manually.
|
||||
void operate(Particle* P, double dt);
|
||||
|
||||
|
||||
/// Perform some initializations. Do not call this method manually.
|
||||
inline void beginOperate(Program* prg);
|
||||
|
||||
|
||||
protected:
|
||||
virtual ~FluidFrictionOperator() {}
|
||||
FluidFrictionOperator &operator=(const FluidFrictionOperator &) { return *this; }
|
||||
|
||||
|
||||
private:
|
||||
float _coeff_A;
|
||||
float _coeff_B;
|
||||
@@ -90,9 +90,9 @@ namespace osgParticle
|
||||
osg::Vec3 _wind;
|
||||
Program* _current_program;
|
||||
};
|
||||
|
||||
|
||||
// INLINE FUNCTIONS
|
||||
|
||||
|
||||
inline float FluidFrictionOperator::getFluidDensity() const
|
||||
{
|
||||
return _density;
|
||||
@@ -102,7 +102,7 @@ namespace osgParticle
|
||||
{
|
||||
return _viscosity;
|
||||
}
|
||||
|
||||
|
||||
inline void FluidFrictionOperator::setFluidDensity(float d)
|
||||
{
|
||||
_density = d;
|
||||
@@ -114,7 +114,7 @@ namespace osgParticle
|
||||
_viscosity = v;
|
||||
_coeff_A = 6 * osg::PI * _viscosity;
|
||||
}
|
||||
|
||||
|
||||
inline void FluidFrictionOperator::setFluidToAir()
|
||||
{
|
||||
setFluidViscosity(1.8e-5f);
|
||||
@@ -126,17 +126,17 @@ namespace osgParticle
|
||||
setFluidViscosity(1.002e-3f);
|
||||
setFluidDensity(1.0f);
|
||||
}
|
||||
|
||||
|
||||
inline float FluidFrictionOperator::getOverrideRadius() const
|
||||
{
|
||||
return _ovr_rad;
|
||||
}
|
||||
|
||||
|
||||
inline void FluidFrictionOperator::setOverrideRadius(float r)
|
||||
{
|
||||
_ovr_rad = r;
|
||||
}
|
||||
|
||||
|
||||
inline void FluidFrictionOperator::beginOperate(Program* prg)
|
||||
{
|
||||
_current_program = prg;
|
||||
|
||||
Reference in New Issue
Block a user