00001 00009 #ifndef PROJECTIONVRCAMERA_H 00010 #define PROJECTIONVRCAMERA_H 00011 00012 #include <G3D/G3DAll.h> 00013 #include "DisplayTile.H" 00014 00015 namespace VRG3D { 00016 00017 typedef ReferenceCountedPointer<class ProjectionVRCamera> ProjectionVRCameraRef; 00020 class ProjectionVRCamera : public ReferenceCountedObject 00021 { 00022 public: 00023 00024 enum EyeProjectionType { 00025 LeftEye, // left eye in stereo rendering 00026 RightEye, // right eye in stereo rendering 00027 Cyclops // a single "eye" -> mono rendering only 00028 }; 00029 00033 ProjectionVRCamera(DisplayTile dispTile, CoordinateFrame initHeadFrame, 00034 double interOcularDist=0.2083); 00035 virtual ~ProjectionVRCamera(); 00036 00040 void applyProjection(RenderDevice *rd, EyeProjectionType whichEye); 00041 00042 CoordinateFrame getHeadFrame() { return headFrame; } 00043 CoordinateFrame getLeftEyeFrame(); 00044 CoordinateFrame getRightEyeFrame(); 00045 Vector3 getHeadPos() { return headFrame.translation; } 00046 Vector3 getCameraPos() { return headFrame.translation; } 00047 Vector3 getLookVec(); 00048 DisplayTile getTile() { return tile; } 00049 00050 void updateHeadFrame(CoordinateFrame frame) { headFrame = frame; } 00051 void setDisplayTile(DisplayTile dispTile) { tile = dispTile; } 00052 00053 void set_iod(double val) { iod = val; } 00054 double get_iod() const { return iod; } 00055 00057 double iod; 00058 DisplayTile tile; 00059 CoordinateFrame headFrame; 00060 }; 00061 00062 } // end namespace 00063 00064 #endif