MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / Lerp

Method Lerp

TombEngine/Scripting/Internal/TEN/Types/Rotation/Rotation.cpp:95–100  ·  view source on GitHub ↗

Get the linearly interpolated Rotation between this Rotation and the input Rotation according to the input alpha. @function Lerp @tparam Rotation rot Interpolation target. @tparam float alpha Interpolation alpha in the range [0, 1]. @treturn Rotation Linearly interpolated rotation.

Source from the content-addressed store, hash-verified

93 // @tparam float alpha Interpolation alpha in the range [0, 1].
94 // @treturn Rotation Linearly interpolated rotation.
95 Rotation Rotation::Lerp(const Rotation& rot, float alpha) const
96 {
97 auto orientFrom = ToEulerAngles();
98 auto orientTo = rot.ToEulerAngles();
99 return Rotation(EulerAngles::Lerp(orientFrom, orientTo, alpha));
100 }
101
102 /// Get the normalized direction vector of this Rotation.
103 // Can be used to get an offset from a rotation by multiplying needed distance value with this vector.

Callers

nothing calls this directly

Calls 4

ToEulerAnglesFunction · 0.85
LerpFunction · 0.85
RotationClass · 0.70
ToEulerAnglesMethod · 0.45

Tested by

no test coverage detected