VR-Forces 4.5 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) 2015 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  void setMaxParticlesToEmit(int max);
112 
114  int maxParticlesToEmit();
115 
117  virtual osg::Vec3 wind() const;
118 
120  virtual void setWind(const osg::Vec3& wind);
121 
123  virtual osg::Vec3 up() const;
124 
126  virtual void setUp(const osg::Vec3& up);
127 
129  virtual void stop();
130 
132  virtual void start();
133 
135  virtual void pause();
136 
138  virtual void resume();
139 
141  virtual void setLoopMode(bool loopOn);
142 
144  virtual void setReverseAnimation(bool reverse);
145 
147  virtual void traverse(osg::NodeVisitor& nv);
148 
150  virtual osg::Node* particleSystemNode();
151 
154  virtual osg::Geode* particleSystemGeode();
155 
159  virtual void setMatrix(const osg::Matrix& mat);
160 
163  void getSizeRange( osgParticle::ParticleSystem* particleSystem, float& min,
164  float& max ) const;
165 
166  protected:
167 
169  virtual void addParent(osg::Group* parent);
170 
173  virtual void setupParticleScalingDefaults( osgParticle::ParticleSystem* ps );
174 
176  virtual void setupParticleLightingDefaults( osgParticle::ParticleSystem* ps );
177 
181  virtual void scaleDefaultParticleSizes( float scale );
182 
184  virtual ~DtParticleEffect();
185 
187  DtParticleEffect(const DtParticleEffect& copy, const osg::CopyOp& copyop);
188 
189  protected:
190 
191  osg::ref_ptr<osg::Group> myEmitterGroup;
192  osg::ref_ptr<osg::Group> myProgramGroup;
193  osg::ref_ptr<osg::Geode> myParticleSystemGeode;
194  osg::ref_ptr<osg::Group> myProxyGroup;
195  osg::ref_ptr<osg::Group> myTransformGroup;
196 
197  std::vector<osg::ref_ptr<osg::Sequence> > mySequences;
200 
201  osg::ref_ptr<osg::MatrixTransform> myParticleSystemTransform;
203 
205  osg::Vec3 myPosition;
206  float myScale;
207  float myIntensity;
208  double myStartTime;
211  osg::Vec3 myWind;
212  osg::Vec3 myUp;
213 
215  {
216  float myMinSize;
217  float myMaxSize;
218  };
219 
220  typedef boost::unordered_map<osgParticle::ParticleSystem*,DefaultParticleParameters> ParticleParametersMap;
221 
223  };
224 }

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)