Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/targets.cc')
-rw-r--r--src/client/targets.cc10
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