SmokeEffect 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 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. #ifndef OSGPARTICLE_SMOKEEFFECT
  14. #define OSGPARTICLE_SMOKEEFFECT
  15. #include <osgParticle/ParticleEffect>
  16. #include <osgParticle/ModularEmitter>
  17. #include <osgParticle/FluidProgram>
  18. namespace osgParticle
  19. {
  20. class OSGPARTICLE_EXPORT SmokeEffect : public ParticleEffect
  21. {
  22. public:
  23. explicit SmokeEffect(bool automaticSetup=true);
  24. SmokeEffect(const osg::Vec3& position, float scale=1.0f, float intensity=1.0f);
  25. SmokeEffect(const SmokeEffect& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
  26. META_Node(osgParticle,SmokeEffect);
  27. virtual void setDefaults();
  28. virtual void setUpEmitterAndProgram();
  29. virtual Emitter* getEmitter() { return _emitter.get(); }
  30. virtual const Emitter* getEmitter() const { return _emitter.get(); }
  31. virtual Program* getProgram() { return _program.get(); }
  32. virtual const Program* getProgram() const { return _program.get(); }
  33. protected:
  34. virtual ~SmokeEffect() {}
  35. osg::ref_ptr<ModularEmitter> _emitter;
  36. osg::ref_ptr<FluidProgram> _program;
  37. };
  38. }
  39. #endif