VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtWeatherEffectDrawable.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <osg/Camera>
13 #include <osg/Drawable>
14 
15 #include <vrvCore/DtDe.h>
16 
17 #include <vrvOsg/DtWeatherEffect.h>
19 #include <vrvOsg/vrvOsg.h>
20 
22 
23 
24 namespace makVrv
25 {
26  // Forward declarations.
27  class DtWeatherLayerGroup;
28  class osg::Texture2D;
29 
30 
36  class DT_DLL_VRVOSG DtWeatherEffectDrawable : public osg::Drawable
37  {
38  public:
39 
42 
44  DtWeatherEffectDrawable(const DtWeatherEffectDrawable& orig, const osg::CopyOp& opr);
45 
47  virtual ~DtWeatherEffectDrawable();
48 
49  private:
50 
52  DtWeatherEffectDrawable() = delete;
53 
55  DtWeatherEffectDrawable(const DtWeatherEffectDrawable &other) = delete;
56 
58  DtWeatherEffectDrawable &operator=(const DtWeatherEffectDrawable &other) = delete;
59 
60  public:
61 
63  virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new DtWeatherEffectDrawable(*this, copyop); }
64  virtual osg::Object* cloneType() const { return NULL; }
65 
67  virtual bool init();
68 
71  virtual void SetCameraBasis(const osg::Matrixd& basisRot);
72 
75  virtual void SetCulled(bool culled);
76 
80  virtual osg::Texture2D* getTexture(const char* imagePath);
81 
83  virtual void releaseGLObjects(osg::State* state) const;
84 
86  virtual void drawImplementation(osg::RenderInfo& renderInfo) const;
87 
89  virtual void applyState(DtWeatherEffect::DrawData& drawData) const;
90 
92  virtual void applyHeightMap(DtWeatherEffect::DrawData& drawData) const;
93 
94  protected:
95 
97  virtual bool loadShaders();
98 
100  virtual void connectSignals();
101 
103  virtual void disconnectSignals();
104 
106  virtual void slot_reloadShaders();
107 
110  virtual void setupSoftness(osg::Camera* camera) const;
111 
114  virtual float computeNearClip(osg::Camera* camera) const;
115 
117  virtual void clearTextureLibrary() const;
118 
119  protected:
120 
123  {
125  std::string myName;
126  };
127 
130 
132 
135 
136  osg::Matrixd myBasisRot;
137 
138  bool myCulled;
139 
140  private:
141 
149 
150  // weather effect specific
155 
157  mutable std::vector<TextureEntry*> myTextureLibrary;
158  };
159 
160 
163  {
164  public:
167 
170 
171  private:
176 
177  public:
179  virtual DtWeatherEffectDrawable* create(DtWeatherLayerGroup* weatherLayerGroup) const;
180 
183  static DtWeatherEffectDrawableCreator& instance(DtDe& de);
184 
186  static const std::string& theClassName();
187 
188  protected:
190  };
191 }
192 
193 
194 
osg::ref_ptr< osg::Uniform > myMutableIsReflectionUniform
Definition: DtWeatherEffectDrawable.h:147
DT_DLL_EXAMPLESCENEROOTPLUGIN void init(DtDe &anIG)
osg::ref_ptr< osg::Uniform > myMutablePersMatrixUniform
Definition: DtWeatherEffectDrawable.h:145
osg::ref_ptr< osg::Texture2D > myTexture
Definition: DtWeatherEffectDrawable.h:124
Virtual base class.
Definition: DtVirtualBaseClass.h:19
A group node which serves as a root for weather layers.
Definition: DtWeatherLayerGroup.h:48
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
std::string myName
Definition: DtWeatherEffectDrawable.h:125
osg::ref_ptr< osg::Uniform > myMutableViewMatrixInvUniform
Definition: DtWeatherEffectDrawable.h:154
Contains makVrv::DtDe class.
osg::Matrixd myBasisRot
Definition: DtWeatherEffectDrawable.h:136
DtDe & myDe
Definition: DtWeatherEffectDrawable.h:189
virtual osg::Object * clone(const osg::CopyOp &copyop) const
required functions for derriving from osg::Drawable
Definition: DtWeatherEffectDrawable.h:63
A structure used to hold data for drawing.
Definition: DtWeatherEffect.h:48
Contains makVrv::DtOsgCullVisitor class.
osg::ref_ptr< osg::Uniform > myMutableModelAxisZUniform
Definition: DtWeatherEffectDrawable.h:153
Contains makVrv::DtVirtualBaseClass class.
A drawable for drawing weather effects such as hail.
Definition: DtWeatherEffectDrawable.h:36
Contains makVrv::DtWeatherEffect class.
DtWeatherLayerGroup * myWeatherLayerGroup
Definition: DtWeatherEffectDrawable.h:129
osg::ref_ptr< osg::Uniform > myMutableSoftnessUniform
Definition: DtWeatherEffectDrawable.h:148
osg::ref_ptr< osg::StateSet > myStateSet
Definition: DtWeatherEffectDrawable.h:134
osg::ref_ptr< osg::Uniform > myMutableInvPersMatrixUniform
needed for smoothness These are mutable because they are used as part of the const drawImplementation...
Definition: DtWeatherEffectDrawable.h:144
virtual osg::Object * cloneType() const
Definition: DtWeatherEffectDrawable.h:64
std::vector< TextureEntry * > myTextureLibrary
This is mutable because it&#39;s used as part of the const releaseGLObjects.
Definition: DtWeatherEffectDrawable.h:157
DtDe & myDe
Definition: DtWeatherEffectDrawable.h:128
creator for DtWeatherEffectDrawable
Definition: DtWeatherEffectDrawable.h:162
brief A structure used to hold information about a texture.
Definition: DtWeatherEffectDrawable.h:122
osg::ref_ptr< osg::Uniform > myMutableViewportUniform
Definition: DtWeatherEffectDrawable.h:146
Contains DLL export macros.
bool myCulled
Definition: DtWeatherEffectDrawable.h:138
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
bool myInitialized
Definition: DtWeatherEffectDrawable.h:131
osg::ref_ptr< osg::Uniform > myMutableModelAxisXUniform
These are mutable because they are used as part of the const drawImplementation.
Definition: DtWeatherEffectDrawable.h:152
osg::ref_ptr< osg::Texture2D > myTexture
Definition: DtWeatherEffectDrawable.h:133

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)