VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtParticleEffect.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2013 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() const;
112 
114  virtual void setWind(const osg::Vec3 wind);
115 
117  virtual osg::Vec3 up() const;
118 
120  virtual void setUp(const osg::Vec3 up);
121 
123  virtual void stop();
124 
126  virtual void start();
127 
129  virtual void pause();
130 
132  virtual void resume();
133 
135  virtual void setLoopMode(bool loopOn);
136 
138  virtual void setReverseAnimation(bool reverse);
139 
141  virtual void traverse(osg::NodeVisitor& nv);
142 
144  virtual osg::Node* particleSystemNode();
145 
148  virtual osg::Geode* particleSystemGeode();
149 
153  virtual void setMatrix(const osg::Matrix& mat);
154 
157  void getSizeRange( osgParticle::ParticleSystem* particleSystem, float& min,
158  float& max ) const;
159 
160  protected:
161 
163  virtual void addParent(osg::Group* parent);
164 
167  virtual void setupParticleScalingDefaults( osgParticle::ParticleSystem* ps );
168 
170  virtual void setupParticleLightingDefaults( osgParticle::ParticleSystem* ps );
171 
175  virtual void scaleDefaultParticleSizes( float scale );
176 
178  virtual ~DtParticleEffect();
179 
181  DtParticleEffect(const DtParticleEffect& copy, const osg::CopyOp& copyop);
182 
183  protected:
184 
185  osg::ref_ptr<osg::Group> myEmitterGroup;
186  osg::ref_ptr<osg::Group> myProgramGroup;
187  osg::ref_ptr<osg::Geode> myParticleSystemGeode;
188  osg::ref_ptr<osg::Group> myProxyGroup;
189  osg::ref_ptr<osg::Group> myTransformGroup;
190 
191  std::vector<osg::ref_ptr<osg::Sequence> > mySequences;
194 
195  osg::ref_ptr<osg::MatrixTransform> myParticleSystemTransform;
197 
199  osg::Vec3 myPosition;
200  float myScale;
201  float myIntensity;
202  double myStartTime;
204  osg::Vec3 myWind;
205  osg::Vec3 myUp;
206 
208  {
209  float myMinSize;
210  float myMaxSize;
211  };
212 
213  typedef boost::unordered_map<osgParticle::ParticleSystem*,DefaultParticleParameters> ParticleParametersMap;
214 
216  };
217 }

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)