VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtTritonPlanarReflectionManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2019 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvTriton/vrvTriton.h>
15 
17 
18 #include <matrix/vlVector.h>
19 
20 #include <osg/ref_ptr>
21 #include <osg/observer_ptr>
22 #include <osg/Plane>
23 #include <osg/Matrixd>
24 #include <osg/Matrixf>
25 
26 namespace osg
27 {
28  class RenderInfo;
29 }
30 
31 namespace makVrv
32 {
33  class DtDe;
34  class DtTritonDrawable;
35  class DtOsgRenderer;
36 
39  {
40  protected:
41  typedef osg::observer_ptr< osg::Camera > CameraObserverPtr;
43  typedef std::map< CameraObserverPtr, PlanarReflectionRef > MapCameraObserverPtrsToPlanarReflection;
44 
45  public:
46  // destructor
48 
49  protected:
54 
55  private:
62 
63  public:
65  virtual void setMaxReflectionWindSpeed(double metersPerSecond);
66 
68  virtual void setPlanarReflectionsEnabled(bool enabled);
70  virtual bool planarReflectionsEnabled(void) const;
72 
74  virtual void enableReflections(bool enabled);
75 
77  virtual void removeAllPlanarReflections();
78 
82  virtual DtPlanarReflection* getOrCreatePlanarReflection(osg::RenderInfo& renderInfo);
83 
88  virtual DtPlanarReflection* getPlanarReflection(osg::Camera* camera);
89 
91  virtual void updateReflectionBlend(const osg::Vec3& currentPosition);
92 
94  virtual void updateReflectionMatrix(const osg::Vec3& currentPosition);
95 
97  virtual void updateReflectionBlendAndMatrix(const osg::Vec3& currentPosition);
98 
100  virtual const osg::Matrixd& reflectionMatrix(void) const;
101 
103  virtual const osg::Plane& reflectionPlane(void) const;
104 
106  virtual float reflectionBlend(void) const;
107 
109  virtual bool planarReflectionsFlag(void) const;
110 
112  virtual int numPlanarReflectionCameras(void) const;
113 
116  virtual osg::ref_ptr<osg::Camera> planarReflectionCamera(int index) const;
117 
120  virtual DtPlanarReflection* planarReflection(int index) const;
121 
123  virtual void flushInvalidCameras(void);
124 
125  protected:
126 
130  virtual DtPlanarReflection* setupPlanarReflections(osg::RenderInfo &renderInfo);
131 
133  virtual osg::Node* createReflectionWorldGraph(makVrv::DtOsgRenderer& osgRenderer,
134  const osg::Matrix & localToWorld, const osg::Vec3& currentPos);
135 
136  protected:
137 
140 
142 
143  // This boolean indicates whether or not planar reflections have been requested,
144  // regardless of the internal state of the drawable. When it finally gets around
145  // to setting up planar reflections, this flag is checked
147 
149 
151 
154 
155  osg::Plane myReflectionPlane;
156  osg::Matrixd myReflectionMatrix;
158 
160  };
161 
165  {
166  protected:
169 
172 
173  private:
178 
179  public:
181  static DtTritonPlanarReflectionManagerCreator& instance(DtDe& de);
182 
184  static void registerInstance(DtDe& de,
186 
187  public:
189  virtual DtTritonPlanarReflectionManager* create(DtTritonDrawable* parentDrawable, DtDe& de);
190  };
191 }
Declares the DtPlanarReflection class.
The DtOsgRenderer is the component responsible for rendering 3D images onto the screen via OpenSceneG...
Definition: DtOsgRenderer.h:125
Virtual base class.
Definition: DtVirtualBaseClass.h:22
bool myReflectionsActive
Definition: DtTritonPlanarReflectionManager.h:150
DtDe & myDe
Definition: DtTritonPlanarReflectionManager.h:139
Definition: featureContext.h:37
bool myPlanarReflectionsFlag
Definition: DtTritonPlanarReflectionManager.h:148
osg::Plane myReflectionPlane
Definition: DtTritonPlanarReflectionManager.h:155
bool myPlanarReflectionsEnabled
Definition: DtTritonPlanarReflectionManager.h:146
osg::Matrixd myReflectionMatrix
Definition: DtTritonPlanarReflectionManager.h:156
A camera for rendering Triton&#39;s planar reflection texture.
Definition: DtPlanarReflection.h:27
osg::ref_ptr< DtPlanarReflection > PlanarReflectionRef
Definition: DtTritonPlanarReflectionManager.h:42
float myMaxWindForReflections
Definition: DtTritonPlanarReflectionManager.h:159
float myMaxReflectionBlend
Definition: DtTritonPlanarReflectionManager.h:153
Contains DLL export macros.
Contains makVrv::DtVirtualBaseClass class.
DtTritonPlanarReflectionManager creator.
Definition: DtTritonPlanarReflectionManager.h:164
float myReflectionBlend
Definition: DtTritonPlanarReflectionManager.h:152
#define DT_DLL_VRVTRITON
Definition: vrvTriton.h:19
DtVector myLastGeocentricReference
Definition: DtTritonPlanarReflectionManager.h:157
DtTritonDrawable * myTritonDrawable
Definition: DtTritonPlanarReflectionManager.h:138
MapCameraObserverPtrsToPlanarReflection myPlanarReflectionCameraMap
Definition: DtTritonPlanarReflectionManager.h:141
osg::observer_ptr< osg::Camera > CameraObserverPtr
Definition: DtTritonPlanarReflectionManager.h:41
class for managing the planar reflections used by triton drawable.
Definition: DtTritonPlanarReflectionManager.h:38
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
An OSG Drawable representing Triton&#39;s infinite ocean.
Definition: DtTritonDrawable.h:61
std::map< CameraObserverPtr, PlanarReflectionRef > MapCameraObserverPtrsToPlanarReflection
Definition: DtTritonPlanarReflectionManager.h:43

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)