Math/Quaternion: Fix LookAt forward vector

This commit is contained in:
SirLynix 2023-03-09 17:48:14 +01:00
parent d7dda716fe
commit 7e18c4a46e
1 changed files with 1 additions and 1 deletions

View File

@ -730,7 +730,7 @@ namespace Nz
{
// From https://gamedev.stackexchange.com/questions/53129/quaternion-look-at-with-up-vector
Vector3<T> forward_w(1, 0, 0);
Vector3<T> forward_w = Vector3<T>::Forward();
Vector3<T> axis = Vector3<T>::CrossProduct(forward, forward_w);
RadianAngle<T> angle = std::acos(Vector3<T>::DotProduct(forward, forward_w));