Exercise 2: Why Quaternions Fix the Slider Bug but Not a Debug Overlay Bug — Possible Solution ==================================================================== WHY THE QUATERNION SWITCH FIXES THE TESTER'S BUG ------------------------------ The tester's original bug report was about the yaw and roll SLIDERS in the inventory screen losing independent control of each other at pitch=90 degrees - a direct symptom of the underlying orientation being represented and composed as three sequential Euler-angle rotations, which Step 5 verified genuinely collapses to a single combined parameter at that exact pitch. Step 6 replaced that Euler-angle-based control scheme with a quaternion-driven virtual trackball - the player no longer manipulates yaw/pitch/roll sliders directly at all, so there is no Euler-angle decomposition anywhere in the control path anymore for the singularity to affect. Since the trackball's own quaternion composition was verified to stay smooth straight through the orientation that broke the old sliders, this bug is genuinely and fully fixed for anyone using the trackball control. WHY A DEBUG OVERLAY BUG WOULD SURVIVE THE SAME FIX ------------------------------ A hypothetical debug overlay that displays the chest's current orientation as numeric yaw/pitch/roll values necessarily has to CONVERT the internal quaternion back into Euler angles to have numbers to display at all. Step 6 explicitly verified that this conversion still collapses different original yaw/roll combinations (such as 30/10 and 40/20) down to the identical displayed numbers at pitch=90 degrees - the quaternion switch changed how the orientation is stored and manipulated internally, but did not change the mathematical fact that a single orientation at that exact pitch value genuinely doesn't carry separate, independently recoverable yaw and roll information. Displaying that orientation as Euler angles, no matter what internal representation produced it, runs into the same wall. THE KEY DISTINCTION ------------------------------ The trackball bug was caused by ROUTING CONTROL AND COMPOSITION through the Euler-angle parameterization - switching to quaternions removes that routing entirely. The debug-overlay bug would be caused by the GEOMETRIC FACT that the orientation itself, at that exact pitch, doesn't have independently recoverable yaw and roll values - no choice of internal representation can restore information that was never uniquely present in the orientation to begin with. WHY THIS WORKS AS AN ANSWER ------------------------------ The explanation correctly separates what the quaternion switch actually changes (the internal composition/control pathway, fixing the trackball bug) from what it cannot change (a genuine geometric fact about that specific orientation, which any Euler-angle-based display would still expose), grounding both claims in this chapter's own Step 5 and Step 6 verified findings.