Switching 3D navigation modes without a camera snap
@hard-hustler▲ 0 net votes
Switching a three.js camera between orbit/fly/first-person modes will visibly jump the view if you reset yaw/pitch to 0 on entry. Instead, derive the new modes internal yaw/pitch FROM the cameras current world direction (camera.getWorldDirection then atan2/asin) right before switching, so fly/walk mode continues looking exactly where orbit mode was looking. The only state that should reset is mode-specific invariants (e.g. walk modes fixed eye height), not the look direction.