AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
ChaseMovementGenerator< T > Class Template Reference

#include "TargetedMovementGenerator.h"

Inheritance diagram for ChaseMovementGenerator< T >:
MovementGeneratorMedium< T, ChaseMovementGenerator< T > > TargetedMovementGeneratorBase MovementGenerator

Public Member Functions

 ChaseMovementGenerator (Unit *target, Optional< ChaseRange > range={}, Optional< ChaseAngle > angle={})
 
 ~ChaseMovementGenerator ()
 
MovementGeneratorType GetMovementGeneratorType ()
 
bool DoUpdate (T *, uint32)
 
void DoInitialize (T *)
 
void DoFinalize (T *)
 
void DoReset (T *)
 
void MovementInform (T *)
 
bool PositionOkay (T *owner, Unit *target, Optional< float > maxDistance, Optional< ChaseAngle > angle)
 
void unitSpeedChanged ()
 
UnitGetTarget () const
 
bool EnableWalking () const
 
bool HasLostTarget (Unit *unit) const
 
void SetOffsetAndAngle (std::optional< ChaseRange > dist, std::optional< ChaseAngle > angle)
 
void SetNewTarget (Unit *target)
 
void DistanceYourself (T *owner, float distance)
 
bool DispatchSplineToPosition (T *owner, float x, float y, float z, bool walk, bool cutPath, float maxTarget, bool forceDest, bool target=false)
 
void DoInitialize (Player *owner)
 
void DoInitialize (Creature *owner)
 
- Public Member Functions inherited from MovementGeneratorMedium< T, ChaseMovementGenerator< T > >
void Initialize (Unit *u) override
 
void Finalize (Unit *u) override
 
void Reset (Unit *u) override
 
bool Update (Unit *u, uint32 time_diff) override
 
- Public Member Functions inherited from MovementGenerator
virtual ~MovementGenerator ()
 
virtual uint32 GetSplineId () const
 
virtual void Pause (uint32)
 
virtual void Resume (uint32)
 
virtual bool GetResetPosition (float &, float &, float &)
 
- Public Member Functions inherited from TargetedMovementGeneratorBase
 TargetedMovementGeneratorBase (Unit *target)
 
void stopFollowing ()
 

Private Attributes

TimeTrackerSmall i_leashExtensionTimer
 
std::unique_ptr< PathGeneratori_path
 
TimeTrackerSmall i_recheckDistance
 
bool i_recalculateTravel
 
Optional< Position_lastTargetPosition
 
Optional< ChaseRange_range
 
Optional< ChaseAngle_angle
 
bool _movingTowards = true
 
bool _mutualChase = true
 
ChaseMovementMode m_currentMode
 

Additional Inherited Members

- Protected Attributes inherited from TargetedMovementGeneratorBase
FollowerReference i_target
 

Detailed Description

template<class T>
class ChaseMovementGenerator< T >

Constructor & Destructor Documentation

◆ ChaseMovementGenerator()

template<class T >
ChaseMovementGenerator< T >::ChaseMovementGenerator ( Unit target,
Optional< ChaseRange range = {},
Optional< ChaseAngle angle = {} 
)
inline
49 {}, Optional<ChaseAngle> angle = {})
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition Optional.h:24
@ CHASE_MODE_NORMAL
Definition TargetedMovementGenerator.h:39
ChaseMovementMode m_currentMode
Definition TargetedMovementGenerator.h:86
Optional< ChaseAngle > _angle
Definition TargetedMovementGenerator.h:82
std::unique_ptr< PathGenerator > i_path
Definition TargetedMovementGenerator.h:76
Optional< ChaseRange > _range
Definition TargetedMovementGenerator.h:81
bool i_recalculateTravel
Definition TargetedMovementGenerator.h:78
TimeTrackerSmall i_recheckDistance
Definition TargetedMovementGenerator.h:77
TimeTrackerSmall i_leashExtensionTimer
Definition TargetedMovementGenerator.h:75
Definition TargetedMovementGenerator.h:29

