X-Git-Url: http://git.tdb.fi/?p=libs%2Fvr.git;a=blobdiff_plain;f=source%2Foculusriftdevice.cpp;h=f521a0e18ba86ec423022526806968fca65933b6;hp=9857f78f2f3c7eb933fde613c211a6ba3af268d0;hb=d8b7f621f37d8bcad572b06f7288084b5ad6eb8c;hpb=b17410965e84e378c4cc85ffb732365552edc584 diff --git a/source/oculusriftdevice.cpp b/source/oculusriftdevice.cpp index 9857f78..f521a0e 100644 --- a/source/oculusriftdevice.cpp +++ b/source/oculusriftdevice.cpp @@ -1,5 +1,6 @@ #include "oculusriftdevice.h" #include "oculusriftdevice_private.h" +#include "stereoview.h" using namespace std; @@ -33,6 +34,13 @@ OculusRiftDevice::~OculusRiftDevice() ovr_Shutdown(); } +void OculusRiftDevice::configure_view(StereoView &view) const +{ + ovrEyeRenderDesc left_desc = ovrHmd_GetRenderDesc(priv->ovr_hmd, ovrEye_Left, priv->ovr_hmd->DefaultEyeFov[ovrEye_Left]); + ovrEyeRenderDesc right_desc = ovrHmd_GetRenderDesc(priv->ovr_hmd, ovrEye_Right, priv->ovr_hmd->DefaultEyeFov[ovrEye_Left]); + view.set_eye_spacing(left_desc.HmdToEyeViewOffset.x-right_desc.HmdToEyeViewOffset.x); +} + OculusRiftCamera *OculusRiftDevice::create_camera(const GL::Camera &bc) const { return new OculusRiftCamera(*this, bc);