diff options
author | Aki <please@ignore.pl> | 2022-05-20 19:51:40 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-05-20 19:53:46 +0200 |
commit | d3720f01837e949ce7e7ea9b119358a5bb7b9666 (patch) | |
tree | c063f0f55d4cc58df23dc50d9b141a9237753c91 /View.cpp | |
parent | 21341f788654cfc806778fa34d09885431083d76 (diff) | |
download | derelict-d3720f01837e949ce7e7ea9b119358a5bb7b9666.zip derelict-d3720f01837e949ce7e7ea9b119358a5bb7b9666.tar.gz derelict-d3720f01837e949ce7e7ea9b119358a5bb7b9666.tar.bz2 |
Merged distance calculation functions
Diffstat (limited to 'View.cpp')
-rw-r--r-- | View.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; }); |