diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-05-03 18:19:33 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-05-05 03:16:22 +0200 |
commit | a549fdf835a8548e09084156137cb26e869e8901 (patch) | |
tree | 0eb053650b390d6cc1084b4d2967983948c3d08a /editor | |
parent | ccb4b508c39e29a7087ba69fe5cca9ef2cd79a25 (diff) |
add simplified camera offset formula
Diffstat (limited to 'editor')
-rw-r--r-- | editor/camera.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/editor/camera.cpp b/editor/camera.cpp index 3fa8d9d3..72b90cc2 100644 --- a/editor/camera.cpp +++ b/editor/camera.cpp @@ -89,7 +89,7 @@ object_id app::get_object_colliding_with_cursor() continue; auto& c = *cʹ; c.ensure_passability(); - const with_shifted_camera_offset o{shader, c_pos, {minx, miny}, {maxx, maxy}}; + const with_shifted_camera_offset o{shader, c_pos}; if (floormat_main::check_chunk_visible(shader.camera_offset(), sz)) { constexpr auto chunk_size = TILE_SIZE2 * TILE_MAX_DIM; @@ -144,8 +144,7 @@ Vector2 app::point_screen_pos(point pt) auto& shader = M->shader(); auto win_size = M->window_size(); auto c3 = pt.chunk3(); - auto c2 = pt.chunk(); - with_shifted_camera_offset co{shader, c3, c2, c2 }; + with_shifted_camera_offset co{shader, c3}; auto world_pos = TILE_SIZE20 * Vector3(pt.local()) + Vector3(Vector2(pt.offset()), 0); return Vector2(shader.camera_offset()) + Vector2(win_size)*.5f + shader.project(world_pos); } |