VR-Forces 4.1.1 Class Documentation
DtParticleEffect.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
9 #pragma once
10 
11 #include <vrvOsg/vrvOsg.h>
12 #include <osg/MatrixTransform>
13 #include <osg/Geode>
14 #include <osg/Sequence>
15 
16 #include <boost/unordered_map.hpp>
17 
18 namespace osgParticle
19 {
20  class ParticleSystem;
21 }
22 
23 namespace makVrv
24 {
25  class DtImprovedModularEmitter;
26 
31  class DT_DLL_VRVOSG DtParticleEffect : public osg::MatrixTransform
32  {
33  public:
36 
37  //@ {
40  virtual const char* libraryName() const;
41 
43  virtual const char* className() const;
44 
46  virtual bool isSameKindAs(const osg::Object* obj) const;
47 
48  virtual void accept(osg::NodeVisitor& v);
49  //@ }
50 
52  virtual osg::Group* emitterGroup();
53 
55  virtual osg::Group* programGroup();
56 
58  virtual osg::Group* proxyGroup();
59 
62  virtual osg::Group* transformGroup();
63 
65  virtual void setUpEmittersAndPrograms() = 0;
66 
68  virtual void buildEffect();
69 
71  virtual bool useLocalParticleSystem();
72 
75  virtual void setUseLocalParticleSystem(bool b);
76 
78  virtual float scale();
79 
83  virtual void setScale(float scale);
84 
86  virtual float intensity();
87 
90  virtual void setIntensity(float intensity);
91 
93  virtual double startTime();
94 
96  virtual void setStartTime(double startTime);
97 
99  virtual double emitterDuration();
100 
104  virtual void setEmitterDuration(double emitterDuration);
105 
108  virtual double particleLifetime();
109 
111  virtual osg::Vec3 wind();
112 
115  virtual void setWind(const osg::Vec3 wind);
116 
118  virtual void stop();
119 
121  virtual void start();
122 
124  virtual void pause();
125 
127  virtual void resume();
128 
130  virtual void setLoopMode(bool loopOn);
131 
133  virtual void setReverseAnimation(bool reverse);
134 
136  virtual void traverse(osg::NodeVisitor& nv);
137 
139  virtual osg::Node* particleSystemNode();
140 
143  virtual osg::Geode* particleSystemGeode();
144 
148  virtual void setMatrix(const osg::Matrix& mat);
149 
152  void getSizeRange( osgParticle::ParticleSystem* particleSystem, float& min,
153  float& max ) const;
154 
155  protected:
156 
158  virtual void addParent(osg::Group* parent);
159 
162  virtual void setupParticleScalingDefaults( osgParticle::ParticleSystem* ps );
163 
167  virtual void scaleDefaultParticleSizes( float scale );
168 
170  virtual ~DtParticleEffect();
171 
173  DtParticleEffect(const DtParticleEffect& copy, const osg::CopyOp& copyop);
174 
175  protected:
176 
177  osg::ref_ptr<osg::Group> myEmitterGroup;
178  osg::ref_ptr<osg::Group> myProgramGroup;
179  osg::ref_ptr<osg::Geode> myParticleSystemGeode;
180  osg::ref_ptr<osg::Group> myProxyGroup;
181  osg::ref_ptr<osg::Group> myTransformGroup;
182 
183  std::vector<osg::ref_ptr<osg::Sequence> > mySequences;
186 
187  osg::ref_ptr<osg::MatrixTransform> myParticleSystemTransform;
189 
191  osg::Vec3 myPosition;
192  float myScale;
193  float myIntensity;
194  double myStartTime;
196  osg::Vec3 myWind;
197 
199  {
200  float myMinSize;
201  float myMaxSize;
202  };
203 
204  typedef boost::unordered_map<osgParticle::ParticleSystem*,DefaultParticleParameters> ParticleParametersMap;
205 
207  };
208 }

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)