16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 04:19:19 +02:00

vehicle params window, aware system rewrite, sifa

This commit is contained in:
milek7
2019-03-16 01:21:59 +01:00
parent f1c8c8f1cd
commit 3556a2d0e6
24 changed files with 622 additions and 451 deletions

View File

@@ -8,17 +8,20 @@ map::sorted_object_list map::objects::find_in_range(glm::vec3 from, float distan
float max_distance2 = distance * distance;
for (auto const entry : entries) {
for (auto const entry : entries)
{
glm::vec3 entry_location = entry->location;
glm::vec3 search_point = from;
if (glm::isnan(from.y)) {
if (glm::isnan(from.y))
{
entry_location.y = 0.0f;
search_point.y = 0.0f;
}
float dist = glm::distance2(entry_location, search_point);
if (dist < max_distance2) {
if (dist < max_distance2)
{
items.emplace(dist, std::move(entry));
}
}