MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Slerp

Method Slerp

Source/Engine/Core/Math/Vector2.h:562–569  ·  view source on GitHub ↗

Performs a spherical linear interpolation between two vectors.

Source from the content-addressed store, hash-verified

560
561 // Performs a spherical linear interpolation between two vectors.
562 static void Slerp(const Vector2Base& start, const Vector2Base& end, T amount, Vector2Base& result)
563 {
564 T dot = Math::Clamp(Dot(start, end), -1.0f, 1.0f);
565 T theta = Math::Acos(dot) * amount;
566 Vector2Base relativeVector = end - start * dot;
567 relativeVector.Normalize();
568 result = ((start * Math::Cos(theta)) + (relativeVector * Math::Sin(theta)));
569 }
570
571 // Performs a spherical linear interpolation between two vectors.
572 static Vector2Base Slerp(const Vector2Base& start, const Vector2Base& end, T amount)

Callers

nothing calls this directly

Calls 7

ClampFunction · 0.85
DotFunction · 0.85
SlerpFunction · 0.85
AcosFunction · 0.70
CosFunction · 0.70
SinFunction · 0.70
NormalizeMethod · 0.45

Tested by

no test coverage detected