Add GetRotationFromTo and FindBetween utilities to C# Quaternion API

#1885
This commit is contained in:
Wojtek Figat
2023-11-08 14:41:36 +01:00
parent 1a7770fba2
commit 11b60390b6
3 changed files with 113 additions and 7 deletions

View File

@@ -382,9 +382,8 @@ void Quaternion::GetRotationFromTo(const Float3& from, const Float3& to, Quatern
v0.Normalize();
v1.Normalize();
const float d = Float3::Dot(v0, v1);
// If dot == 1, vectors are the same
const float d = Float3::Dot(v0, v1);
if (d >= 1.0f)
{
result = Identity;