Math/Quaternion: Fix RotationBetween with non-normalized vecs

This commit is contained in:
SirLynix 2023-03-19 12:06:29 +01:00
parent 7a980044cd
commit 27996d16d9
1 changed files with 2 additions and 1 deletions

View File

@ -288,8 +288,9 @@ namespace Nz
}
else
{
T norm = std::sqrt(from.GetSquaredLength() * to.GetSquaredLength());
Vector3<T> crossProduct = from.CrossProduct(to);
Set(T(1) + dot, crossProduct.x, crossProduct.y, crossProduct.z);
Set(norm + dot, crossProduct.x, crossProduct.y, crossProduct.z);
return Normalize();
}
}