◆ ~ChaseMovementGenerator()

template<class T >
ChaseMovementGenerator< T >::~ChaseMovementGenerator ( )
inline
51{ }

Member Function Documentation

◆ DispatchSplineToPosition()

template<class T >
bool ChaseMovementGenerator< T >::DispatchSplineToPosition ( T *  owner,
float  x,
float  y,
float  z,
bool  walk,
bool  cutPath,
float  maxTarget,
bool  forceDest,
bool  target = false 
)
101{
102 Creature* cOwner = owner->ToCreature();
103
104 if (owner->IsHovering())
105 owner->UpdateAllowedPositionZ(x, y, z);
106
107 bool success = i_path->CalculatePath(x, y, z, forceDest);
108 if (!success || i_path->GetPathType() & PATHFIND_NOPATH)
109 {
110 if (cOwner)
111 {
113 }
114
115 owner->StopMoving();
116 return true;
117 }
118
119 if (cutPath)
120 i_path->ShortenPathUntilDist(G3D::Vector3(x, y, z), maxTarget);
121
122 if (cOwner)
123 {
124 cOwner->SetCannotReachTarget();
125 }
126
127 owner->AddUnitState(UNIT_STATE_CHASE_MOVE);
128 i_recalculateTravel = true;
129
130 Movement::MoveSplineInit init(owner);
131 init.MovebyPath(i_path->GetPath());
132 if (target)
133 init.SetFacing(i_target.getTarget());
134 init.SetWalk(walk);
135 init.Launch();
136
137 return false;
138}
@ PATHFIND_NOPATH
Definition PathGenerator.h:50
@ UNIT_STATE_CHASE_MOVE
Definition UnitDefines.h:195
Definition Creature.h:43
void SetCannotReachTarget(ObjectGuid const &target=ObjectGuid::Empty)
Definition Creature.cpp:3676
Definition MoveSplineInit.h:71
Creature * ToCreature()
Definition Object.h:206
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:113
TO * getTarget() const
Definition Reference.h:95
FollowerReference i_target
Definition TargetedMovementGenerator.h:34
void UpdateAllowedPositionZ(float x, float y, float &z, float *groundZ=nullptr) const
Definition Object.cpp:1559

References Movement::MoveSplineInit::Launch(), Movement::MoveSplineInit::MovebyPath(), PATHFIND_NOPATH, Creature::SetCannotReachTarget(), Movement::MoveSplineInit::SetFacing(), Movement::MoveSplineInit::SetWalk(), Object::ToCreature(), UNIT_STATE_CHASE_MOVE, and WorldObject::UpdateAllowedPositionZ().

◆ DistanceYourself()

template<class T >
template void ChaseMovementGenerator< T >::DistanceYourself ( T *  owner,
float  distance 
)
82{
83 // make a new path if we have to...
84 if (!i_path)
85 i_path = std::make_unique<PathGenerator>(owner);
86
87 float x, y, z;
88 i_target->GetNearPoint(owner, x, y, z, owner->GetBoundaryRadius(), distance, i_target->GetAngle(owner));
89 if (DispatchSplineToPosition(owner, x, y, z, false, false, 0.f, false, false))
90 {
92 if constexpr (!std::is_same_v<T, Player>)
93 {
94 owner->AI()->DistancingStarted();
95 }
96 }
97}
@ CHASE_MODE_DISTANCING
Definition TargetedMovementGenerator.h:41
bool DispatchSplineToPosition(T *owner, float x, float y, float z, bool walk, bool cutPath, float maxTarget, bool forceDest, bool target=false)
Definition TargetedMovementGenerator.cpp:100

References CHASE_MODE_DISTANCING.

Referenced by MotionMaster::DistanceYourself().

◆ DoFinalize()

