VR-Forces 4.10 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) 2021 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 
42 
44  template <>
45  inline const char* creatorTypeName<DtTritonPlanarReflectionManager>(void) { return "DtTritonPlanarReflectionManagerCreator"; }
46 
49  {
50  protected:
51  typedef osg::observer_ptr< osg::Camera > CameraObserverPtr;
53  typedef std::map< CameraObserverPtr, PlanarReflectionRef > MapCameraObserverPtrsToPlanarReflection;
54 
55  public:
58 
59  // destructor
61 
62  protected:
65 
66  private:
72  DtTritonPlanarReflectionManager &operator=(const DtTritonPlanarReflectionManager &other) = delete;
73 
74  public:
76  virtual void setMaxReflectionWindSpeed(double metersPerSecond);
77 
79  virtual void setPlanarReflectionsEnabled(bool enabled);
81  virtual bool planarReflectionsEnabled(void) const;
83 
85  virtual void enableReflections(bool enabled);
86 
88  virtual void removeAllPlanarReflections();
89 
93  virtual DtPlanarReflection* getOrCreatePlanarReflection(osg::RenderInfo& renderInfo);
94 
99  virtual DtPlanarReflection* getPlanarReflection(osg::Camera* camera);
100 
102  virtual void updateReflectionBlend(const osg::Vec3& currentPosition);
103 
105  virtual void updateReflectionMatrix(const osg::Vec3& currentPosition);
106 
108  virtual void updateReflectionBlendAndMatrix(const osg::Vec3& currentPosition);
109 
111  virtual const osg::Matrixd& reflectionMatrix(void) const;
112 
114  virtual const osg::Plane& reflectionPlane(void) const;
115 
117  virtual float reflectionBlend(void) const;
118 
120  virtual bool planarReflectionsFlag(void) const;
121 
123  virtual int numPlanarReflectionCameras(void) const;
124 
127  virtual osg::ref_ptr<osg::Camera> planarReflectionCamera(int index) const;
128 
131  virtual DtPlanarReflection* planarReflection(int index) const;
132 
134  virtual void flushInvalidCameras(void);
135 
136  protected:
137 
141  virtual DtPlanarReflection* setupPlanarReflections(osg::RenderInfo &renderInfo);
142 
144  virtual osg::Node* createReflectionWorldGraph(makVrv::DtOsgRenderer& osgRenderer,
145  const osg::Matrix & localToWorld, const osg::Vec3& currentPos);
146 
147  protected:
148 
151 
153 
154  // This boolean indicates whether or not planar reflections have been requested,
155  // regardless of the internal state of the drawable. When it finally gets around
156  // to setting up planar reflections, this flag is checked
158 
160 
162 
165 
166  osg::Plane myReflectionPlane;
167  osg::Matrixd myReflectionMatrix;
169 
171  };
172 }
Declares the DtPlanarReflection class.
friend DtTritonPlanarReflectionManagerCreator
friend class so only the creator can create this class
Definition: DtTritonPlanarReflectionManager.h:57
The DtOsgRenderer is the component responsible for rendering 3D images onto the screen via OpenSceneG...
Definition: DtOsgRenderer.h:90
bool myReflectionsActive
Definition: DtTritonPlanarReflectionManager.h:161
DtDe & myDe
Definition: DtTritonPlanarReflectionManager.h:150
Definition: featureContext.h:37
DtVirtualBaseClassCreator< DtTritonPlanarReflectionManager, DtTritonDrawable * > DtTritonPlanarReflectionManagerCreator
creator
Definition: DtTritonPlanarReflectionManager.h:38
bool myPlanarReflectionsFlag
Definition: DtTritonPlanarReflectionManager.h:159
osg::Plane myReflectionPlane
Definition: DtTritonPlanarReflectionManager.h:166
bool myPlanarReflectionsEnabled
Definition: DtTritonPlanarReflectionManager.h:157
osg::Matrixd myReflectionMatrix
Definition: DtTritonPlanarReflectionManager.h:167
A camera for rendering Triton&#39;s planar reflection texture.
Definition: DtPlanarReflection.h:27
osg::ref_ptr< DtPlanarReflection > PlanarReflectionRef
Definition: DtTritonPlanarReflectionManager.h:52
float myMaxWindForReflections
Definition: DtTritonPlanarReflectionManager.h:170
float myMaxReflectionBlend
Definition: DtTritonPlanarReflectionManager.h:164
Contains DLL export macros.
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:22
float myReflectionBlend
Definition: DtTritonPlanarReflectionManager.h:163
#define DT_DLL_VRVTRITON
Definition: vrvTriton.h:19
DtVector myLastGeocentricReference
Definition: DtTritonPlanarReflectionManager.h:168
DtTritonDrawable * myTritonDrawable
Definition: DtTritonPlanarReflectionManager.h:149
MapCameraObserverPtrsToPlanarReflection myPlanarReflectionCameraMap
Definition: DtTritonPlanarReflectionManager.h:152
const char * creatorTypeName< DtTritonPlanarReflectionManager >(void)
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtTritonPlanarReflectionManager.h:45
osg::observer_ptr< osg::Camera > CameraObserverPtr
Definition: DtTritonPlanarReflectionManager.h:51
class for managing the planar reflections used by triton drawable.
Definition: DtTritonPlanarReflectionManager.h:48
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:62
std::map< CameraObserverPtr, PlanarReflectionRef > MapCameraObserverPtrsToPlanarReflection
Definition: DtTritonPlanarReflectionManager.h:53

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)