VTK
9.7.1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
Rendering
VR
vtkVRCamera.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
11
#ifndef vtkVRCamera_h
12
#define vtkVRCamera_h
13
14
#include "
vtkNew.h
"
// for iavr
15
#include "
vtkOpenGLCamera.h
"
16
#include "vtkRenderingVRModule.h"
// For export macro
17
#include "
vtkWrappingHints.h
"
// For VTK_MARSHALAUTO
18
19
VTK_ABI_NAMESPACE_BEGIN
20
class
vtkMatrix4x4
;
21
class
vtkVRRenderWindow
;
22
23
class
VTKRENDERINGVR_EXPORT
VTK_MARSHALAUTO
vtkVRCamera
:
public
vtkOpenGLCamera
24
{
25
public
:
26
vtkTypeMacro(
vtkVRCamera
,
vtkOpenGLCamera
);
27
33
virtual
void
GetPhysicalToProjectionMatrix(
vtkMatrix4x4
*& physicalToProjectionMatrix) = 0;
34
35
// A pose in VR includes more than just the basic camera values.
36
// It includes all the properties needed to reproduce a view
37
// in physical space when requested from a different physical space
38
// This class stores those properties
39
// As the VR code is still being rearchitected this signature
40
// may change slightly through the end of 2021.
41
class
Pose
42
{
43
public
:
44
double
Position
[3];
45
double
PhysicalViewUp[3];
46
double
PhysicalViewDirection[3];
47
double
ViewDirection[3];
48
double
Translation[3];
49
double
Distance
;
50
double
MotionFactor = 1.0;
51
};
52
53
// Fill in a Pose object based on the current camera and physical space
54
// settings. As the VR code is still being rearchitected this signature
55
// may change slightly through the end of 2021.
56
void
SetPoseFromCamera(
Pose
* pose,
vtkVRRenderWindow
* win);
57
58
// Reproduce a pose using the current camera and render window. That is, try
59
// to make the viewer's current view look like the original saved pose.
60
// This is complicated by the fact that the viewer may now occupy a very
61
// different position and orientation in the physical space than when the
62
// pose was saved. This method accounts for this and adjusts the phjsical
63
// space to best fit the requested pose.
64
// As the VR code is still being rearchitected this signature
65
// may change slightly through the end of 2021.
66
void
ApplyPoseToCamera(
Pose
* pose,
vtkVRRenderWindow
* win);
67
68
// Set the camera's ivars based on a user provided matrix. The goal here
69
// is to make it so that the camera is consistent with the provided matrix
70
// and when the world to pose/view matrix is requested would return the
71
// same matrix as provided.
72
void
SetCameraFromWorldToDeviceMatrix(
vtkMatrix4x4
* mat,
double
distance);
73
void
SetCameraFromDeviceToWorldMatrix(
vtkMatrix4x4
* mat,
double
distance);
74
76
82
vtkSetMacro(TrackHMD,
bool
);
83
vtkGetMacro(TrackHMD,
bool
);
85
86
protected
:
87
vtkVRCamera
();
88
~
vtkVRCamera
()
override
;
89
90
vtkNew<vtkMatrix4x4>
TempMatrix4x4
;
91
bool
TrackHMD =
true
;
92
93
private
:
94
vtkVRCamera
(
const
vtkVRCamera
&) =
delete
;
95
void
operator=(
const
vtkVRCamera
&) =
delete
;
96
};
97
98
VTK_ABI_NAMESPACE_END
99
#endif
100
/* VTK-HeaderTest-Exclude: vtkVRCamera.h */
vtkVRCamera
VR camera.
Definition:
vtkVRCamera.h:23
vtkVRCamera::TempMatrix4x4
vtkNew< vtkMatrix4x4 > TempMatrix4x4
Definition:
vtkVRCamera.h:90
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition:
vtkMatrix4x4.h:31
vtkParticleTracerBaseNamespace::Position
struct Position_t Position
Definition:
vtkParticleTracerBase.h:62
vtkWrappingHints.h
vtkVRRenderWindow
VR rendering window.
Definition:
vtkVRRenderWindow.h:57
vtkVRCamera::Pose
Definition:
vtkVRCamera.h:41
vtkNew.h
vtkNew< vtkMatrix4x4 >
VTK_MARSHALAUTO
#define VTK_MARSHALAUTO
Definition:
vtkWrappingHints.h:75
vtkOpenGLCamera.h
vtkOpenGLCamera
OpenGL camera.
Definition:
vtkOpenGLCamera.h:24
vtkVRCamera::Pose::Distance
double Distance
Definition:
vtkVRCamera.h:49
Generated on Tue Oct 20 2026 10:48:50 for VTK by
1.8.10