VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgParticleSystemEffect.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2022 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 <unordered_map>
17 
18 namespace osgParticle
19 {
20  class ParticleSystem;
21 }
22 
23 namespace makVrv
24 {
25  class DtImprovedModularEmitter;
26 
31  class DT_DLL_VRVOSG DtOsgParticleSystemEffect : 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() const;
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 
127  virtual void setIsRotorWash(bool isRotorWash);
128 
132  virtual bool isRotorWash();
133 
136  virtual void setRotorDiameter(double diameter);
137 
140  virtual double rotorDiameter() const;
141 
144  virtual void setRotorWindSpeed(double speed);
145 
148  virtual double rotorWindSpeed() const;
149 
151  virtual osg::Vec3 up() const;
152 
154  virtual void setUp(const osg::Vec3& up);
155 
157  virtual void stop();
158 
160  virtual void start();
161 
163  virtual void pause();
164 
166  virtual void resume();
167 
169  virtual void setLoopMode(bool loopOn);
170 
172  virtual void setReverseAnimation(bool reverse);
173 
175  virtual void traverse(osg::NodeVisitor& nv);
176 
178  virtual osg::Node* particleSystemNode();
179 
182  virtual osg::Geode* particleSystemGeode();
183 
187  virtual void setMatrix(const osg::Matrix& mat);
188 
191  void getSizeRange( osgParticle::ParticleSystem* particleSystem, float& min,
192  float& max ) const;
193 
194  protected:
195 
197  virtual void addParent(osg::Group* parent);
198 
201  virtual void setupParticleScalingDefaults( osgParticle::ParticleSystem* ps );
202 
204  virtual void setupParticleLightingDefaults( osgParticle::ParticleSystem* ps );
205 
209  virtual void scaleDefaultParticleSizes( float scale );
210 
212  virtual ~DtOsgParticleSystemEffect();
213 
215  DtOsgParticleSystemEffect(const DtOsgParticleSystemEffect& copy, const osg::CopyOp& copyop);
216 
217  protected:
218 
224 
225  std::vector<osg::ref_ptr<osg::Sequence> > mySequences;
228 
231 
233  osg::Vec3 myPosition;
234  float myScale;
235  float myIntensity;
236  double myStartTime;
239  osg::Vec3 myWind;
240  osg::Vec3 myUp;
244 
246  {
247  float myMinSize;
248  float myMaxSize;
249  };
250 
251  typedef std::unordered_map<osgParticle::ParticleSystem*,DefaultParticleParameters> ParticleParametersMap;
252 
254  };
255 }
float myIntensity
Get the name of the object&#39;s class.
Definition: DtOsgParticleSystemEffect.h:235
float myRotorDiameter
Get the name of the object&#39;s class.
Definition: DtOsgParticleSystemEffect.h:242
double myEmitterDuration
Get the name of the object&#39;s class.
Definition: DtOsgParticleSystemEffect.h:237
osg::Vec3 myWind
Get the name of the object&#39;s class.
Definition: DtOsgParticleSystemEffect.h:239
osg::ref_ptr< osg::Group > myProxyGroup
Get the name of the object&#39;s class.
Definition: DtOsgParticleSystemEffect.h:222
DT_DLL_tdbutil void ps(int indent_level)
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
std::vector< osg::ref_ptr< osg::Sequence > > mySequences
Get the name of the object&#39;s class.
Definition: DtOsgParticleSystemEffect.h:225
float myScale
Get the name of the object&#39;s class.
Definition: DtOsgParticleSystemEffect.h:234
osg::Vec3 myPosition
Get the name of the object&#39;s class.
Definition: DtOsgParticleSystemEffect.h:233
osg::ref_ptr< osg::Group > myEmitterGroup
Get the name of the object&#39;s class.
Definition: DtOsgParticleSystemEffect.h:219
osg::ref_ptr< osg::Group > myTransformGroup
Get the name of the object&#39;s class.
Definition: DtOsgParticleSystemEffect.h:223
double myStartTime
Get the name of the object&#39;s class.
Definition: DtOsgParticleSystemEffect.h:236
float myRotorWindSpeed
Get the name of the object&#39;s class.
Definition: DtOsgParticleSystemEffect.h:243
Definition: DtOsgParticleSystemEffect.h:245
bool myIsRotorWash
Get the name of the object&#39;s class.
Definition: DtOsgParticleSystemEffect.h:241
osg::ref_ptr< osg::Geode > myParticleSystemGeode
Get the name of the object&#39;s class.
Definition: DtOsgParticleSystemEffect.h:221
int myMaxParticlesToEmit
Get the name of the object&#39;s class.
Definition: DtOsgParticleSystemEffect.h:238
std::unordered_map< osgParticle::ParticleSystem *, DefaultParticleParameters > ParticleParametersMap
Get the name of the object&#39;s class.
Definition: DtOsgParticleSystemEffect.h:251
ParticleParametersMap myDefaultParticleParameters
Get the name of the object&#39;s class.
Definition: DtOsgParticleSystemEffect.h:253
bool myTransformsSet
Get the name of the object&#39;s class.
Definition: DtOsgParticleSystemEffect.h:230
bool mySequencesReverse
Get the name of the object&#39;s class.
Definition: DtOsgParticleSystemEffect.h:227
float myMaxSize
Definition: DtOsgParticleSystemEffect.h:248
osg::ref_ptr< osg::Group > myProgramGroup
Get the name of the object&#39;s class.
Definition: DtOsgParticleSystemEffect.h:220
bool myUseLocalParticleSystem
Get the name of the object&#39;s class.
Definition: DtOsgParticleSystemEffect.h:232
Contains DLL export macros.
This class provides a facade around the osgParticle class hierarchy. It is comparable with osgParticl...
Definition: DtOsgParticleSystemEffect.h:31
osg::Vec3 myUp
Get the name of the object&#39;s class.
Definition: DtOsgParticleSystemEffect.h:240
float myMinSize
Definition: DtOsgParticleSystemEffect.h:247
osg::ref_ptr< osg::MatrixTransform > myParticleSystemTransform
Get the name of the object&#39;s class.
Definition: DtOsgParticleSystemEffect.h:229
bool mySequencesLooping
Get the name of the object&#39;s class.
Definition: DtOsgParticleSystemEffect.h:226

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)