Raylib camera unification - #502
Merged
Merged
Conversation
…camera code Extends raylib_widgets::OrbitCamera with an Euler-angle + orthographic mode (rotateX/rotateY/translate/rotationCenter, ortho zoom/pan, 8 view presets, eased transitions) ported from multi_view_tls_registration_step_2's old GLUT-derived camera, driven through rlgl's manual matrix stack. The pre-existing azimuth/elevation/distance/target mode (used by camera_lidar_calibration/camera_lidar_intrinsics_calib) is untouched. - step2: migrated onto the shared OrbitCamera; rl_utils.cpp/.h deleted entirely -- generic pieces (ShowMainDockSpace, ImGuiHyperlink, an info window, double-precision ray/plane math) moved into raylib_widgets (AppShell.h/.cpp, RayPlaneD.h/.cpp), the rest folded directly into multi_view_tls_registration_gui.cpp since nothing else used it. - camera_lidar_trajectory_viewer: switched from raylib's Camera3D/ BeginMode3D onto the same Euler/rlgl camera engine as step2, dropping its toRL() Y-up render-space remap (renders in native Z-up world coordinates now, matching step2 and the GPU point cloud shader, which already reads the live rlgl matrix stack each frame regardless). - New shared raylib_widgets pieces used by both apps: OrbitCamera:: eulerScreenRay(), end3DMatrixStack(), showEulerCenterOfRotationWindow(), pickNearestPointOnLine() (nearest trajectory point to a ray, no cutoff). - Fixed trackpad-specific issues: OrbitCamera::zoom() now scales by the actual scroll magnitude instead of a quantized +-1 step; drag handling in both apps ignores input while Ctrl/Shift is held so a modifier-click's jitter can't be misread as a drag that cancels the transition it just started; camera_lidar_trajectory_viewer's Ctrl detection now also recognizes Cmd (Super) on macOS. Also ports two more pieces of the legacy GLUT apps' rendering (core's PointCloud(s)::render(), unusable under raylib's core-profile GL context) into step2's GPU-based ScanRenderer: intersection cross-section slabs (xz/yz/xy_intersection, filtered in the point shader via a fragment discard; the trajectory overlay is hidden outright while a slab is active, matching the original) and the corresponding reference grids (xz/yz/xy_grid_10x10/1x1/0.1x0.1, drawn via rlgl immediate-mode lines). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
raylib's default exit key (Esc) closes the window outright, which is too easy to trigger by accident (e.g. backing out of a dialog or gizmo drag). SetExitKey(KEY_NULL) disables it; neither app binds a replacement quit key. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Manual tests:
https://youtu.be/IHgCUQOg24c