VTK
vtkOpenVRCamera.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 =========================================================================*/
22 #ifndef vtkOpenVRCamera_h
23 #define vtkOpenVRCamera_h
24 
25 #include "vtkRenderingOpenVRModule.h" // For export macro
26 #include "vtkOpenGLCamera.h"
27 #include "vtkNew.h" // ivars
28 #include "vtkTransform.h" // ivars
29 
30 class vtkOpenVRRenderer;
31 class vtkMatrix3x3;
32 class vtkMatrix4x4;
33 
34 class VTKRENDERINGOPENVR_EXPORT vtkOpenVRCamera : public vtkOpenGLCamera
35 {
36 public:
37  static vtkOpenVRCamera *New();
39  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
40 
44  virtual void Render(vtkRenderer *ren);
45 
46  virtual void GetKeyMatrices(vtkRenderer *ren, vtkMatrix4x4 *&WCVCMatrix,
47  vtkMatrix3x3 *&normalMatrix, vtkMatrix4x4 *&VCDCMatrix, vtkMatrix4x4 *&WCDCMatrix);
48 
53  virtual void GetTrackingToDCMatrix(vtkMatrix4x4 *&TCDCMatrix);
54 
56 
60  vtkSetVector3Macro(Translation,double);
61  vtkGetVector3Macro(Translation,double);
63 
64  // apply the left or right eye pose to the camera
65  // position and focal point. Factor is typically
66  // 1.0 to add or -1.0 to subtract
67  void ApplyEyePose(bool left, double factor);
68 
69 protected:
71  ~vtkOpenVRCamera();
72 
73  // gets the pose and projections for the left and right eves from
74  // the openvr library
75  void GetHMDEyePoses(vtkRenderer *);
76  void GetHMDEyeProjections(vtkRenderer *);
77 
78  double LeftEyePose[3];
79  double RightEyePose[3];
82 
85 
86  // used to translate the
87  // View to the HMD space
88  double Translation[3];
90 
91 private:
92  vtkOpenVRCamera(const vtkOpenVRCamera&) VTK_DELETE_FUNCTION;
93  void operator=(const vtkOpenVRCamera&) VTK_DELETE_FUNCTION;
94 };
95 
96 #endif
OpenVR camera.
static vtkOpenGLCamera * New()
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:35
vtkMatrix4x4 * LeftEyeTCDCMatrix
abstract specification for renderers
Definition: vtkRenderer.h:57
OpenVR renderer.
void Render(vtkRenderer *ren) override
Implement base class method.
virtual void GetKeyMatrices(vtkRenderer *ren, vtkMatrix4x4 *&WCVCMatrix, vtkMatrix3x3 *&normalMatrix, vtkMatrix4x4 *&VCDCMatrix, vtkMatrix4x4 *&WCDCMatrix)
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:33
vtkMatrix4x4 * RightEyeProjection
vtkMatrix4x4 * RightEyeTCDCMatrix
vtkMatrix4x4 * LeftEyeProjection
vtkNew< vtkTransform > PoseTransform
represent and manipulate 3x3 transformation matrices
Definition: vtkMatrix3x3.h:33
OpenGL camera.