VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtTacticalSmokeEffect.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2019 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
14 #include <osg/CopyOp>
15 #include <osg/MatrixTransform>
16 #include <osg/Object>
17 #include <osg/Vec3d>
18 #include <osg/Vec4>
19 
20 #include <string>
21 
22 namespace osgParticle {
23  class Counter;
24  class ModularEmitter;
25  class Particle;
26  class ParticleSystem;
27  class Placer;
28  class Shooter;
29 }
30 
31 
32 namespace makVrv
33 {
34  class DtTacticalSmokeEmitter;
35  class DtTranslateOperator;
36  class DtDe;
37 
52  class DT_DLL_VRVOSG DtTacticalSmokeEffect : public osg::MatrixTransform
53  {
54  public:
55 
58 
63  const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
64 
65  //Slightly modified osg macro META_NODE results so that we can have a de passed into the constructor.
66  virtual osg::Object* cloneType() const { return new DtTacticalSmokeEffect (myDe); }
67  virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new DtTacticalSmokeEffect(*this, copyop); }
68  virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const DtTacticalSmokeEffect *>(obj) != NULL; }
69  virtual const char* className() const { return "DtTacticalSmokeEffect"; }
70  virtual const char* libraryName() const { return "makVrv"; }
71  virtual void accept(osg::NodeVisitor& nv) { if (nv.validNodeMask(*this)) { nv.pushOntoNodePath(this); nv.apply(*this); nv.popFromNodePath(); } }
72 
75  osg::MatrixTransform* particleTransform();
76  const osg::MatrixTransform* particleTransform() const;
77 
80  DtTacticalSmokeEmitter* particleEmitter();
81  const DtTacticalSmokeEmitter* particleEmitter() const;
82 
85  osgParticle::Shooter* particleShooter();
86  const osgParticle::Shooter* particleShooter() const;
87 
90  osgParticle::Placer* particlePlacer();
91  const osgParticle::Placer* particlePlacer() const;
92 
95  osgParticle::Counter* particleCounter();
96  const osgParticle::Counter* particleCounter() const;
97 
100  osgParticle::ParticleSystem* particleSystem();
101  const osgParticle::ParticleSystem* particleSystem() const;
102 
105  osgParticle::Particle& particleTemplate();
106  const osgParticle::Particle& particleTemplate() const;
107 
110  DtTranslateOperator* particleOperator();
111  const DtTranslateOperator* particleOperator() const;
112 
122  void setParticleSpeed(double speed);
123 
133  void setParticleLifetime(double life);
134 
140  void setOneSigmaDistance(int puffIndex, const osg::Vec3d& dist);
141 
146  void setDensity(int puffIndex, double dens);
147 
151  void setPlacement(int puffIndex, const osg::Vec3d& pos);
152 
157  void setEmitterLifetime(double life);
158 
164  void setParticleSizeRange(double isz, double fsz);
165 
172  void setParticleRotationRange(double mn, double mx);
173 
179  void setParticleColorRange(const osg::Vec4& icl, const osg::Vec4& fcl);
180 
186  void setParticleAlphaMultiplier(double alpha);
187 
193  void setIntensityRange(double mn, double mx);
194 
198  void setWind(const osg::Vec3d& wnd);
199 
202  void setTexture(const std::string& txt);
203 
206  void start();
207 
210  void stop();
211 
214  void pause();
215 
218  void resume();
219 
221  void setDefaults();
222 
226  virtual void traverse(osg::NodeVisitor& nv);
227 
228  protected:
230  void initialize();
231 
233  virtual ~DtTacticalSmokeEffect();
234 
235  private:
240 
242  std::string myTexture;
244  };
245 
246 }
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
virtual bool isSameKindAs(const osg::Object *obj) const
Definition: DtTacticalSmokeEffect.h:68
An emitter class that manages and emits several particles.
Definition: DtTacticalSmokeEmitter.h:30
osg::ref_ptr< DtTacticalSmokeEmitter > myEmitter
Definition: DtTacticalSmokeEffect.h:238
DtDe & myDe
Definition: DtTacticalSmokeEffect.h:243
bool myTransformIsSet
Definition: DtTacticalSmokeEffect.h:241
A particle operator to simply translate the particles each frame.
Definition: DtTranslateOperator.h:43
virtual osg::Object * cloneType() const
Definition: DtTacticalSmokeEffect.h:66
virtual osg::Object * clone(const osg::CopyOp &copyop) const
Definition: DtTacticalSmokeEffect.h:67
osg::ref_ptr< osg::MatrixTransform > myParticleTransform
Definition: DtTacticalSmokeEffect.h:236
virtual const char * className() const
Definition: DtTacticalSmokeEffect.h:69
osg::ref_ptr< osgParticle::ParticleSystem > myParticleSystem
Definition: DtTacticalSmokeEffect.h:237
Contains DLL export macros.
std::string myTexture
Definition: DtTacticalSmokeEffect.h:242
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
virtual const char * libraryName() const
Definition: DtTacticalSmokeEffect.h:70
A particle system for creating a single puff of smoke with a normal (or Gaussian) distribution of par...
Definition: DtTacticalSmokeEffect.h:52
osg::ref_ptr< DtTranslateOperator > myWindOperator
Definition: DtTacticalSmokeEffect.h:239
virtual void accept(osg::NodeVisitor &nv)
Definition: DtTacticalSmokeEffect.h:71

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)