Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2009-08-16 17:34:00 +0000
committerStijn Buys <ingar@osirion.org>2009-08-16 17:34:00 +0000
commitd763e294f44eb38b94bf7e2055b77a982b72b7c0 (patch)
tree37f91c6b7fee58fcecfbfc54dda3f71eb8617b9f /src/client/hud.cc
parent95cc140404c6524ea16e193e1421e826b239114f (diff)
more constness
Diffstat (limited to 'src/client/hud.cc')
-rw-r--r--src/client/hud.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/client/hud.cc b/src/client/hud.cc
index 102c445..662bbe8 100644
--- a/src/client/hud.cc
+++ b/src/client/hud.cc
@@ -50,19 +50,19 @@ void HUD::draw_offscreen_target(core::Entity *entity, bool is_active_target)
float cx = 0;
float cy = 0;
- if ( target.y*target.y + target.z*target.z < 0.0001 ) {
+ if ( target.y() * target.y() + target.z() * target.z() < 0.0001 ) {
// X - bound, behind (front is visible)
cx = 0.0f;
cy = -0.5f;
- } else if (fabs(target.y) > fabs(target.z)) {
+ } else if (fabs(target.y()) > fabs(target.z())) {
// Y-bound
- cx = math::sgnf(target.y) * 0.5f;
- cy = 0.5f * target.z / fabs(target.y);
+ cx = math::sgnf(target.y()) * 0.5f;
+ cy = 0.5f * target.z() / fabs(target.y());
} else {
// Z-bound
- cx = 0.5f * target.y / fabs(target.z);
- cy = math::sgnf(target.z) * 0.5f;
+ cx = 0.5f * target.y() / fabs(target.z());
+ cy = math::sgnf(target.z()) * 0.5f;
}
const float r = 16;
@@ -117,11 +117,11 @@ void HUD::draw_target(core::Entity *entity, bool is_active_target)
target = render::Camera::axis().transpose() * target;
// calculate the intersection between the line (0,0,0)-target and the frustum front
- float t = (render::FRUSTUMFRONT + 0.001f) / target.x;
+ float t = (render::FRUSTUMFRONT + 0.001f) / target.x();
Vector3f center(target *t);
- float cx = render::State::width() * (0.5 - center.y);
- float cy = render::State::height() * (0.5 - center.z * render::State::aspect());
+ float cx = render::State::width() * (0.5 - center.y());
+ float cy = render::State::height() * (0.5 - center.z() * render::State::aspect());
if ((cx < 0 ) || (cy < 0) || (cx > render::State::width()) || (cy > render::State::height())) {
draw_offscreen_target(entity, is_active_target);