template<class T >
template void ChaseMovementGenerator< T >::DoFinalize ( T *  )
374{
375 owner->ClearUnitState(UNIT_STATE_CHASE | UNIT_STATE_CHASE_MOVE);
376 if (Creature* cOwner = owner->ToCreature())
377 {
378 cOwner->SetCannotReachTarget();
379 }
380}
@ UNIT_STATE_CHASE
Definition UnitDefines.h:175

References Object::ToCreature(), UNIT_STATE_CHASE, and UNIT_STATE_CHASE_MOVE.

◆ DoInitialize() [1/3]

void ChaseMovementGenerator< Creature >::DoInitialize ( Creature owner)
363{
364 i_path = nullptr;
365 _lastTargetPosition.reset();
368 owner->SetWalk(false);
370}
@ BASE_ATTACK
Definition Unit.h:210
Optional< Position > _lastTargetPosition
Definition TargetedMovementGenerator.h:80
bool SetWalk(bool enable) override
Enable or disable the creature's walk mode by removing: MOVEMENTFLAG_WALKING. Infom also the client.
Definition Creature.cpp:3207
void AddUnitState(uint32 f)
Definition Unit.h:690
uint32 GetAttackTime(WeaponAttackType att) const
Definition Unit.h:861
void Reset(int32 interval)
Definition Timer.h:249

References Unit::AddUnitState(), BASE_ATTACK, Unit::GetAttackTime(), Creature::SetWalk(), and UNIT_STATE_CHASE.

◆ DoInitialize() [2/3]

void ChaseMovementGenerator< Player >::DoInitialize ( Player owner)
354{
355 i_path = nullptr;
356 _lastTargetPosition.reset();
357 owner->StopMoving();
359}
void StopMoving()
Definition Unit.cpp:16733

References Unit::AddUnitState(), Unit::StopMoving(), and UNIT_STATE_CHASE.

◆ DoInitialize() [3/3]

template<class T >
void ChaseMovementGenerator< T >::DoInitialize ( T *  )

◆ DoReset()

template<class T >
template void ChaseMovementGenerator< T >::DoReset ( T *  )
384{
385 DoInitialize(owner);
386}

◆ DoUpdate()

