VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtVirtualRealityChannel.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 
13 
14 #include <vrvOsg/DtOsgChannel.h>
17 #include <osg/Texture2DArray>
18 
19 
20 namespace makVrv
21 {
30  {
31  private:
34 
36  DtVirtualRealityChannel& operator=(const DtVirtualRealityChannel& other);
37 
38  public:
39  // \brief CTOR
41 
43  virtual ~DtVirtualRealityChannel();
44 
46  virtual bool initialize();
47 
50  virtual void setWidth(int width);
51 
53  virtual void setHeight(int height);
54 
56  virtual void resetViewport();
57 
62  virtual void setRenderToTexture(bool enabled);
63 
65  virtual void setIsMultiView(bool enabled);
66 
68  virtual bool isMultiView() const;
69 
71  virtual void setProjectionConfiguration(DtChannelConfiguration::ProjectionUnits units, float left, float right, float bottom, float top, float zNear, float zFar);
72 
74  virtual void setCameraOffsetConfiguration(const osg::Vec3d& trans, const osg::Quat& ori);
75 
77  virtual void getNearFar(double& zNear, double& zFar);
78 
79  //| \brief calculate a projection matrix for the passed frustum values (in vrv units)
80  virtual osg::Matrix calculateEyeProjecionMatrix(DtChannelConfiguration::ProjectionUnits units, float left, float right, float bottom, float top, float zNear, float zFar);
81 
83  virtual void setFrustumAnglesForEye(osg::Vec4 frustumAngles, int multiViewEye);
84 
86  virtual void setProjectionMatrixForEye(osg::Matrix matrix, int multiViewEye);
87 
89  osg::Uniform* eyeProjectionMatrixUniform();
90 
92  osg::Uniform* eyeInverseProjectionMatrixUniform();
93 
95  virtual void updateProjectionConfigurationForMultiView();
96 
98  osg::Uniform* eyeOffsetMatrixUniform();
99 
101  void setOffsetForEye(osg::Vec3 offset, int multiViewEye);
102 
103  // ! return the shading rate image used for this channel
104  DtVariableRateShadingImage* shadingRateImage() const;
105 
106  // ! return the shading rate image palette used for this channel
107  DtVariableRateShadingImagePalette* shadingRateImagePalette() const;
108 
111  boost::signal<void()> signal_renderTextureChanged;
112 
113  protected:
115  virtual void projectFor3D();
116 
118  virtual void projectFor2D();
119 
121  virtual void updateProjection();
122 
124  virtual void slot_windowConfigurationModified(const std::string&, const std::string&, const DtWindowConfiguration&);
125 
127  virtual void initializeSignalConnections();
128 
130  virtual void getRenderTextureAttachmentInfo(unsigned int& level, unsigned int& face, unsigned int& sampleBuffers, unsigned int& samples);
131 
133  virtual osg::ref_ptr<osg::Texture> allocateRenderTexture(int width, int height) const;
134 
135  protected:
136  int myWidth;
137  int myHeight;
138 
141 
143  osg::Vec4 myEyeFrustumAngles[2];
144 
147 
150 
153 
156  };
157 
161  {
162  public:
164  virtual DtChannel* create(DtDe& de, DtWindow* window, DtChannelConfiguration& config);
165  };
166 }
Abstract Base class.
Definition: DtWindow.h:25
bool myIsMultiView
is multiview being used
Definition: DtVirtualRealityChannel.h:140
boost::signal< void()> signal_renderTextureChanged
signaled any time the underlying texture target changes.
Definition: DtVirtualRealityChannel.h:111
osg::ref_ptr< DtVariableRateShadingImage > myShadingRateImage
Definition: DtVirtualRealityChannel.h:154
Wrapper around Nvidia Variable Rate Shading Image functionality Creates a texture of the correct size...
Definition: DtVariableRateShadingImage.h:75
osg::ref_ptr< osg::Uniform > myEyeOffsetMatrixUniform
view space offect matrix for the multiview eyes, single uniform accessing an array of two mat4 values...
Definition: DtVirtualRealityChannel.h:152
Contains DLL export macros.
Contains makVrv::DtOsgChannel class.
DT_DLL_VRVCORE DtTaitBryan level(const DtCoordinateSystem &cs, const DtVector &localOrigin, double topoHeading)
Returns a level orientation with the topographic heading.
int myWidth
Definition: DtVirtualRealityChannel.h:136
osg::ref_ptr< osg::Uniform > myEyeProjectionMatrixUniform
projection matrix uniform for the multiview eyes, single uniform accessing an array of two mat4 value...
Definition: DtVirtualRealityChannel.h:146
The abstract channel creator for the abstract channel class.
Definition: DtChannel.h:161
This owns a list of channel configurations.
Definition: DtWindowConfiguration.h:31
This class provides the OSG-specific implementation of a DtChannel.
Definition: DtOsgChannel.h:75
#define DT_DLL_VRVVR
Definition: vrvVirtualReality.h:19
The abstract Channel Class.
Definition: DtChannel.h:29
Wrap functionality of Nvidia Variable Rate Shading Image Palette Allocates shading rate pallete data ...
Definition: DtVariableRateShadingImagePalette.h:23
A VRV channel that represents the eyes of the HMD A Virtual Reality channel can render in a few diffe...
Definition: DtVirtualRealityChannel.h:29
ProjectionUnits
Definition: DtChannelConfiguration.h:39
osg::ref_ptr< osg::Uniform > myEyeInverseProjectionMatrixUniform
inverse projection matrix uniform for the multiview eyes, single uniform accessing an array of two ma...
Definition: DtVirtualRealityChannel.h:149
Configuration for a single channel Serialized and sent to remote displays as necessary to configure r...
Definition: DtChannelConfiguration.h:26
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
Channel creator for Virtual Reality channel.
Definition: DtVirtualRealityChannel.h:160
voidpf uLong offset
Definition: ioapi.h:42
Wraps functionality of Variable Rate Shading Image.
osg::ref_ptr< DtVariableRateShadingImagePalette > myShadingRateImagePalette
Definition: DtVirtualRealityChannel.h:155
A basic OSG display window, used to get the osg context for a display window.
Definition: DtOsgWindow.h:36
int myHeight
Definition: DtVirtualRealityChannel.h:137

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)