Moved the various Vector::Angle functions into their respective CPP files.

They didn't seem like prime candidates for inlining.
This commit is contained in:
intolerantape
2021-09-30 13:05:09 -07:00
parent f25dae2da2
commit 9ee0773ab1
8 changed files with 41 additions and 29 deletions

View File

@@ -390,3 +390,11 @@ double Double3::TriangleArea(const Double3& v0, const Double3& v1, const Double3
{
return (v2 - v0 ^ v1 - v0).Length() * 0.5;
}
double Double3::Angle(const Double3& from, const Double3& to)
{
const double dot = Math::Clamp(Dot(Normalize(from), Normalize(to)), -1.0, 1.0);
if (Math::Abs(dot) > (1.0 - ZeroTolerance))
return dot > 0.0 ? 0.0 : PI;
return Math::Acos(dot);
}