VR-Forces 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) 2023 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 
23 
24 
25 namespace makVrv
26 {
27  // Forward declarations.
28  class DtWeatherLayerGroup;
29  class osg::Texture2D;
30 
31 
37  class DT_DLL_VRVOSG DtWeatherEffectDrawable : public osg::Drawable
38  {
39  public:
40 
43 
45  DtWeatherEffectDrawable(const DtWeatherEffectDrawable& orig, const osg::CopyOp& opr);
46 
48  virtual ~DtWeatherEffectDrawable();
49 
50  private:
51 
53  DtWeatherEffectDrawable() = delete;
54 
56  DtWeatherEffectDrawable(const DtWeatherEffectDrawable &other) = delete;
57 
59  DtWeatherEffectDrawable &operator=(const DtWeatherEffectDrawable &other) = delete;
60 
61  public:
62 
64  virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new DtWeatherEffectDrawable(*this, copyop); }
65  virtual osg::Object* cloneType() const { return NULL; }
66 
68  virtual bool init();
69 
72  virtual void SetCameraBasis(const osg::Matrixd& basisRot);
73 
77  virtual osg::Texture2D* getTexture(const char* imagePath);
78 
80  virtual void releaseGLObjects(osg::State* state) const;
81 
83  virtual void drawImplementation(osg::RenderInfo& renderInfo) const;
84 
86  virtual void applyState(DtWeatherEffect::DrawData& drawData) const;
87 
89  virtual void applyHeightMap(DtWeatherEffect::DrawData& drawData) const;
90 
91  protected:
92 
94  virtual bool loadShaders();
95 
97  virtual void connectSignals();
98 
100  virtual void slot_reloadShaders();
101 
104  virtual void setupSoftness(osg::Camera* camera) const;
105 
108  virtual float computeNearClip(osg::Camera* camera) const;
109 
111  virtual void clearTextureLibrary() const;
112 
113  protected:
114 
117  {
119  std::string myName;
120  };
121 
124 
126 
129 
130  osg::Matrixd myBasisRot;
131 
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:118
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:46
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
DtSignalConnectionManager myConnections
Definition: DtWeatherEffectDrawable.h:132
std::string myName
Definition: DtWeatherEffectDrawable.h:119
osg::ref_ptr< osg::Uniform > myMutableViewMatrixInvUniform
Definition: DtWeatherEffectDrawable.h:148
Contains makVrv::DtDe class.
osg::Matrixd myBasisRot
Definition: DtWeatherEffectDrawable.h:130
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:64
A structure used to hold data for drawing.
Definition: DtWeatherEffect.h:72
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:37
Contains makVrv::DtWeatherEffect class.
DtWeatherLayerGroup * myWeatherLayerGroup
Definition: DtWeatherEffectDrawable.h:123
osg::ref_ptr< osg::Uniform > myMutableSoftnessUniform
Definition: DtWeatherEffectDrawable.h:142
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
osg::ref_ptr< osg::StateSet > myStateSet
Definition: DtWeatherEffectDrawable.h:128
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:65
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:122
Base class to provide boost signal/slot management.
creator for DtWeatherEffectDrawable
Definition: DtWeatherEffectDrawable.h:156
brief A structure used to hold information about a texture.
Definition: DtWeatherEffectDrawable.h:116
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:72
bool myInitialized
Definition: DtWeatherEffectDrawable.h:125
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:127

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)