template<class T >
template bool ChaseMovementGenerator< T >::DoUpdate ( T *  ,
uint32   
)
Todo:
: Research how it should actually work.
142{
143 if (!i_target.isValid() || !i_target->IsInWorld() || !owner->IsInMap(i_target.getTarget()))
144 return false;
145
146 if (!owner || !owner->IsAlive())
147 return false;
148
149 if (owner->HasUnitState(UNIT_STATE_NO_COMBAT_MOVEMENT)) // script paused combat movement
150 {
151 owner->StopMoving();
152 _lastTargetPosition.reset();
153 return true;
154 }
155
156 Creature* cOwner = owner->ToCreature();
157 bool isStoppedBecauseOfCasting = cOwner && cOwner->IsMovementPreventedByCasting();
158
159 // the owner might be unable to move (rooted or casting), or we have lost the target, pause movement
160 if (owner->HasUnitState(UNIT_STATE_NOT_MOVE) || HasLostTarget(owner) || isStoppedBecauseOfCasting)
161 {
162 owner->StopMoving();
163 _lastTargetPosition.reset();
164 if (cOwner)
165 {
166 if (isStoppedBecauseOfCasting)
167 {
168 // Don't reset leash timer if it's a spell like Shoot with a short cast time.
170 Spell *spell = cOwner->GetFirstCurrentCastingSpell();
171 bool spellHasLongCast = spell && spell->GetCastTime() > 1 * SECOND * IN_MILLISECONDS;
172 if (spellHasLongCast)
173 cOwner->UpdateLeashExtensionTime();
174 }
175 else
176 cOwner->UpdateLeashExtensionTime();
177
178 cOwner->SetCannotReachTarget();
179 }
180 return true;
181 }
182
183 bool forceDest =
184 //(cOwner && (cOwner->isWorldBoss() || cOwner->IsDungeonBoss())) || // force for all bosses, even not in instances
185 (i_target->IsPlayer() && i_target->ToPlayer()->IsGameMaster()) || // for .npc follow
186 (owner->CanFly())
187 ; // closes "bool forceDest", that way it is more appropriate, so we can comment out crap whenever we need to
188
189 Unit* target = i_target.getTarget();
190
191 bool mutualChase = IsMutualChase(owner, target);
192 bool const mutualTarget = target->GetVictim() == owner;
193 float const chaseRange = GetChaseRange(owner, target);
194 float const meleeRange = owner->GetMeleeRange(target);
195 float const minTarget = (_range ? _range->MinTolerance : 0.0f) + chaseRange;
196 float const maxRange = _range ? _range->MaxRange + chaseRange : meleeRange; // melee range already includes hitboxes
197 float const maxTarget = _range ? _range->MaxTolerance + chaseRange : CONTACT_DISTANCE + chaseRange;
198
199 Optional<ChaseAngle> angle = mutualChase ? Optional<ChaseAngle>() : _angle;
200
201 // Prevent almost infinite spinning of mutual targets.
202 if (angle && !mutualChase && _mutualChase && mutualTarget && chaseRange < meleeRange)
203 {
204 angle = Optional<ChaseAngle>();
205 mutualChase = true;
206 }
207
208 // Prevent almost infinite spinning for pets with mutualTarget
209 // _mutualChase is false for previous check
210 if (angle && !mutualChase && !_mutualChase && mutualTarget && chaseRange < meleeRange && cOwner && cOwner->IsPet())
211 {
212 angle = Optional<ChaseAngle>();
213 mutualChase = true;
214 }
215
216 // periodically check if we're already in the expected range...
217 i_recheckDistance.Update(time_diff);
219 {
220 i_recheckDistance.Reset(400); // Sniffed value
221
222 if (i_recalculateTravel && PositionOkay(owner, target, _movingTowards ? maxTarget : Optional<float>(), angle))
223 {
224 if ((owner->HasUnitState(UNIT_STATE_CHASE_MOVE) && !target->isMoving() && !mutualChase) || _range)
225 {
226 i_recalculateTravel = false;
227 i_path = nullptr;
228 if (cOwner)
229 cOwner->SetCannotReachTarget();
230 owner->StopMoving();
231 owner->SetInFront(target);
232 MovementInform(owner);
233 return true;
234 }
235 }
236 }
237
238 // if we're done moving, we want to clean up
239 if (owner->HasUnitState(UNIT_STATE_CHASE_MOVE) && owner->movespline->Finalized())
240 {
241 i_recalculateTravel = false;
242 i_path = nullptr;
243 if (cOwner)
244 cOwner->SetCannotReachTarget();
245 owner->ClearUnitState(UNIT_STATE_CHASE_MOVE);
246 owner->SetInFront(target);
247 MovementInform(owner);
248 }
249
250 if (cOwner)
251 {
252 if (owner->movespline->Finalized() && cOwner->IsWithinMeleeRange(target))
253 { // Mobs should chase you infinitely if you stop and wait every few seconds.
254 i_leashExtensionTimer.Update(time_diff);
256 {
258 cOwner->UpdateLeashExtensionTime();
259 }
260 }
261 else if (i_recalculateTravel)
263 }
264
265 // if the target moved, we have to consider whether to adjust
266 if (!_lastTargetPosition || target->GetPosition() != _lastTargetPosition.value() || mutualChase != _mutualChase || !owner->IsWithinLOSInMap(target))
267 {
269 _mutualChase = mutualChase;
270 if (owner->HasUnitState(UNIT_STATE_CHASE_MOVE) || !PositionOkay(owner, target, maxTarget, angle))
271 {
272 // can we get to the target?
273 if (cOwner && !target->isInAccessiblePlaceFor(cOwner))
274 {
275 cOwner->SetCannotReachTarget(target->GetGUID());
276 cOwner->StopMoving();
277 i_path = nullptr;
278 return true;
279 }
280
281 // figure out which way we want to move
282 float x, y, z;
283 target->GetPosition(x, y, z);
284 bool withinRange = owner->IsInDist(target, maxRange);
285 bool withinLOS = owner->IsWithinLOS(x, y, z);
286 bool moveToward = !(withinRange && withinLOS);
287
288 // make a new path if we have to...
289 if (!i_path || moveToward != _movingTowards)
290 i_path = std::make_unique<PathGenerator>(owner);
291 else
292 i_path->Clear();
293
294 // Predict chase destination to keep up with chase target
295 float additionalRange = 0;
296 bool predictDestination = !mutualChase && target->isMoving();
297 if (predictDestination)
298 {
299 UnitMoveType moveType = MOVE_RUN;
300 if (target->CanFly())
302 else
303 {
304 if (target->IsWalking())
305 moveType = MOVE_WALK;
306 else
308 }
309 float speed = target->GetSpeed(moveType) * 0.5f;
310 additionalRange = owner->GetExactDistSq(target) < G3D::square(speed) ? 0 : speed;
311 }
312
313 bool shortenPath;
314
315 // if we want to move toward the target and there's no fixed angle...
316 if (moveToward && !angle)
317 {
318 // ...we'll pathfind to the center, then shorten the path
319 shortenPath = true;
320 }
321 else
322 {
323 // otherwise, we fall back to nearpoint finding
324 target->GetNearPoint(owner, x, y, z, (moveToward ? maxTarget : minTarget) - chaseRange - additionalRange, 0, angle ? target->ToAbsoluteAngle(angle->RelativeAngle) : target->GetAngle(owner));
325 shortenPath = false;
326 }
327
328 bool walk = false;
329 if (cOwner && !cOwner->IsPet())
330 {
331 switch (cOwner->GetMovementTemplate().GetChase())
332 {
334 walk = owner->IsWalking();
335 break;
337 walk = true;
338 break;
339 default:
340 break;
341 }
342 }
343
344 DispatchSplineToPosition(owner, x, y, z, walk, shortenPath, maxTarget, forceDest, true);
345 }
346 }
347
348 return true;
349}
constexpr auto SECOND
Definition Common.h:46
constexpr auto IN_MILLISECONDS
Definition Common.h:53
#define CONTACT_DISTANCE
Definition ObjectDefines.h:23
float GetChaseRange(Unit const *owner, Unit const *target)
Definition TargetedMovementGenerator.cpp:35
static bool IsMutualChase(Unit *owner, Unit *target)
Definition TargetedMovementGenerator.cpp:27
@ MOVEMENTFLAG_BACKWARD
Definition UnitDefines.h:368
@ UNIT_STATE_NOT_MOVE
Definition UnitDefines.h:220
@ UNIT_STATE_NO_COMBAT_MOVEMENT
Definition UnitDefines.h:200
UnitMoveType
Definition UnitDefines.h:350
@ MOVE_FLIGHT
Definition UnitDefines.h:357
@ MOVE_FLIGHT_BACK
Definition UnitDefines.h:358
@ MOVE_RUN
Definition UnitDefines.h:352
@ MOVE_RUN_BACK
Definition UnitDefines.h:353
@ MOVE_WALK
Definition UnitDefines.h:351
bool _mutualChase
Definition TargetedMovementGenerator.h:84
bool PositionOkay(T *owner, Unit *target, Optional< float > maxDistance, Optional< ChaseAngle > angle)
Definition TargetedMovementGenerator.cpp:47
void MovementInform(T *)
Definition TargetedMovementGenerator.cpp:389
bool HasLostTarget(Unit *unit) const
Definition TargetedMovementGenerator.h:67
bool _movingTowards
Definition TargetedMovementGenerator.h:83
void UpdateLeashExtensionTime()
Definition Creature.cpp:3729
CreatureMovementData const & GetMovementTemplate() const
Definition Creature.cpp:2996
bool IsMovementPreventedByCasting() const override
Definition Creature.cpp:3654
bool isValid() const
Definition Reference.h:79
Definition Spell.h:294
int32 GetCastTime() const
Definition Spell.h:557
Definition Unit.h:620
float GetSpeed(UnitMoveType mtype) const
Definition Unit.cpp:14525
virtual bool CanFly() const =0
bool IsPet() const
Definition Unit.h:749
bool IsWithinMeleeRange(Unit const *obj, float dist=0.f) const
Definition Unit.cpp:666
bool isInAccessiblePlaceFor(Creature const *c) const
Definition Unit.cpp:4258
bool HasUnitMovementFlag(uint32 f) const
Definition Unit.h:729
bool isMoving() const
Definition Unit.h:1625
Unit * GetVictim() const
Definition Unit.h:850
Spell * GetFirstCurrentCastingSpell() const
Definition Unit.cpp:4200
bool IsWalking() const
Definition Unit.h:1624
void GetNearPoint(WorldObject const *searcher, float &x, float &y, float &z, float searcher_size, float distance2d, float absAngle, float controlZ=0, Position const *startPos=nullptr) const
Definition Object.cpp:2619
CreatureChaseMovementType GetChase() const
Definition CreatureData.h:150
void GetPosition(float &x, float &y) const
Definition Position.h:126
void Update(int32 diff)
Definition Timer.h:239
bool Passed() const
Definition Timer.h:244

