X-Git-Url: http://git.tdb.fi/?p=libs%2Fvr.git;a=blobdiff_plain;f=source%2Fstereoview.cpp;h=459abba7417c64128b645d15c0fa4f10caeaf134;hp=5b8dbbbbb5bab8b8a8b5f62e5c9eaf1bc15518fa;hb=cb460150f6870c172a70237f283c9753250be361;hpb=fa43a20e8274638b84c26e052dd8f7cc8993edd9 diff --git a/source/stereoview.cpp b/source/stereoview.cpp index 5b8dbbb..459abba 100644 --- a/source/stereoview.cpp +++ b/source/stereoview.cpp @@ -7,9 +7,7 @@ using namespace std; namespace Msp { namespace VR { -StereoView::StereoView(unsigned w, unsigned h, const GL::Camera &c, const GL::Renderable &r, const StereoCombiner &m): - width(w), - height(h), +StereoView::StereoView(const GL::Camera &c, const GL::Renderable &r, const StereoCombiner &m): base_camera(c), renderable(r), combiner(0) @@ -23,8 +21,8 @@ void StereoView::set_combiner(const StereoCombiner &c) { combiner = &c; - unsigned w = width*combiner->get_width_factor(); - unsigned h = height*combiner->get_height_factor(); + unsigned w = combiner->get_target_width(); + unsigned h = combiner->get_target_height(); left.create_target(w, h); right.create_target(w, h); } @@ -41,14 +39,14 @@ void StereoView::set_strabismus(const Geometry::Angle &s) void StereoView::setup_frame() const { - offset_axis = normalize(cross(base_camera.get_look_direction(), base_camera.get_up_direction()))*0.5f; + GL::Vector3 offset_axis = normalize(cross(base_camera.get_look_direction(), base_camera.get_up_direction()))*0.5f; EyeParams params; params.fov = combiner->get_field_of_view(); if(params.fov==Geometry::Angle::zero()) params.fov = base_camera.get_field_of_view(); - params.aspect = base_camera.get_aspect()*combiner->get_aspect_factor(); + params.aspect = combiner->get_render_aspect(); params.near_clip = base_camera.get_near_clip(); params.far_clip = base_camera.get_far_clip();