Make the StereoCombiner information interface more flexible
[libs/vr.git] / source / stereoview.cpp
index 08949e653599509021f24eb29b2f9b37f41a6826..dd825ed1f276839cb76c614215ca15b1d4776a55 100644 (file)
@@ -22,8 +22,8 @@ void StereoView::set_combiner(const StereoCombiner &c)
 {
        combiner = &c;
 
-       unsigned w = width/combiner->get_width_divisor()*combiner->get_oversize();
-       unsigned h = height/combiner->get_height_divisor()*combiner->get_oversize();
+       unsigned w = width*combiner->get_width_factor();
+       unsigned h = height*combiner->get_height_factor();
        left.create_target(w, h);
        right.create_target(w, h);
 }
@@ -42,10 +42,7 @@ void StereoView::setup_frame() const
        if(params.fov==Geometry::Angle<float>::zero())
                params.fov = base_camera.get_field_of_view();
 
-       params.aspect = base_camera.get_aspect();
-       if(!combiner->is_aspect_kept())
-               params.aspect = params.aspect*combiner->get_height_divisor()/combiner->get_width_divisor();
-
+       params.aspect = base_camera.get_aspect()*combiner->get_aspect_factor();
        params.near_clip = base_camera.get_near_clip();
        params.far_clip = base_camera.get_far_clip();