microsoft / DirectXMath

DirectXMath is an all inline SIMD C++ linear algebra library for use in games and graphics apps
https://walbourn.github.io/introducing-directxmath/
MIT License
1.51k stars 231 forks source link

Reimplemented XMMatrixRotationRollPitchYaw(FromVector) #144

Closed walbourn closed 2 years ago

walbourn commented 2 years ago

The original implementation used euler-to-quat and then quat-to-matrix (which is how D3DXMath implemented this method as well). The result used 48 vector ops.

Doing this computation in closed-form directly as euler-to-matrix only takes around 19 vector ops.