References AlwaysWalk, BASE_ATTACK, Unit::CanFly(), CanWalk, CONTACT_DISTANCE, Position::GetAngle(), Unit::GetAttackTime(), Spell::GetCastTime(), CreatureMovementData::GetChase(), GetChaseRange(), Unit::GetFirstCurrentCastingSpell(), Object::GetGUID(), Creature::GetMovementTemplate(), WorldObject::GetNearPoint(), Position::GetPosition(), Unit::GetSpeed(), Unit::GetVictim(), Unit::HasUnitMovementFlag(), IN_MILLISECONDS, Unit::isInAccessiblePlaceFor(), Creature::IsMovementPreventedByCasting(), Unit::isMoving(), IsMutualChase(), Unit::IsPet(), Unit::IsWalking(), Unit::IsWithinMeleeRange(), MOVE_FLIGHT, MOVE_FLIGHT_BACK, MOVE_RUN, MOVE_RUN_BACK, MOVE_WALK, MOVEMENTFLAG_BACKWARD, SECOND, Creature::SetCannotReachTarget(), Unit::StopMoving(), Position::ToAbsoluteAngle(), Object::ToCreature(), UNIT_STATE_CHASE_MOVE, UNIT_STATE_NO_COMBAT_MOVEMENT, UNIT_STATE_NOT_MOVE, and Creature::UpdateLeashExtensionTime().

