summaryrefslogtreecommitdiff
path: root/assets/final/shaders/render/scene_query_linear.wgsl
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-06 09:42:30 +0100
committerskal <pascal.massimino@gmail.com>2026-02-06 09:42:30 +0100
commitf87fed4fb8dbaba2406143168de6629d3d0a5a00 (patch)
tree328ff1d1c248da3a63c491b06d229b4b00ef29cb /assets/final/shaders/render/scene_query_linear.wgsl
parent4e10d1c0b7718509ba8197b869fc88a5f94b0630 (diff)
fix(math): Normalize axis in quat::from_axis to prevent scaling artifacts
Fixed critical bug causing mesh and bounding box stretching during rotation. ROOT CAUSE: quat::from_axis() did not normalize the input axis vector. When called with non-unit vectors (e.g., {0.5, 1.0, 0.0}), it created invalid quaternions that encoded scaling transformations instead of pure rotations. SYMPTOMS: - Mesh vertices stretched during rotation (non-uniform scaling) - Bounding boxes deformed and stretched - Transform matrices became non-orthogonal ISSUE LOCATIONS: - src/tests/test_mesh.cc:309 - axis {0.5, 1.0, 0.0} (length ≈1.118) - src/gpu/effects/flash_cube_effect.cc:79 - axis {0.3, 1, 0.2} (length ≈1.044) FIX: Added automatic normalization in quat::from_axis(): a = a.normalize(); // Ensure axis is unit vector RESULT: - All quaternions now represent pure rotations - No scaling artifacts during rotation - Bounding boxes remain orthogonal - Fixes Task A (test_mesh stretching bug) SAFETY: This change is backward compatible. Code that already passed normalized axes will work identically (normalizing a unit vector = identity). handoff(Claude): Rotation stretching bug fixed. Both shader normal transformation (previous commit) and quaternion creation (this commit) now work correctly. test_mesh should display properly rotated meshes without distortion.
Diffstat (limited to 'assets/final/shaders/render/scene_query_linear.wgsl')
0 files changed, 0 insertions, 0 deletions