isle-portable/extensions
foxtacles be65af4550
Camera relative movement (#15)
* Decouple 3rd person camera from player movement

Arrow keys now move the player relative to the camera direction instead
of using tank controls. The camera stays static unless explicitly
controlled via right-click drag, mouse wheel, or touch gestures.

Adds a single hook in CalculateNewPosDir that lets the extension take
over movement computation. The extension manages its own velocity
smoothing, computes camera-relative directions from an absolute yaw,
and writes nav controller velocities via friend class access.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Clean up ThirdPersonCamera: remove dead m_orbitYaw, extract helpers

Remove m_orbitYaw (always DEFAULT_ORBIT_YAW) and pass yaw directly to
ComputeOrbitVectors, eliminating save/restore blocks at all call sites.
Extract GetLocalYaw() and InitAbsoluteYaw() helpers to deduplicate
repeated atan2 patterns. Simplify SetupCamera by passing DEFAULT_ORBIT_YAW
directly. Move TURN_RATE constant to file scope.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Hide cursor while orbiting 3rd person camera with right mouse button

Move SDL event handling from LegoInputManager::UpdateLastInputMethod to
an exported function called at the end of SDL_AppEvent, so cursor state
changes aren't overridden by isleapp's SDL_ShowCursor(). Use
SDL_SetWindowRelativeMouseMode to hide the cursor and freeze its position
while the right mouse button is held in 3rd person camera mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 04:26:23 +01:00
..
docs/multiplayer Fix camera flip bugs, refactor camera (#11) 2026-03-10 01:15:22 +01:00
include/extensions Camera relative movement (#15) 2026-03-11 04:26:23 +01:00
src Camera relative movement (#15) 2026-03-11 04:26:23 +01:00