From 50856ae150524f11af2bf548f49b7a31e14668aa Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 24 Aug 2013 16:49:16 +0300 Subject: [PATCH] View3D::create_ray should be const --- source/3d/view.cpp | 4 ++-- source/3d/view.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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); -- 2.43.0