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 
27 class vtkRenderer;
28 class vtkMatrix4x4;
29 
30 class VTKRENDERINGVR_EXPORT vtkVRHMDCamera : public vtkVRCamera
31 {
32 public:
33  vtkTypeMacro(vtkVRHMDCamera, vtkVRCamera);
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 
51 protected:
53  ~vtkVRHMDCamera() override;
54 
55  // you must provide these two methods in your subclass
56  virtual void UpdateWorldToEyeMatrices(vtkRenderer*) = 0;
57  virtual void UpdateEyeToProjectionMatrices(vtkRenderer*) = 0;
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 
85 private:
86  vtkVRHMDCamera(const vtkVRHMDCamera&) = delete;
87  void operator=(const vtkVRHMDCamera&) = delete;
88 };
89 
90 #endif
VR camera.
Definition: vtkVRCamera.h:33
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:41
vtkNew< vtkMatrix4x4 > PhysicalToProjectionMatrixForRightEye
vtkNew< vtkMatrix4x4 > WorldToRightEyeMatrix
abstract specification for renderers
Definition: vtkRenderer.h:72
vtkNew< vtkMatrix4x4 > LeftEyeToProjectionMatrix
void Render(vtkRenderer *ren) override
Implement base class method.
vtkNew< vtkMatrix4x4 > PhysicalToLeftEyeMatrix
virtual void GetKeyMatrices(vtkRenderer *ren, vtkMatrix4x4 *&WCVCMatrix, vtkMatrix3x3 *&normalMatrix, vtkMatrix4x4 *&VCDCMatrix, vtkMatrix4x4 *&WCDCMatrix)
vtkNew< vtkMatrix4x4 > WorldToLeftEyeMatrix
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void GetPhysicalToProjectionMatrix(vtkMatrix4x4 *&physicalToProjectionMatrix)=0
vtkNew< vtkMatrix4x4 > RightEyeToProjectionMatrix
vtkNew< vtkMatrix4x4 > PhysicalToProjectionMatrixForLeftEye
A superclass for HMD style cameras.
vtkNew< vtkMatrix4x4 > WorldToPhysicalMatrix
vtkNew< vtkMatrix4x4 > PhysicalToRightEyeMatrix
represent and manipulate 3x3 transformation matrices
Definition: vtkMatrix3x3.h:36