diff options
author | Stijn Buys <ingar@osirion.org> | 2008-07-21 22:03:26 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-07-21 22:03:26 +0000 |
commit | 980c5c41dc8e88ab3e7a5751348a92a0662a2ea4 (patch) | |
tree | 638fc130c94973038b76b50c1fd68a74c2dcdd9f /src/client/targets.cc | |
parent | 5a4bcd856787af106807b0b18fba8e4e2fae63ef (diff) |
prepare keybinds for modifier keys, fix for the camera clipping issue
Diffstat (limited to 'src/client/targets.cc')
-rw-r--r-- | src/client/targets.cc | 10 |
1 files changed, 5 insertions, 5 deletions
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<unsigned int, core::Entity *>::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 |