VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtTrackedCamera.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2019 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 #pragma once
6 
10 
12 
13 #include <osg/ref_ptr>
14 #include <osg/Texture2D>
15 #include <osg/Image>
16 #include <osg/Matrix>
17 
18 namespace makVrv
19 {
20  class DtDe;
21 
28  {
29  public:
30  enum Eye {Mono = 0, Left = 0, Right};
31 
33  DtTrackedCamera(DtDe& de);
34 
36  virtual ~DtTrackedCamera();
37 
39  virtual osg::ref_ptr<osg::Texture2D> texture(Eye id);
40 
43  virtual osg::Matrixd pose(Eye e);
44 
46  virtual osg::Matrixd projection();
47 
49  virtual bool startStream() = 0;
50 
52  virtual void stopStream() = 0;
53 
55  virtual void toggleStreaming();
56 
58  virtual void tick() = 0;
59 
61  virtual bool isDualCamera() { return myIsDualCamera; }
62 
64  virtual void setCameraFov(float x, float y);
65 
67  virtual void setCameraEye(float x, float y, float z, float pitch);
68 
70  virtual void resetCameraProjection() = 0;
71 
72  protected:
74  virtual void addEyeTexture(int width, int height, unsigned char* buffer);
75 
77  virtual void invertBuffer();
78 
80  virtual osg::Matrixd createProjectionMatrix(float zn, float zf, const float* fovx = NULL, const float* fovy = NULL) = 0;
81 
82  typedef unsigned long long UInt64;
83 
87  unsigned int myFrameWidth;
88  unsigned int myFrameHeight;
89  unsigned int myFrameBufferSize;
90 
91  unsigned char* myFrameBuffer;
92  unsigned char* myFrameFlipBuffer;
93 
96 
97  std::vector<osg::ref_ptr<osg::Texture2D>> myTextures;
98  std::vector<osg::ref_ptr<osg::Image>> myImages;
99 
100  osg::Matrixd myProjection;
101  osg::Matrixd myView;
102  std::vector<osg::Matrixd> myHeadToCameraMatrix;
103 
105  };
106 }
unsigned int myFrameWidth
Definition: DtTrackedCamera.h:87
unsigned long long UInt64
Definition: DtTrackedCamera.h:82
std::vector< osg::ref_ptr< osg::Texture2D > > myTextures
Definition: DtTrackedCamera.h:97
Contains DLL export macros.
unsigned char * myFrameFlipBuffer
Definition: DtTrackedCamera.h:92
A Tracked camera is typically attached to the HMD and can provide position and orientation data in ad...
Definition: DtTrackedCamera.h:27
int myDualFormat
Definition: DtTrackedCamera.h:95
osg::Matrixd myProjection
Definition: DtTrackedCamera.h:100
unsigned char * myFrameBuffer
Definition: DtTrackedCamera.h:91
#define DT_DLL_VRVVR
Definition: vrvVirtualReality.h:19
unsigned int myFrameHeight
Definition: DtTrackedCamera.h:88
unsigned int myFrameBufferSize
Definition: DtTrackedCamera.h:89
DtDe & myDe
Definition: DtTrackedCamera.h:84
virtual bool isDualCamera()
whether or not this camera provides two video feeds simultaneously for stereo vision.
Definition: DtTrackedCamera.h:61
UInt64 myLastFrameSequence
Definition: DtTrackedCamera.h:86
bool myIsDualCamera
Definition: DtTrackedCamera.h:94
std::vector< osg::ref_ptr< osg::Image > > myImages
Definition: DtTrackedCamera.h:98
std::vector< osg::Matrixd > myHeadToCameraMatrix
Definition: DtTrackedCamera.h:102
bool myIsStreaming
Definition: DtTrackedCamera.h:85
int myFrameType
Definition: DtTrackedCamera.h:104
osg::Matrixd myView
Definition: DtTrackedCamera.h:101
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
Eye
Definition: DtTrackedCamera.h:30

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)