Show
Ignore:
Timestamp:
04/29/05 11:47:57 (10 years ago)
Author:
robert
Message:

Moved osgParticle across to standard OSG coding style.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgParticle/FluidFrictionOperator.cpp

    r3954 r4121  
    77osgParticle::FluidFrictionOperator::FluidFrictionOperator(): 
    88     Operator(), 
    9      A_(0), 
    10      B_(0), 
    11      density_(0), 
    12      viscosity_(0), 
    13      ovr_rad_(0), 
    14      current_program_(0) 
     9     _coeff_A(0), 
     10     _coeff_B(0), 
     11     _density(0), 
     12     _viscosity(0), 
     13     _ovr_rad(0), 
     14     _current_program(0) 
    1515{ 
    1616    setFluidToAir(); 
    1717} 
    1818 
    19 osgParticle::FluidFrictionOperator::FluidFrictionOperator(const FluidFrictionOperator &copy, const osg::CopyOp &copyop) 
     19osgParticle::FluidFrictionOperator::FluidFrictionOperator(const FluidFrictionOperator& copy, const osg::CopyOp& copyop) 
    2020:    Operator(copy, copyop), 
    21     A_(copy.A_), 
    22     B_(copy.B_), 
    23     density_(copy.density_),  
    24     viscosity_(copy.viscosity_), 
    25     ovr_rad_(copy.ovr_rad_), 
    26     current_program_(0) 
     21    _coeff_A(copy._coeff_A), 
     22    _coeff_B(copy._coeff_B), 
     23    _density(copy._density),  
     24    _viscosity(copy._viscosity), 
     25    _ovr_rad(copy._ovr_rad), 
     26    _current_program(0) 
    2727{ 
    2828} 
    2929 
    30 void osgParticle::FluidFrictionOperator::operate(Particle *P, double dt) 
     30void osgParticle::FluidFrictionOperator::operate(Particle* P, double dt) 
    3131{ 
    32     float r = (ovr_rad_ > 0)? ovr_rad_ : P->getRadius(); 
     32    float r = (_ovr_rad > 0)? _ovr_rad : P->getRadius(); 
    3333    osg::Vec3 v = P->getVelocity()-_wind; 
    3434 
    3535    float vm = v.normalize(); 
    36     float R = A_ * r * vm + B_ * r * r * vm * vm; 
     36    float R = _coeff_A * r * vm + _coeff_B * r * r * vm * vm; 
    3737     
    3838    osg::Vec3 Fr(-R * v.x(), -R * v.y(), -R * v.z()); 
    3939 
    40     if (current_program_->getReferenceFrame() == ModularProgram::RELATIVE_RF) { 
    41         Fr = current_program_->rotateLocalToWorld(Fr); 
     40    if (_current_program->getReferenceFrame() == ModularProgram::RELATIVE_RF) { 
     41        Fr = _current_program->rotateLocalToWorld(Fr); 
    4242    } 
    4343