51 uint32 nodeCount = path.size();
52 ASSERT(nodeCount > 1,
"SplineChainMovementGenerator::SendPathSpline: Every path must have source & destination (size > 1)! (%s)", owner->
GetGUID().
ToString().c_str());
58 init.
MoveTo(path[1],
false,
true);
68 ASSERT(index <
_chainSize,
"SplineChainMovementGenerator::SendSplineFor: referenced index (%u) higher than path size (%u)!", index,
_chainSize);
69 TC_LOG_DEBUG(
"movement.splinechain",
"SplineChainMovementGenerator::SendSplineFor: sending spline on index: {}. ({})", index, owner->
GetGUID().
ToString());
80 TC_LOG_DEBUG(
"movement.splinechain",
"SplineChainMovementGenerator::SendSplineFor: sent spline on index {}, duration: {} ms. ({})", index, actualDuration, owner->
GetGUID().
ToString());
91 TC_LOG_ERROR(
"movement",
"SplineChainMovementGenerator::Initialize: couldn't initialize generator, referenced spline is empty! ({})", owner->
GetGUID().
ToString());
97 TC_LOG_WARN(
"movement",
"SplineChainMovementGenerator::Initialize: couldn't initialize generator, _nextIndex is >= _chainSize ({})", owner->
GetGUID().
ToString());
110 TC_LOG_ERROR(
"movement.splinechain",
"SplineChainMovementGenerator::Initialize: attempted to resume spline chain from invalid resume state, _nextFirstWP >= path size (_nextIndex: {}, _nextFirstWP: {}). ({})",
_nextIndex,
_nextFirstWP, owner->
GetGUID().
ToString());
118 TC_LOG_DEBUG(
"movement.splinechain",
"SplineChainMovementGenerator::Initialize: resumed spline chain generator from resume state. ({})", owner->
GetGUID().
ToString());
198 if (
CreatureAI* AI = ownerCreature ? ownerCreature->
AI() :
nullptr)
#define TC_LOG_WARN(filterType__,...)
#define TC_LOG_DEBUG(filterType__,...)
#define TC_LOG_ERROR(filterType__,...)
@ SPLINE_CHAIN_MOTION_TYPE
@ MOVEMENTGENERATOR_FLAG_INITIALIZATION_PENDING
@ MOVEMENTGENERATOR_FLAG_DEACTIVATED
@ MOVEMENTGENERATOR_FLAG_FINALIZED
@ MOVEMENTGENERATOR_FLAG_INFORM_ENABLED
@ MOVEMENTGENERATOR_FLAG_INITIALIZED
std::optional< T > Optional
Optional helper class to wrap optional values within.
@ UNIT_STATE_ROAMING_MOVE
MovementGenerator * GetMovementGenerator(std::function< bool(MovementGenerator const *)> const &filter, MovementSlot slot=MOTION_SLOT_ACTIVE) const
void AddFlag(uint16 const flag)
bool HasFlag(uint16 const flag) const
void RemoveFlag(uint16 const flag)
void MoveTo(Vector3 const &destination, bool generatePath=true, bool forceDestination=false)
void SetWalk(bool enable)
void SetVelocity(float velocity)
void MovebyPath(PointsArray const &path, int32 pointId=0)
std::string ToString() const
static Creature * ToCreature(Object *o)
static ObjectGuid GetGUID(Object const *o)
SplineChainMovementGenerator(uint32 id, std::vector< SplineChainLink > const &chain, bool walk=false)
void Initialize(Unit *) override
std::vector< SplineChainLink > const & _chain
bool Update(Unit *, uint32) override
void Deactivate(Unit *) override
void Reset(Unit *) override
void SendSplineFor(Unit *owner, uint32 index, uint32 &duration)
void Finalize(Unit *, bool, bool) override
static void GetResumeInfo(SplineChainResumeInfo &info, Unit const *owner, Optional< uint32 > id={})
MovementGeneratorType GetMovementGeneratorType() const override
uint32 SendPathSpline(Unit *owner, float velocity, Movement::PointsArray const &path) const
void ClearUnitState(uint32 f)
MotionMaster * GetMotionMaster()
void AddUnitState(uint32 f)
std::unique_ptr< Movement::MoveSpline > movespline
std::vector< Vector3 > PointsArray
constexpr std::size_t size()
Movement::PointsArray Points
std::vector< SplineChainLink > const * Chain