summaryrefslogtreecommitdiffhomepage
path: root/View.cpp
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-05-20 19:51:40 +0200
committerAki <please@ignore.pl>2022-05-20 19:53:46 +0200
commitd3720f01837e949ce7e7ea9b119358a5bb7b9666 (patch)
treec063f0f55d4cc58df23dc50d9b141a9237753c91 /View.cpp
parent21341f788654cfc806778fa34d09885431083d76 (diff)
downloadderelict-d3720f01837e949ce7e7ea9b119358a5bb7b9666.zip
derelict-d3720f01837e949ce7e7ea9b119358a5bb7b9666.tar.gz
derelict-d3720f01837e949ce7e7ea9b119358a5bb7b9666.tar.bz2
Merged distance calculation functions
Diffstat (limited to 'View.cpp')
-rw-r--r--View.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/View.cpp b/View.cpp
index 8e8296d..93ad894 100644
--- a/View.cpp
+++ b/View.cpp
@@ -53,9 +53,9 @@ View::update(const float dt)
if (0 > pos.x || width < pos.x || 0 > pos.y || height < pos.y)
if (0 > base.x || width < base.x || 0 > base.y || height < base.y)
continue;
- const auto depth = dist3(m_camera.position, wreck.position);
- const auto length = dist2(pos, base);
- const bool hover = 8.0f > dist2(mouse, pos);
+ const auto depth = dist(m_camera.position, wreck.position);
+ const auto length = dist(pos, base);
+ const bool hover = 8.0f > dist(mouse, pos);
m_labels.push_back(Label{pos, base, depth, length, hover});
}
std::sort(m_labels.begin(), m_labels.end(), [](auto& a, auto& b){ return a.depth > b.depth; });