VTK  9.4.20241222
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
16VTK_ABI_NAMESPACE_BEGIN
17class vtkRenderer;
18class vtkMatrix4x4;
19
20class VTKRENDERINGVR_EXPORT vtkVRHMDCamera : public vtkVRCamera
21{
22public:
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
41protected:
43 ~vtkVRHMDCamera() override;
44
45 // you must provide these two methods in your subclass
48
63 void ComputeProjectionTransform(double aspect, double nearz, double farz) override;
64
65 // all the matrices below are stored in VTK convention
66 // as A = Mx where x is a column vector.
67
68 // the physical to hmd (left and right eye) part
71
72 // adds in the world to physical part
75
76 // we get these from the VR system possibly with some modifications for
77 // adjusting the clipping range or zbuffer formula
80
81 // computed using the above matrices, these matrices go from physical to
82 // projection space but that transformation will be different depending on
83 // which eye is active. So the naming is different as the start and end
84 // space is not tied to an eye, but rather some of the internal
85 // transformations
88
90
91private:
92 vtkVRHMDCamera(const vtkVRHMDCamera&) = delete;
93 void operator=(const vtkVRHMDCamera&) = delete;
94};
95
96VTK_ABI_NAMESPACE_END
97#endif
a simple class to control print indentation
Definition vtkIndent.h:108
represent and manipulate 3x3 transformation matrices
represent and manipulate 4x4 transformation matrices
Allocate and hold a VTK object.
Definition vtkNew.h:167
abstract specification for renderers
VR camera.
Definition vtkVRCamera.h:23
A superclass for HMD style cameras.
vtkNew< vtkMatrix4x4 > WorldToRightEyeMatrix
vtkNew< vtkMatrix4x4 > RightEyeToProjectionMatrix
void ComputeProjectionTransform(double aspect, double nearz, double farz) override
Compute the projection transform for the VR head-mounted display (HMD) camera.
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