21#include "G3DPosition.hpp"
35 : _movementId(id), _destination(x, y, z), _speed(speed), _generatePath(generatePath), _finalOrient(finalOrient),
36 i_faceTarget(faceTarget), _speedSelectionMode(speedSelectionMode), _closeEnoughDistance(closeEnoughDistance)
43 if (spellEffectExtraData)
44 this->
i_spellEffectExtra = std::make_unique<Movement::SpellEffectExtraData>(*spellEffectExtraData);
79 bool result = path.
CalculatePath(dest.x, dest.y, dest.z,
false);
122 creature->SignalFormationMovement();
168 creature->SignalFormationMovement();
MovementWalkRunSpeedSelectionMode
@ MOVEMENTGENERATOR_FLAG_INITIALIZATION_PENDING
@ MOVEMENTGENERATOR_FLAG_DEACTIVATED
@ MOVEMENTGENERATOR_FLAG_FINALIZED
@ MOVEMENTGENERATOR_FLAG_TRANSITORY
@ MOVEMENTGENERATOR_FLAG_INTERRUPTED
@ MOVEMENTGENERATOR_FLAG_INFORM_ENABLED
@ MOVEMENTGENERATOR_FLAG_INITIALIZED
@ MOVEMENTGENERATOR_FLAG_SPEED_UPDATE_PENDING
std::optional< T > Optional
Optional helper class to wrap optional values within.
@ UNIT_STATE_ROAMING_MOVE
void Finalize(Unit *owner, bool active, bool movementInform) override
MovementGeneratorType GetMovementGeneratorType() const override
void SetNoCallAssistance(bool val)
void MoveSeekAssistanceDistract(uint32 timer)
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 SetFacing(float angle)
void SetSpellEffectExtraData(SpellEffectExtraData const &spellEffectExtraData)
void MovebyPath(PointsArray const &path, int32 pointId=0)
static Creature * ToCreature(Object *o)
Movement::PointsArray const & GetPath() const
void ShortenPathUntilDist(G3D::Vector3 const &point, float dist)
PathType GetPathType() const
bool CalculatePath(float destX, float destY, float destZ, bool forceDest=false)
MovementWalkRunSpeedSelectionMode _speedSelectionMode
Optional< float > _closeEnoughDistance
Optional< float > _finalOrient
if set then unit will turn to specified _orient in provided _pos
void MovementInform(Unit *)
void Deactivate(Unit *owner) override
void Initialize(Unit *owner) override
PointMovementGenerator(uint32 id, float x, float y, float z, bool generatePath, Optional< float > speed={}, Optional< float > finalOrient={}, Unit const *faceTarget=nullptr, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={})
MovementGeneratorType GetMovementGeneratorType() const override
std::unique_ptr< Movement::SpellEffectExtraData > i_spellEffectExtra
Unit const * i_faceTarget
bool Update(Unit *owner, uint32 diff) override
void Finalize(Unit *owner, bool active, bool movementInform) override
void Reset(Unit *owner) override
void ClearUnitState(uint32 f)
virtual bool IsMovementPreventedByCasting() const
MotionMaster * GetMotionMaster()
void AddUnitState(uint32 f)
bool HasUnitState(const uint32 f) const
std::unique_ptr< Movement::MoveSpline > movespline
void MovePosition(Position &pos, float dist, float angle)
@ CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY
constexpr float GetPositionX() const
constexpr float GetPositionY() const
float GetRelativeAngle(float x, float y) const
float GetExactDist(float x, float y, float z) const
constexpr float GetPositionZ() const