◆ EnableWalking()

template<class T >
bool ChaseMovementGenerator< T >::EnableWalking ( ) const
inline
66{ return false; }

◆ GetMovementGeneratorType()

template<class T >
MovementGeneratorType ChaseMovementGenerator< T >::GetMovementGeneratorType ( )
inlinevirtual

Implements MovementGenerator.

53{ return CHASE_MOTION_TYPE; }
@ CHASE_MOTION_TYPE
Definition MotionMaster.h:45

References CHASE_MOTION_TYPE.

◆ GetTarget()

template<class T >
Unit * ChaseMovementGenerator< T >::GetTarget ( ) const
inline

◆ HasLostTarget()

template<class T >
bool ChaseMovementGenerator< T >::HasLostTarget ( Unit unit) const
inline
67{ return unit->GetVictim() != this->GetTarget(); }
Unit * GetTarget() const
Definition TargetedMovementGenerator.h:64

References ChaseMovementGenerator< T >::GetTarget(), and Unit::GetVictim().

◆ MovementInform()

template<class T >
template void ChaseMovementGenerator< T >::MovementInform ( T *  )
390{
391 if (!owner->IsCreature())
392 return;
393
394 switch (m_currentMode)
395 {
396 default:
397 {
398 // Pass back the GUIDLow of the target. If it is pet's owner then PetAI will handle
399 if (CreatureAI* AI = owner->ToCreature()->AI())
400 AI->MovementInform(CHASE_MOTION_TYPE, i_target.getTarget()->GetGUID().GetCounter());
401 break;
402 }
404 {
405 if (CreatureAI* AI = owner->ToCreature()->AI())
406 AI->DistancingEnded();
407 break;
408 }
409 }
410
412}
Definition CreatureAI.h:71
LowType GetCounter() const
Definition ObjectGuid.h:145

