VTK  9.3.0
vtkVRHMDCamera.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
9 #ifndef vtkVRHMDCamera_h
10 #define vtkVRHMDCamera_h
11 
12 #include "vtkNew.h" // ivars
13 #include "vtkRenderingVRModule.h" // For export macro
14 #include "vtkVRCamera.h"
15 
16 VTK_ABI_NAMESPACE_BEGIN
17 class vtkRenderer;
18 class vtkMatrix4x4;
19 
20 class VTKRENDERINGVR_EXPORT vtkVRHMDCamera : public vtkVRCamera
21 {
22 public:
23  vtkTypeMacro(vtkVRHMDCamera, vtkVRCamera);
24  void PrintSelf(ostream& os, vtkIndent indent) override;
25 
29  void Render(vtkRenderer* ren) override;
30 
31  void GetKeyMatrices(vtkRenderer* ren, vtkMatrix4x4*& WCVCMatrix, vtkMatrix3x3*& normalMatrix,
32  vtkMatrix4x4*& VCDCMatrix, vtkMatrix4x4*& WCDCMatrix) override;
33 
39  void GetPhysicalToProjectionMatrix(vtkMatrix4x4*& physicalToProjectionMatrtix) override;
40 
41 protected:
43  ~vtkVRHMDCamera() override;
44 
45  // you must provide these two methods in your subclass
48 
49  // all the matrices below are stored in VTK convention
50  // as A = Mx where x is a column vector.
51 
52  // the physical to hmd (left and right eye) part
55 
56  // adds in the world to physical part
59 
60  // we get these from the VR system possibly with some modifications for
61  // adjusting the clipping range or zbuffer formula
64 
65  // computed using the above matrices, these matrices go from physical to
66  // projection space but that transformation will be different depending on
67  // which eye is active. So the naming is different as the start and end
68  // space is not tied to an eye, but rather some of the internal
69  // transformations
72 
74 
75 private:
76  vtkVRHMDCamera(const vtkVRHMDCamera&) = delete;
77  void operator=(const vtkVRHMDCamera&) = delete;
78 };
79 
80 VTK_ABI_NAMESPACE_END
81 #endif
a simple class to control print indentation
Definition: vtkIndent.h:29
represent and manipulate 3x3 transformation matrices
Definition: vtkMatrix3x3.h:26
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:31
abstract specification for renderers
Definition: vtkRenderer.h:62
VR camera.
Definition: vtkVRCamera.h:24
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