10 #ifndef Navigation_PositionOnLivePath_H
11 #define Navigation_PositionOnLivePath_H
24 class IMovePositionOnLivePathPredicate;
55 PathEventList* GetPathEventList()
const {
return m_pathEventList; }
58 void ClearEventListLocation();
70 const Path* GetPath()
const;
71 const Vec3f& GetPosition()
const;
76 bool IsAtFirstNodeOfPath()
const;
77 bool IsAtLastNodeOfPath()
const;
79 bool IsAtFirstEdgeOfPath()
const;
80 bool IsAtLastEdgeOfPath()
const;
117 void InitOnPathLastNode(
Path* path);
119 void InitOnPathEdge(
Path* path,
const Vec3f& positionOnEdge,
KyUInt32 pathEdgeIdx);
151 bool IsAtLowerBoundOfLivePath()
const;
152 bool IsAtUpperBoundOfLivePath()
const;
329 template<
class TraverseLogic>
337 KyUInt32 GetNextPathEventIdx_Unsafe()
const;
339 KyUInt32 GetPrevPathEventIdx_Unsafe()
const;
341 void MoveForwardToNextPathEvent_Unsafe();
343 void MoveBackwardToPrevPathEvent_Unsafe();
345 void MoveForwardToNextPathEventInterval_Unsafe();
353 bool IsEventListStatusValid()
const;
355 void FixLocationOnEventListAfterMovingForward();
356 void FixLocationOnEventListAfterMovingBackward();
357 void StopAtEventAfterMovingForward();
358 void StopAtEventAfterMovingBackward();
359 void StopAtCheckPointAfterMovingForward();
361 template<
class TraverseLogic>
362 void GetCostAfterStopAtEventOrAtPathNode(
void* traverseLogicUserData,
const Vec3f& posBeforeMove,
const NavTag* navTag,
364 template<
class TraverseLogic>
365 void GetCostAfterStopAtEventOrAtPathNode(
void* traverseLogicUserData,
const Vec3f& posBeforeMove,
const NavTag* navTag,
367 template<
class TraverseLogic>
368 void GetCostAfterStopAtEventOrAtPathNode(
void* traverseLogicUserData,
const Vec3f& posBeforeMove,
const NavTag* navTag,
382 #endif // Navigation_PositionOnLivePath_H
void MoveForward_StopAtCheckPoint(KyFloat32 distanceMove)
This function moves forward the position along distanceMove meters measured on the broken-line...
Definition: positiononlivepath.inl:392
OnEventListStatus
Enumerates the admissible values for PositionOnLivePath status accordingly to its position relatively...
Definition: positiononlivepath.h:27
void MoveBackwardToPrevPathNode()
This function moves backward the position up to the previous Path node.
Definition: positiononlivepath.inl:436
void MoveBackwardToPreviousEventWithPredicate(IMovePositionOnLivePathPredicate *predicate)
This function will move positionOnLivePath backward until the predicate returns false.
This class aggregates all necessary information about a position on a Path, namely: ...
Definition: positiononpath.h:33
void MoveBackward_StopAtPathNode(KyFloat32 distanceMove)
This function moves backward the position along distanceMove meters measured on the broken-line...
Definition: positiononlivepath.inl:480
PathEventList aggregates all PathEvents and PathEventIntervals in a PathValidityInterval.
Definition: patheventlist.h:141
void MoveToPathEvent(KyUInt32 pathEventIdx)
This function moves the position to the specified path event.
Definition: positiononlivepath.inl:307
void MoveForwardToNextPathNode()
This function moves forward the position up to the next Path node.
Definition: positiononlivepath.inl:425
PositionOnPathStatus
< enumerates="" the="" different="" status="" an="" objectpositiononpath="" can="" have="" on="" its="" path.="" />
Definition: positiononpath.h:20
bool IsAtACheckPoint() const
Indicates if the PositionOnLIvePath is at an event that is a check point.
Definition: positiononlivepath.inl:44
void MoveForwardToNextPathEdge()
This function moves forward the position up to the start of the next path edge.
Definition: positiononlivepath.inl:447
void MoveToNextEventOrPathNode()
This function moves forward the position until an event or a pathNode is reached. ...
Definition: positiononlivepath.inl:370
The PositionOnLivePath is on a PathEvent.
Definition: positiononlivepath.h:30
void MoveForwardToNextPathEvent()
This function moves forward the position up to the next path event.
Definition: positiononlivepath.inl:319
KyUInt32 GetNextPathEventIdx() const
This function has to be used carefully:
Definition: positiononlivepath.inl:284
The PositionOnLivePath is strictly on a PathEventInterval.
Definition: positiononlivepath.h:31
void MoveBackwardToPrevPathEdge()
This function moves forward the position up to the start of the next path edge.
Definition: positiononlivepath.inl:458
The PositionOnLivePath relative position in PathEventList is not yet defined.
Definition: positiononlivepath.h:29
void SetNewPositionOnPathBackward(const PositionOnPath &newPositionOnPathBackward)
Moves this PositionOnLivePath backward to the provided PositionOnPath and updates PathEventList relat...
Definition: positiononlivepath.inl:513
void MoveForward_StopAtEventOrAtPathNode(KyFloat32 distanceMove)
This function moves forward the position along distanceMove meters measured on the broken-line...
Definition: positiononlivepath.inl:348
void MoveForwardToNextPathEventInterval()
This function moves forward the position up to the next path event interval.
Definition: positiononlivepath.inl:338
void FindLocationOnEventListFromScratch()
This function computes the location on the PathEventList from the PositionOnPath. ...
void MoveBackwardToPrevCheckPoint()
This function moves backward the position up to the previous path event that is a check point...
PathEdgeType GetEdgeTypeToMoveOnForward() const
return the type of the edge given by GetEdgeIdxToMoveOnForward()
Definition: positiononlivepath.inl:25
Interface used to verify a PositionOnPath can be moved forward along the Path.
Definition: imovepositiononpathpredicate.h:19
RayCanGoMarginMode
Defines the different mode for the NavMesh border margin to be used in RayCanGo queries.
Definition: database.h:41
void MoveForwardAndGetCost_StopAtEventOrAtPathNode(void *traverseLogicUserData, KyFloat32 distanceMove, RayCanGoMarginMode rayCanGoMarginMode, KyFloat32 &cost)
This function moves forward the position along distanceMove meters measured on the broken-line...
Definition: positiononlivepath.inl:201
A PathEvent is a particular PositionOnPath which feature is specified by a PathEventType.
Definition: patheventlist.h:62
KyUInt32 GetEdgeIdxToMoveOnForward() const
If this in on a Path node, it returns the index of the edge starting at this path node...
Definition: positiononlivepath.inl:23
void MoveForward_StopAtEvent(KyFloat32 distanceMove)
This function moves forward the position along distanceMove meters measured on the broken-line...
Definition: positiononlivepath.inl:100
void MoveForwardToNextPathEventWithPredicate(IMovePositionOnLivePathPredicate *predicate)
This function will move positionOnLivePath forward until the predicate returns false.
Definition: gamekitcrowddispersion.h:20
void MoveBackward_StopAtEvent(KyFloat32 distanceMove)
This function moves backward the position along distanceMove meters measured on the broken-line...
Definition: positiononlivepath.inl:111
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
KyUInt32 GetEdgeIdxToMoveOnBackward() const
If this in on a Path node, it returns the index of the edge ending at this Path node, else it returns the index of the edge it lies on.
Definition: positiononlivepath.inl:24
#define KY_DEPRECATED(f)
Macro to mark a function, class or method as deprecated.
Definition: types.h:289
KyUInt32 GetOnEventListIndex() const
This function has to be used carefully:
Definition: positiononlivepath.inl:32
void MoveBackward(KyFloat32 distanceMove)
This function moves backward the position along distanceMove meters measured on the broken-line...
Definition: positiononlivepath.inl:414
const NavTag * GetCurrentOrNextNavTag() const
Returns a pointer to the navTag along the path after the position on path.
Definition: positiononlivepath.inl:151
KyUInt32 GetPrevPathEventIdx() const
This function has to be used carefully:
Definition: positiononlivepath.inl:295
void MoveBackwardToPrevPathEvent()
This function moves backward the position up to the previous path event.
Definition: positiononlivepath.inl:329
PathEdgeType
Defines the different kind of PathEdge within a Path.
Definition: path.h:26
PathEdgeType GetEdgeTypeToMoveOnBackward() const
return the type of the edge given by GetEdgeIdxToMoveOnBackward()
Definition: positiononlivepath.inl:26
This class aggregates all necessary information to describe a position on a LivePath, namely:
Definition: positiononlivepath.h:46
bool DoesPrecede(const PositionOnLivePath &other) const
Returns true when this PositionOnLivePath precede or is at same position on the Path that the other o...
Definition: positiononlivepath.inl:51
KyFloat32 MoveForwardToClosestPositionOnPath(const Vec3f &position)
Move forward to the closest position on path from originalPosition.
Definition: positiononlivepath.inl:491
void MoveForward(KyFloat32 distanceMove)
This function moves forward the position along distanceMove meters measured on the broken-line...
Definition: positiononlivepath.inl:403
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
void SetNewPositionOnPathForward(const PositionOnPath &newPositionOnPathForward)
Moves this PositionOnLivePath forward to the provided PositionOnPath and updates PathEventList relate...
Definition: positiononlivepath.inl:504
void MoveBackward_StopAtEventOrAtPathNode(KyFloat32 distanceMove)
This function moves backward the position along distanceMove meters measured on the broken-line...
Definition: positiononlivepath.inl:359
void MoveForwardToNextCheckPoint()
This function moves forward the position up to the next path event that is a check point...
KyUInt32 GetPathEdgeIndex() const
If this is at a Path node, it returns the index of the edge ending at this Path node, except if it is at the first Path node, in which case it returns the first edge index (0).
Definition: positiononlivepath.inl:22
void MoveToPrevEventOrPathNode()
This function moves backward the position until an event or a pathNode is reached.
Definition: positiononlivepath.inl:381
void MoveForward_StopAtPathNode(KyFloat32 distanceMove)
This function moves forward the position along distanceMove meters measured on the broken-line...
Definition: positiononlivepath.inl:469
const PositionOnPath * GetUpcomingEventPositionOnPath() const
Returns a pointer to the PositionOnPath along the path after positionOnLivePath.
Definition: positiononlivepath.inl:123
The class representing a path.
Definition: path.h:42
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43
bool IsStrictlyBefore(const PositionOnLivePath &other) const
Returns true when this PositionOnLivePath precede than the other one; returns false if it as as the s...
Definition: positiononlivepath.inl:52
const NavTag * GetCurrentOrPreviousNavTag() const
Returns a pointer to the navTag along the path before the position on path.
Definition: positiononlivepath.inl:175
This class defines a three-dimensional vector whose coordinates are stored using floating-point numbe...
Definition: vec3f.h:23
void InitOnPathFirstNode(Path *path)
The 5 Init functions initialize the positionOnPath, but they also clear all the data concerning the l...
Definition: positiononlivepath.inl:70