VTK  9.6.20260407
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
8
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#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
16
17VTK_ABI_NAMESPACE_BEGIN
18class vtkRenderer;
19class vtkMatrix4x4;
20
21class VTKRENDERINGVR_EXPORT VTK_MARSHALAUTO vtkVRHMDCamera : public vtkVRCamera
22{
23public:
25 void PrintSelf(ostream& os, vtkIndent indent) override;
26
30 void Render(vtkRenderer* ren) override;
31
34
40 void GetPhysicalToProjectionMatrix(vtkMatrix4x4*& physicalToProjectionMatrtix) override;
41
42protected:
44 ~vtkVRHMDCamera() override;
45
46 // you must provide these two methods in your subclass
49
64 void ComputeProjectionTransform(double aspect, double nearz, double farz) override;
65
66 // all the matrices below are stored in VTK convention
67 // as A = Mx where x is a column vector.
68
69 // the physical to hmd (left and right eye) part
72
73 // adds in the world to physical part
76
77 // we get these from the VR system possibly with some modifications for
78 // adjusting the clipping range or zbuffer formula
81
82 // computed using the above matrices, these matrices go from physical to
83 // projection space but that transformation will be different depending on
84 // which eye is active. So the naming is different as the start and end
85 // space is not tied to an eye, but rather some of the internal
86 // transformations
89
91
92private:
93 vtkVRHMDCamera(const vtkVRHMDCamera&) = delete;
94 void operator=(const vtkVRHMDCamera&) = delete;
95};
96
97VTK_ABI_NAMESPACE_END
98#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:168
vtkMatrix4x4 * VCDCMatrix
vtkMatrix4x4 * WCVCMatrix
vtkMatrix4x4 * WCDCMatrix
abstract specification for renderers
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
#define VTK_MARSHALAUTO