VR-Forces 5.0.1 Developer's Guide
 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) 2021 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 
76  virtual osg::Texture2D* getTexture(const char* imagePath);
77 
79  virtual void releaseGLObjects(osg::State* state) const;
80 
82  virtual void drawImplementation(osg::RenderInfo& renderInfo) const;
83 
85  virtual void applyState(DtWeatherEffect::DrawData& drawData) const;
86 
88  virtual void applyHeightMap(DtWeatherEffect::DrawData& drawData) const;
89 
90  protected:
91 
93  virtual bool loadShaders();
94 
96  virtual void connectSignals();
97 
99  virtual void disconnectSignals();
100 
102  virtual void slot_reloadShaders();
103 
106  virtual void setupSoftness(osg::Camera* camera) const;
107 
110  virtual float computeNearClip(osg::Camera* camera) const;
111 
113  virtual void clearTextureLibrary() const;
114 
115  protected:
116 
119  {
121  std::string myName;
122  };
123 
126 
128 
131 
132  osg::Matrixd myBasisRot;
133 
134  private:
135 
143 
144  // weather effect specific
149 
151  mutable std::vector<TextureEntry*> myTextureLibrary;
152  };
153 
154 
157  {
158  public:
161 
164 
165  private:
170 
171  public:
173  virtual DtWeatherEffectDrawable* create(DtWeatherLayerGroup* weatherLayerGroup) const;
174 
177  static DtWeatherEffectDrawableCreator& instance(DtDe& de);
178 
180  static const std::string& theClassName();
181 
182  protected:
184  };
185 }
186 
187 
188 
osg::ref_ptr< osg::Uniform > myMutableIsReflectionUniform
Definition: DtWeatherEffectDrawable.h:141
DT_DLL_EXAMPLESCENEROOTPLUGIN void init(DtDe &anIG)
osg::ref_ptr< osg::Uniform > myMutablePersMatrixUniform
Definition: DtWeatherEffectDrawable.h:139
osg::ref_ptr< osg::Texture2D > myTexture
Definition: DtWeatherEffectDrawable.h:120
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
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:121
osg::ref_ptr< osg::Uniform > myMutableViewMatrixInvUniform
Definition: DtWeatherEffectDrawable.h:148
Contains makVrv::DtDe class.
osg::Matrixd myBasisRot
Definition: DtWeatherEffectDrawable.h:132
DtDe & myDe
Definition: DtWeatherEffectDrawable.h:183
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:147
Contains makVrv::DtVirtualBaseClass class.
A drawable for drawing weather effects such as hail. The class serves as a place to setup common stat...
Definition: DtWeatherEffectDrawable.h:36
Contains makVrv::DtWeatherEffect class.
DtWeatherLayerGroup * myWeatherLayerGroup
Definition: DtWeatherEffectDrawable.h:125
osg::ref_ptr< osg::Uniform > myMutableSoftnessUniform
Definition: DtWeatherEffectDrawable.h:142
osg::ref_ptr< osg::StateSet > myStateSet
Definition: DtWeatherEffectDrawable.h:130
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:138
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:151
DtDe & myDe
Definition: DtWeatherEffectDrawable.h:124
creator for DtWeatherEffectDrawable
Definition: DtWeatherEffectDrawable.h:156
brief A structure used to hold information about a texture.
Definition: DtWeatherEffectDrawable.h:118
osg::ref_ptr< osg::Uniform > myMutableViewportUniform
Definition: DtWeatherEffectDrawable.h:140
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:70
bool myInitialized
Definition: DtWeatherEffectDrawable.h:127
osg::ref_ptr< osg::Uniform > myMutableModelAxisXUniform
These are mutable because they are used as part of the const drawImplementation.
Definition: DtWeatherEffectDrawable.h:146
osg::ref_ptr< osg::Texture2D > myTexture
Definition: DtWeatherEffectDrawable.h:129

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)