References CHASE_MODE_DISTANCING, CHASE_MODE_NORMAL, and CHASE_MOTION_TYPE.

◆ PositionOkay()

template<class T >
bool ChaseMovementGenerator< T >::PositionOkay ( T *  owner,
Unit target,
Optional< float >  maxDistance,
Optional< ChaseAngle angle 
)
48{
49 float const distSq = owner->GetExactDistSq(target);
50
51 // Distance between owner(chaser) and target is greater than the allowed distance.
52 if (maxDistance && distSq > G3D::square(*maxDistance))
53 return false;
54
55 // owner's relative angle to its target is not within boundaries
56 if (angle && !angle->IsAngleOkay(target->GetRelativeAngle(owner)))
57 return false;
58
59 // owner cannot see its target
60 if (!owner->IsWithinLOSInMap(target))
61 return false;
62 return true;
63}
float GetRelativeAngle(const Position *pos) const
Definition Position.h:201

References Position::GetRelativeAngle().

◆ SetNewTarget()

template<class T >
template void ChaseMovementGenerator< T >::SetNewTarget ( Unit target)
75{
76 i_target.link(target, this);
77 _lastTargetPosition.reset();
78}
void link(TO *toObj, FROM *fromObj)
Definition Reference.h:45

Referenced by MotionMaster::MoveChase().

◆ SetOffsetAndAngle()

template<class T >
template void ChaseMovementGenerator< T >::SetOffsetAndAngle ( std::optional< ChaseRange dist,
std::optional< ChaseAngle angle 
)
67{
68 _range = dist;
69 _angle = angle;
70 _lastTargetPosition.reset();
71}

Referenced by MotionMaster::MoveChase().

◆ unitSpeedChanged()

template<class T >
void ChaseMovementGenerator< T >::unitSpeedChanged ( )
inlinevirtual

Member Data Documentation

◆ _angle

template<class T >
Optional<ChaseAngle> ChaseMovementGenerator< T >::_angle
private

◆ _lastTargetPosition

template<class T >
Optional<Position> ChaseMovementGenerator< T >::_lastTargetPosition
private

◆ _movingTowards

template<class T >
bool ChaseMovementGenerator< T >::_movingTowards = true
private

◆ _mutualChase

template<class T >
bool ChaseMovementGenerator< T >::_mutualChase = true
private

◆ _range

template<class T >
Optional<ChaseRange> ChaseMovementGenerator< T >::_range
private

◆ i_leashExtensionTimer

template<class T >
TimeTrackerSmall ChaseMovementGenerator< T >::i_leashExtensionTimer
private

◆ i_path

template<class T >
std::unique_ptr<PathGenerator> ChaseMovementGenerator< T >::i_path
private

◆ i_recalculateTravel

template<class T >
bool ChaseMovementGenerator< T >::i_recalculateTravel
private

◆ i_recheckDistance

template<class T >
TimeTrackerSmall ChaseMovementGenerator< T >::i_recheckDistance
private

◆ m_currentMode

template<class T >
ChaseMovementMode ChaseMovementGenerator< T >::m_currentMode
private

The documentation for this class was generated from the following files: