34 u = (time_point -
spline.
length(point_index)) / (
float)seg_time;
61 if (hermite.x != 0.f || hermite.y != 0.f)
114 el = std::max(z_now, final_z);
119 return SecToMS(length / velocity);
176 TC_LOG_ERROR(
"misc",
"MoveSpline::init_spline: zero length spline, wrong input data?");
233 vertical_acceleration(0.f), initialOrientation(0.f), effect_start_time(0), point_Idx(0), point_Idx_offset(0), velocity(0.f),
234 onTransport(false), splineIsFacingOnly(false)
243#define CHECK(exp, verbose) \
247 TC_LOG_ERROR("misc.movesplineinitargs", "MoveSplineInitArgs::Validate: expression '{}' failed for {}", #exp, (verbose ? unit->GetDebugInfo() : unit->GetGUID().ToString()));\
249 TC_LOG_ERROR("misc.movesplineinitargs", "MoveSplineInitArgs::Validate: expression '{}' failed for cyclic spline continuation", #exp); \
270 if ((
path[i + 1] -
path[i]).length() < 0.1f)
276parabolic_amplitude(0.f), vertical_acceleration(0.0f), effect_start_time_percent(0.f), effect_start_time(0ms),
277splineId(0), initialOrientation(0.f),
278walk(false), HasVelocity(false), TransformForTransport(true)
280 path.reserve(path_capacity);
300 ASSERT(minimal_diff >= 0);
302 ms_time_diff -= minimal_diff;
333 args.splineId =
m_Id;
335 args.velocity = 1.0f;
336 args.HasVelocity =
true;
338 if (args.Validate(
nullptr))
349 if (args.Validate(
nullptr))
368 std::stringstream str;
369 str <<
"MoveSpline" << std::endl;
370 str <<
"spline Id: " <<
GetId() << std::endl;
373 str <<
"facing angle: " <<
facing.
angle << std::endl;
378 str <<
"time passed: " <<
time_passed << std::endl;
379 str <<
"total time: " <<
Duration() << std::endl;
380 str <<
"spline point Id: " <<
point_Idx << std::endl;
DB2Storage< CurveEntry > sCurveStore("Curve.db2", &CurveLoadInfo::Instance)
#define TC_LOG_ERROR(filterType__,...)
#define CHECK(exp, verbose)
std::string ToString() const
bool hasFlag(uint32 f) const
int32 next_timestamp() const
std::string ToString() const
UpdateResult _updateState(int32 &ms_time_diff)
============================================================================================
Location ComputePosition() const
void computeFallElevation(int32 time_point, float &el) const
Optional< AnimTierTransition > anim_tier
void Initialize(MoveSplineInitArgs const &)
int32 currentPathIdx() const
float vertical_acceleration
Vector3 const & FinalDestination() const
int32 segment_time_elapsed() const
void computeParabolicElevation(int32 time_point, float &el) const
MoveSplineFlag splineflags
void init_spline(MoveSplineInitArgs const &args)
Optional< SpellEffectExtraData > spell_effect_extra
Location computePosition(int32 time_point, int32 point_index) const
ControlArray const & getPoints() const
float SegLength(index_type i) const
Vector3 const & getPoint(index_type i) const
void init_cyclic_spline(const Vector3 *controls, index_type count, EvaluationMode m, index_type cyclic_point, float orientation=0.0f)
void init_spline(const Vector3 *controls, index_type count, EvaluationMode m, float orientation=0.0f)
std::string ToString() const
index_type getPointCount() const
void set_length(index_type i, length_type length)
length_type length() const
void evaluate_derivative(float t, Vector3 &hermite) const
void evaluate_percent(float t, Vector3 &c) const
std::string ToString() const
uint32 computeDuration(float length, float velocity)
float computeFallTime(float path_length, bool isSafeFall)
uint32 SecToMS(float sec)
float computeFallElevation(float t_passed, bool isSafeFall, float start_velocity=0.0f)
@ MONSTER_MOVE_FACING_TARGET
@ MONSTER_MOVE_FACING_ANGLE
@ MONSTER_MOVE_FACING_SPOT
CommonInitializer(float _velocity)
int32 operator()(Spline< int32 > &s, int32 i)
struct Movement::FacingInfo::@323 f
FallInitializer(float _start_elevation)
int32 operator()(Spline< int32 > &s, int32 i)
float effect_start_time_percent
float parabolic_amplitude
bool Validate(Unit *unit) const
============================================================================================
MoveSplineInitArgs(size_t path_capacity=16)
Optional< AnimTierTransition > animTier
Optional< SpellEffectExtraData > spellEffectExtra
bool _checkPathLengths() const
Milliseconds effect_start_time
float vertical_acceleration