feat(Core/Movement): added orientation input for Point movement (#3456)

This commit is contained in:
Andrius Peleckas 2020-10-05 12:28:25 +02:00 committed by GitHub
parent 4e9e915a1d
commit be09e03756
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 11 deletions

View file

@ -59,6 +59,12 @@ void PointMovementGenerator<T>::DoInitialize(T* unit)
}
if (speed > 0.0f)
init.SetVelocity(speed);
if (i_orientation > 0.0f)
{
init.SetFacing(i_orientation);
}
init.Launch();
}
@ -101,6 +107,12 @@ bool PointMovementGenerator<T>::DoUpdate(T* unit, uint32 /*diff*/)
init.MoveTo(i_x, i_y, i_z);
if (speed > 0.0f) // Default value for point motion type is 0.0, if 0.0 spline will use GetSpeed on unit
init.SetVelocity(speed);
if (i_orientation > 0.0f)
{
init.SetFacing(i_orientation);
}
init.Launch();
}