From 980c5c41dc8e88ab3e7a5751348a92a0662a2ea4 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Mon, 21 Jul 2008 22:03:26 +0000 Subject: prepare keybinds for modifier keys, fix for the camera clipping issue --- src/client/targets.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/client/targets.cc') diff --git a/src/client/targets.cc b/src/client/targets.cc index 1264cbb..9dd508b 100644 --- a/src/client/targets.cc +++ b/src/client/targets.cc @@ -273,14 +273,14 @@ void draw() float z = -1; // mouse cursor location in 3d world space - float x = (float)(input::mouse_x - video::width /2) / (float)video::width * render::Camera::aspect(); - float y = (float)(input::mouse_y - video::height /2) / (float)video::height; + float x = (float)(input::mouse_x - video::width /2) / (float)video::width; + float y = (float)(input::mouse_y - video::height /2) / (float)video::height / render::Camera::aspect(); - Vector3f cursor = render::Camera::eye() + render::Camera::axis().forward() * (render::frustum_front + 0.001); + Vector3f cursor = render::Camera::eye() + render::Camera::axis().forward() * (render::Camera::frustum_front() + 0.001); cursor -= render::Camera::axis().left() * x; cursor -= render::Camera::axis().up() * y; - math::Vector3f center = render::Camera::eye() + (render::Camera::axis().forward() * (render::frustum_front +0.01f)); + math::Vector3f center = render::Camera::eye() + (render::Camera::axis().forward() * (render::Camera::frustum_front() +0.01f)); for (std::map::iterator it=core::Entity::registry.begin(); it != core::Entity::registry.end(); it++) { core::Entity *entity = (*it).second; @@ -327,7 +327,7 @@ void draw() // find the intersection of the line [ eye - target ] in the frustum front plane Vector3f const &plane_normal = render::Camera::axis().forward(); - Vector3f const &plane_point = render::Camera::eye() + render::Camera::axis().forward() * (render::frustum_front + 0.001); + Vector3f const &plane_point = render::Camera::eye() + render::Camera::axis().forward() * (render::Camera::frustum_front() + 0.001); float d = (plane_normal.x * plane_point.x + plane_normal.y * plane_point.y + plane_normal.z * plane_point.z); float t = d - plane_normal.x * render::Camera::eye().x -- cgit v1.2.3