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