Core/Movement: Don't compute orientation for vertical splines (#28556)

This commit is contained in:
Meji
2022-12-30 18:00:05 +01:00
committed by GitHub
parent 24d21301a6
commit 8d83c78618

View File

@@ -58,7 +58,8 @@ Location MoveSpline::computePosition(int32 time_point, int32 point_index) const
{
Vector3 hermite;
spline.evaluate_derivative(point_Idx, u, hermite);
c.orientation = std::atan2(hermite.y, hermite.x);
if (hermite.x != 0.f || hermite.y != 0.f)
c.orientation = std::atan2(hermite.y, hermite.x);
}
if (splineflags.backward)