diff options
Diffstat (limited to 'editor')
| -rw-r--r-- | editor/camera.cpp | 6 | ||||
| -rw-r--r-- | editor/draw.cpp | 8 | ||||
| -rw-r--r-- | editor/tests/raycast-test.cpp | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/editor/camera.cpp b/editor/camera.cpp index 89147946..df5b2cb5 100644 --- a/editor/camera.cpp +++ b/editor/camera.cpp @@ -102,15 +102,15 @@ object_id app::get_object_colliding_with_cursor() object_id ret = 0; rtree->Search(t0.data(), t1.data(), [&](uint64_t data, const rect_type& rect) { [[maybe_unused]] auto x = std::bit_cast<collision_data>(data); - if (x.tag == (uint64_t)collision_type::geometry) + if (x.type == (uint64_t)collision_type::geometry) return true; Vector2 min(rect.m_min[0], rect.m_min[1]), max(rect.m_max[0], rect.m_max[1]); if (t0 >= min && t0 <= max) { - if (auto e_ = world.find_object(x.data); + if (auto e_ = world.find_object(x.id); e_ && Vector2ui(e_->bbox_size).product() != 0) { - ret = x.data; + ret = x.id; return false; } } diff --git a/editor/draw.cpp b/editor/draw.cpp index f5a906d2..c88984af 100644 --- a/editor/draw.cpp +++ b/editor/draw.cpp @@ -139,9 +139,9 @@ void app::draw_collision_boxes() if (x.tag == (uint64_t)collision_type::geometry) return true; #endif - if (x.tag == (uint64_t)collision_type::geometry) + if (x.type == (uint64_t)collision_type::geometry) if (x.pass == (uint64_t)pass_mode::pass) - if (x.data < TILE_COUNT*2+1) + if (x.id < TILE_COUNT*2+1) return true; Vector2 start(rect.m_min[0], rect.m_min[1]), end(rect.m_max[0], rect.m_max[1]); auto size = (end - start); @@ -186,9 +186,9 @@ void app::draw_collision_boxes() if (x.tag == (uint64_t)collision_type::geometry) return true; #endif - if (x.tag == (uint64_t)collision_type::geometry) + if (x.type == (uint64_t)collision_type::geometry) if (x.pass == (uint64_t)pass_mode::pass) - if (x.data < TILE_COUNT*2+1) + if (x.id < TILE_COUNT*2+1) return true; Vector2 start(rect.m_min[0], rect.m_min[1]), end(rect.m_max[0], rect.m_max[1]); auto size = end - start; diff --git a/editor/tests/raycast-test.cpp b/editor/tests/raycast-test.cpp index 07b44eaf..a8902145 100644 --- a/editor/tests/raycast-test.cpp +++ b/editor/tests/raycast-test.cpp @@ -181,7 +181,7 @@ struct raycast_test final : base_test { const char* type; - switch ((collision_type)result.collider.tag) + switch ((collision_type)result.collider.type) { using enum collision_type; default: type = "unknown?!"; break; @@ -199,7 +199,7 @@ struct raycast_test final : base_test do_column("collider"); std::snprintf(buf, array_size(buf), "%s @ %" PRIu64, - type, uint64_t{result.collider.data}); + type, uint64_t{result.collider.id}); { auto b = push_style_color(ImGuiCol_Text, 0xffff00ff_rgbaf); text(buf); } |
