VTK  9.2.6
vtkVRHMDCamera.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4
5 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
6 All rights reserved.
7 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
8
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notice for more information.
12
13=========================================================================*/
20#ifndef vtkVRHMDCamera_h
21#define vtkVRHMDCamera_h
22
23#include "vtkNew.h" // ivars
24#include "vtkRenderingVRModule.h" // For export macro
25#include "vtkVRCamera.h"
26
27class vtkRenderer;
28class vtkMatrix4x4;
29
30class VTKRENDERINGVR_EXPORT vtkVRHMDCamera : public vtkVRCamera
31{
32public:
34 void PrintSelf(ostream& os, vtkIndent indent) override;
35
39 void Render(vtkRenderer* ren) override;
40
41 void GetKeyMatrices(vtkRenderer* ren, vtkMatrix4x4*& WCVCMatrix, vtkMatrix3x3*& normalMatrix,
42 vtkMatrix4x4*& VCDCMatrix, vtkMatrix4x4*& WCDCMatrix) override;
43
49 void GetPhysicalToProjectionMatrix(vtkMatrix4x4*& physicalToProjectionMatrtix) override;
50
51protected:
53 ~vtkVRHMDCamera() override;
54
55 // you must provide these two methods in your subclass
58
59 // all the matrices below are stored in VTK convention
60 // as A = Mx where x is a column vector.
61
62 // the physical to hmd (left and right eye) part
65
66 // adds in the world to physical part
69
70 // we get these from the VR system possibly with some modifications for
71 // adjusting the clipping range or zbuffer formula
74
75 // computed using the above matrices, these matrices go from physical to
76 // projection space but that transformation will be different depending on
77 // which eye is active. So the naming is different as the start and end
78 // space is not tied to an eye, but rather some of the internal
79 // transformations
82
84
85private:
86 vtkVRHMDCamera(const vtkVRHMDCamera&) = delete;
87 void operator=(const vtkVRHMDCamera&) = delete;
88};
89
90#endif
a simple class to control print indentation
Definition: vtkIndent.h:40
represent and manipulate 3x3 transformation matrices
Definition: vtkMatrix3x3.h:37
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:42
Allocate and hold a VTK object.
Definition: vtkNew.h:62
abstract specification for renderers
Definition: vtkRenderer.h:73
VR camera.
Definition: vtkVRCamera.h:34
A superclass for HMD style cameras.
vtkNew< vtkMatrix4x4 > WorldToRightEyeMatrix
vtkNew< vtkMatrix4x4 > RightEyeToProjectionMatrix
vtkNew< vtkMatrix4x4 > PhysicalToProjectionMatrixForLeftEye
void GetPhysicalToProjectionMatrix(vtkMatrix4x4 *&physicalToProjectionMatrtix) override
Provides a matrix to go from physical coordinates to projection coordinates for the eye currently bei...
void GetKeyMatrices(vtkRenderer *ren, vtkMatrix4x4 *&WCVCMatrix, vtkMatrix3x3 *&normalMatrix, vtkMatrix4x4 *&VCDCMatrix, vtkMatrix4x4 *&WCDCMatrix) override
~vtkVRHMDCamera() override
vtkNew< vtkMatrix4x4 > LeftEyeToProjectionMatrix
vtkNew< vtkMatrix4x4 > PhysicalToLeftEyeMatrix
vtkNew< vtkMatrix4x4 > PhysicalToRightEyeMatrix
vtkNew< vtkMatrix4x4 > PhysicalToProjectionMatrixForRightEye
vtkNew< vtkMatrix4x4 > WorldToLeftEyeMatrix
void Render(vtkRenderer *ren) override
Implement base class method.
vtkNew< vtkMatrix4x4 > WorldToPhysicalMatrix
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void UpdateEyeToProjectionMatrices(vtkRenderer *)=0
virtual void UpdateWorldToEyeMatrices(vtkRenderer *)=0