mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 17:27:36 +01:00
Core/Movement: implement a helper to get the velocity of a unit's ongoing spline
This commit is contained in:
@@ -162,6 +162,8 @@ void MoveSpline::Initialize(MoveSplineInitArgs const& args)
|
||||
vertical_acceleration = 0.f;
|
||||
effect_start_time = 0;
|
||||
|
||||
velocity = args.velocity;
|
||||
|
||||
// Check if its a stop spline
|
||||
if (args.flags.done)
|
||||
{
|
||||
@@ -185,15 +187,15 @@ void MoveSpline::Initialize(MoveSplineInitArgs const& args)
|
||||
}
|
||||
|
||||
MoveSpline::MoveSpline() : m_Id(0), time_passed(0),
|
||||
vertical_acceleration(0.f), initialOrientation(0.f), effect_start_time(0), point_Idx(0), point_Idx_offset(0),
|
||||
vertical_acceleration(0.f), initialOrientation(0.f), effect_start_time(0), point_Idx(0), point_Idx_offset(0), velocity(0.f),
|
||||
onTransport(false)
|
||||
{
|
||||
splineflags.done = true;
|
||||
}
|
||||
|
||||
MoveSplineInitArgs::MoveSplineInitArgs(size_t path_capacity /*= 16*/) : path_Idx_offset(0), velocity(0.f),
|
||||
parabolic_amplitude(0.f), time_perc(0.f), splineId(0), initialOrientation(0.f),
|
||||
HasVelocity(false), TransformForTransport(true)
|
||||
parabolic_amplitude(0.f), time_perc(0.f), splineId(0), initialOrientation(0.f), walk(false),
|
||||
HasVelocity(false), TransformForTransport(true)
|
||||
{
|
||||
path.reserve(path_capacity);
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@ namespace Movement
|
||||
int32 effect_start_time;
|
||||
int32 point_Idx;
|
||||
int32 point_Idx_offset;
|
||||
float velocity;
|
||||
|
||||
void init_spline(MoveSplineInitArgs const& args);
|
||||
|
||||
@@ -86,6 +87,7 @@ namespace Movement
|
||||
int32 Duration() const { return spline.length(); }
|
||||
MySpline const& _Spline() const { return spline; }
|
||||
int32 _currentSplineIdx() const { return point_Idx; }
|
||||
float Velocity() const { return velocity; }
|
||||
void _Finalize();
|
||||
void _Interrupt() { splineflags.done = true; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user