{
set_combiner(m);
set_eye_spacing(0.064);
+ set_strabismus(Geometry::Angle<float>::zero());
}
void StereoView::set_combiner(const StereoCombiner &c)
eye_spacing = s;
}
+void StereoView::set_strabismus(const Geometry::Angle<float> &s)
+{
+ strabismus = s;
+}
+
void StereoView::setup_frame() const
{
offset_axis = normalize(cross(base_camera.get_look_direction(), base_camera.get_up_direction()))*0.5f;
params.far_clip = base_camera.get_far_clip();
float frustum_skew = combiner->get_frustum_skew();
+ float halfw = tan(params.fov/2.0f)*params.aspect;
+ frustum_skew = tan(Geometry::atan<float>(frustum_skew*halfw)+strabismus)/halfw;
left.setup_frame(base_camera, offset_axis*-eye_spacing, frustum_skew, params);
right.setup_frame(base_camera, offset_axis*eye_spacing, -frustum_skew, params);
Eye left;
Eye right;
float eye_spacing;
+ Geometry::Angle<float> strabismus;
mutable GL::Vector3 offset_axis;
public:
void set_combiner(const StereoCombiner &);
void set_eye_spacing(float);
+ void set_strabismus(const Geometry::Angle<float> &);
virtual void setup_frame() const;
virtual void finish_frame() const;