Add mount pitch and roll for realistic taxi flight animation

Flying mounts now tilt and bank realistically during taxi flights:
- Pitch (up/down): calculated from spline tangent's z-component (altitude change)
- Roll (banking): proportional to turn rate, clamped to ~40 degrees
- Yaw: existing horizontal orientation from spline direction

Implementation:
- Added mountPitch_ and mountRoll_ to Renderer (radians)
- Updated TaxiOrientationCallback to pass yaw, pitch, roll
- Calculate pitch using asin(tangent.z) for altitude tilt
- Calculate roll from yaw change rate: -orientDiff * 2.5, clamped to ±0.7 rad
- Applied to mount rotation: glm::vec3(pitch, roll, yaw)

This fixes the "weirdness" where mounts flew sideways or without natural banking.
This commit is contained in:
Kelsi 2026-02-08 22:05:38 -08:00
parent 2e0a7e0039
commit 92031102e4
5 changed files with 34 additions and 12 deletions

View file

@ -501,8 +501,8 @@ public:
using TaxiPrecacheCallback = std::function<void(const std::vector<glm::vec3>&)>;
void setTaxiPrecacheCallback(TaxiPrecacheCallback cb) { taxiPrecacheCallback_ = std::move(cb); }
// Taxi orientation callback (for mount rotation)
using TaxiOrientationCallback = std::function<void(float orientationRadians)>;
// Taxi orientation callback (for mount rotation: yaw, pitch, roll in radians)
using TaxiOrientationCallback = std::function<void(float yaw, float pitch, float roll)>;
void setTaxiOrientationCallback(TaxiOrientationCallback cb) { taxiOrientationCallback_ = std::move(cb); }
// Callback for when taxi flight is about to start (after mounting delay, before movement begins)