From: Mikko Rasa Date: Sat, 24 Aug 2013 13:49:16 +0000 (+0300) Subject: View3D::create_ray should be const X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=50856ae150524f11af2bf548f49b7a31e14668aa;p=r2c2.git View3D::create_ray should be const --- diff --git a/source/3d/view.cpp b/source/3d/view.cpp index 5779616..673daef 100644 --- a/source/3d/view.cpp +++ b/source/3d/view.cpp @@ -36,12 +36,12 @@ View3D::View3D(Layout3D &l, unsigned w, unsigned h): view_all(); } -Ray View3D::create_ray(int x, int y) +Ray View3D::create_ray(int x, int y) const { return create_ray(x*2.0f/width-1.0f, y*2.0f/height-1.0f); } -Ray View3D::create_ray(float x, float y) +Ray View3D::create_ray(float x, float y) const { const GL::Vector3 &start = camera.get_position(); GL::Vector4 ray = camera.unproject(GL::Vector4(x, y, 0, 0)); diff --git a/source/3d/view.h b/source/3d/view.h index a1bdaf5..5e954a7 100644 --- a/source/3d/view.h +++ b/source/3d/view.h @@ -24,8 +24,8 @@ public: Msp::GL::Camera &get_camera() { return camera; } Msp::GL::Pipeline &get_pipeline() { return pipeline; } - Ray create_ray(int, int); - Ray create_ray(float, float); + Ray create_ray(int, int) const; + Ray create_ray(float, float) const; void view_all(bool = false);