Mathlib: enable SIMD quaternions

Should match output code with the code in the game executable, as that has been compiled with SIMD enabled.
This commit is contained in:
Kawe Mazidjatari 2024-02-25 23:41:38 +01:00
parent bd6ffaf226
commit c6e2d5e31a
2 changed files with 3 additions and 2 deletions

View File

@ -62,5 +62,6 @@ target_precompile_headers( ${PROJECT_NAME} PRIVATE
)
target_compile_definitions( ${PROJECT_NAME} PRIVATE
"BUILDING_MATHLIB"
"ALLOW_SIMD_QUATERNION_MATH"
$<$<OR:$<CONFIG:Debug>,$<CONFIG:Profile>>:DEBUG_MATHLIB>
)

View File

@ -421,8 +421,8 @@ FORCEINLINE fltx4 QuaternionSlerpNoAlignSIMD(const fltx4& p, const fltx4& q, flo
SubFloat(result, 1) = SubFloat(q, 0);
SubFloat(result, 2) = -SubFloat(q, 3);
SubFloat(result, 3) = SubFloat(q, 2);
sclp = sin((1.0f - t) * (0.5f * M_PI));
sclq = sin(t * (0.5f * M_PI));
sclp = (float)sin((1.0f - t) * (0.5f * M_PI));
sclq = (float)sin(t * (0.5f * M_PI));
SubFloat(result, 0) = sclp * SubFloat(p, 0) + sclq * SubFloat(result, 0);
SubFloat(result, 1) = sclp * SubFloat(p, 1) + sclq * SubFloat(result, 1);
SubFloat(result, 2) = sclp * SubFloat(p, 2) + sclq * SubFloat(result, 2);