Skip to content

Raylib camera unification - #502

Merged
JanuszBedkowski merged 2 commits into
mainfrom
mp/raylib-camera-unification
Aug 21, 2026
Merged

Raylib camera unification#502
JanuszBedkowski merged 2 commits into
mainfrom
mp/raylib-camera-unification

Conversation

@michalpelka

@michalpelka michalpelka commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

michalpelka and others added 2 commits August 21, 2026 06:47
…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>
@JanuszBedkowski
JanuszBedkowski merged commit b351fc5 into main Aug 21, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants