]> git.tdb.fi Git - libs/vr.git/commitdiff
Apply s/device/system/ to member variables as well
authorMikko Rasa <tdb@tdb.fi>
Wed, 5 Oct 2016 23:31:00 +0000 (02:31 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 5 Oct 2016 23:31:00 +0000 (02:31 +0300)
source/libovr/libovrcamera.cpp
source/libovr/libovrcamera.h
source/libovr/libovrcombiner.cpp
source/libovr/libovrcombiner.h
source/openvr/openvrcamera.cpp
source/openvr/openvrcamera.h
source/openvr/openvrcombiner.cpp
source/openvr/openvrcombiner.h

index 744608619a5926dabb77de836ae31a9966d30564..b4c6f2c564c8aab03563743e3cb629719aed5c2d 100644 (file)
@@ -7,26 +7,26 @@ namespace VR {
 
 LibOVRCamera::LibOVRCamera(const LibOVRSystem &d, const GL::Camera &c):
        HeadTrackingCamera(c),
-       device(d)
+       system(d)
 {
        unsigned supported = ovrTrackingCap_Orientation|ovrTrackingCap_MagYawCorrection|ovrTrackingCap_Position;
-       ovrHmd_ConfigureTracking(device.get_private().ovr_hmd, supported, 0);
+       ovrHmd_ConfigureTracking(system.get_private().ovr_hmd, supported, 0);
 }
 
 void LibOVRCamera::reset_tracking()
 {
-       ovrHmd_RecenterPose(device.get_private().ovr_hmd);
+       ovrHmd_RecenterPose(system.get_private().ovr_hmd);
 }
 
 void LibOVRCamera::update()
 {
        double time;
-       if(device.is_timing_active())
-               time = device.get_tracking_time();
+       if(system.is_timing_active())
+               time = system.get_tracking_time();
        else
-               time = device.get_current_time();
+               time = system.get_current_time();
 
-       ovrTrackingState state = ovrHmd_GetTrackingState(device.get_private().ovr_hmd, time);
+       ovrTrackingState state = ovrHmd_GetTrackingState(system.get_private().ovr_hmd, time);
        OVR::Posef head_pose = state.HeadPose.ThePose;
        OVR::Matrix4f tracking_matrix(head_pose);
        update_from_matrix(transpose(GL::Matrix(&tracking_matrix.M[0][0])));
index 44495b0b3059dfc05a2108f2fd813de8ab3c6015..f570a5693d9e562942fd1051795e49ca68b4f8ae 100644 (file)
@@ -11,7 +11,7 @@ class LibOVRSystem;
 class LibOVRCamera: public HeadTrackingCamera
 {
 private:
-       const LibOVRSystem &device;
+       const LibOVRSystem &system;
 
 public:
        LibOVRCamera(const LibOVRSystem &, const GL::Camera &);
index 5eddb4a2f91e959065119b180a70f664515edca6..fc3ed6765aa86c33df14bc259df5fdc78b908e53 100644 (file)
@@ -82,13 +82,13 @@ struct LibOVRCombiner::Frustum: StereoCombiner::Frustum
 
 
 LibOVRCombiner::LibOVRCombiner(LibOVRSystem &d, GL::View &v):
-       device(d),
+       system(d),
        view(v),
        left_mesh((GL::VERTEX2, GL::TEXCOORD2,0, GL::TEXCOORD2,1, GL::TEXCOORD2,2, GL::TEXCOORD2,3)),
        right_mesh((GL::VERTEX2, GL::TEXCOORD2,0, GL::TEXCOORD2,1, GL::TEXCOORD2,2, GL::TEXCOORD2,3)),
        shprog(vs_source, fs_source)
 {
-       ovrHmd hmd = device.get_private().ovr_hmd;
+       ovrHmd hmd = system.get_private().ovr_hmd;
 
        ovrFovPort left_fov = hmd->DefaultEyeFov[ovrEye_Left];
        ovrFovPort right_fov = hmd->DefaultEyeFov[ovrEye_Right];
@@ -122,24 +122,24 @@ LibOVRCombiner::LibOVRCombiner(LibOVRSystem &d, GL::View &v):
        right_shdata.uniform("uv_scale", uv_scale_offset[0].x, -uv_scale_offset[0].y);
        right_shdata.uniform("uv_offset", uv_scale_offset[1].x, 1-uv_scale_offset[1].y);
 
-       device.configure_window(view.get_window());
+       system.configure_window(view.get_window());
 }
 
 void LibOVRCombiner::prepare() const
 {
-       device.begin_frame();
+       system.begin_frame();
 }
 
 void LibOVRCombiner::render(const GL::Texture2D &left, const GL::Texture2D &right) const
 {
        GL::Bind bind_shprog(shprog);
 
-       ovrHmd hmd = device.get_private().ovr_hmd;
+       ovrHmd hmd = system.get_private().ovr_hmd;
 
-       if(device.is_timing_active())
+       if(system.is_timing_active())
        {
-               ovr_WaitTillTime(device.get_timewarp_time());
-               ovrTrackingState state = ovrHmd_GetTrackingState(hmd, device.get_tracking_time());
+               ovr_WaitTillTime(system.get_timewarp_time());
+               ovrTrackingState state = ovrHmd_GetTrackingState(hmd, system.get_tracking_time());
 
                ovrMatrix4f matrices[2];
                ovrHmd_GetEyeTimewarpMatrices(hmd, ovrEye_Left, state.HeadPose.ThePose, matrices);
@@ -164,7 +164,7 @@ void LibOVRCombiner::render(const GL::Texture2D &left, const GL::Texture2D &righ
        right_mesh.draw();
 
        view.get_context().swap_buffers();
-       device.end_frame();
+       system.end_frame();
 }
 
 
index 789de552e50ff15b73abc5658b4c96a4d7ba7b61..8ea8ce653e21bd43a245204274a21cbd483c76fe 100644 (file)
@@ -21,7 +21,7 @@ class LibOVRCombiner: public StereoCombiner
 private:
        struct Frustum;
 
-       LibOVRSystem &device;
+       LibOVRSystem &system;
        GL::View &view;
        GL::Mesh left_mesh;
        GL::Mesh right_mesh;
index d6a0fe69ea54cc24aa9500b7fa5c26af533c3a6f..3e7b9d78cc0afb37677f02442b747b68355578cb 100644 (file)
@@ -7,7 +7,7 @@ namespace VR {
 
 OpenVRCamera::OpenVRCamera(const OpenVRSystem &d, const GL::Camera &c):
        HeadTrackingCamera(c),
-       device(d)
+       system(d)
 { }
 
 void OpenVRCamera::reset_tracking()
@@ -17,7 +17,7 @@ void OpenVRCamera::reset_tracking()
 
 void OpenVRCamera::update()
 {
-       update_from_matrix(device.get_hmd_matrix());
+       update_from_matrix(system.get_hmd_matrix());
 }
 
 } // namespace VR
index ab14d3d18fe4ee35b5ebc950c71702950497e2c2..ef0d2fc663380d95b8db49e41b611619025ce7fd 100644 (file)
@@ -11,7 +11,7 @@ class OpenVRSystem;
 class OpenVRCamera: public HeadTrackingCamera
 {
 private:
-       const OpenVRSystem &device;
+       const OpenVRSystem &system;
 
 public:
        OpenVRCamera(const OpenVRSystem &, const GL::Camera &);
index 20b485eac1a9cf3401bae393dbb422b3cdad2f82..85a0e2a2352df3ac557b5d0e8f9d3096e104921f 100644 (file)
@@ -12,7 +12,7 @@ struct OpenVRCombiner::Private
 
 
 OpenVRCombiner::OpenVRCombiner(OpenVRSystem &d, GL::View &v):
-       device(d),
+       system(d),
        view(v)
 {
        vr::IVRSystem *vr_sys = vr::VRSystem();
@@ -31,7 +31,7 @@ OpenVRCombiner::OpenVRCombiner(OpenVRSystem &d, GL::View &v):
 
 void OpenVRCombiner::prepare() const
 {
-       device.update_pose_matrices();
+       system.update_pose_matrices();
 }
 
 void OpenVRCombiner::render(const GL::Texture2D &left, const GL::Texture2D &right) const
index 5b9e3b4235a26d49377b19c71145d67a1981e5a6..33f266c9988cb95541d1e6d021097e2d385af0dc 100644 (file)
@@ -14,7 +14,7 @@ class OpenVRCombiner: public StereoCombiner
 private:
        struct Private;
 
-       OpenVRSystem &device;
+       OpenVRSystem &system;
        GL::View &view;
 
 public: