mirror of
https://github.com/bevyengine/bevy.git
synced 2026-05-06 06:06:42 -04:00
0b49ff72d4
# Objective - Adds ``SnapToView`` camera controller as solution to #23499 ## Solution - Adds ``snap_to_view`` module behind ``free_camera`` feature flag ## Testing - Manually tested with ``cargo run --example free_camera_controller --features="free_camera bevy_dev_tools"`` and ``cargo run --example scene_viewer --features="free_camera bevy_dev_tools"``: - All six hotkeys works. - [LCtrl +] Numpad1 - Snap to front/back - [LCtrl +] Numpad3 - Snap to right/left - [LCtrl +] Numpad7 - Snap to top/bottom - Tested on Linux (Wayland) --- ## Showcase https://github.com/user-attachments/assets/cca71180-c273-473f-a168-9793438d861f Add ``SnapToViewCamera`` component to any ``Camera3d`` entity. Change parameters inside ``SnapToViewCamera`` to change snap speed and hotkeys. ```rust app.add_plugins(SnapToViewPlugin); commands.spawn(( Camera3d::default(), SnapToViewCamera::default(), )); ``` --------- Co-authored-by: taishi-sama <alexandra.2002.mikh@gmail.com>