Kaim::PositionOnLivePath Class Reference
#include <positiononlivepath.h>
This class aggregates all necessary information to describe a position on a LivePath, namely:
Be careful with instances of this class: they are intended to be kept alive but, up to now, only the instance in Bot is maintained accordingly to LivePath updates. As a consequence, all the other instances can not be used through several frames.
You are not intended to create or manage instances of this class. Nevertheless, it is fully documented since you will probably need to read and interpret it.
|
| PositionOnLivePath () |
|
void | BindToPathEventList (PathEventList *pathEventList) |
|
PathEventList * | GetPathEventList () const |
|
void | Clear () |
|
void | ClearEventListLocation () |
|
|
These functions are unsafe in regard to the pre-conditions mentioned in the functions of similar name without the _Unsafe prefix.
|
KyUInt32 | GetNextPathEventIdx_Unsafe () const |
|
KyUInt32 | GetPrevPathEventIdx_Unsafe () const |
|
void | MoveForwardToNextPathEvent_Unsafe () |
|
void | MoveBackwardToPrevPathEvent_Unsafe () |
|
void | MoveForwardToNextPathEventInterval_Unsafe () |
|
|
const NavTag * | GetUpcomingEventNavTag () const |
|
const NavTag * | GetPreviousEventNavTag () const |
|
Returns true when this PositionOnLivePath precede or is at same position on the Path that the other one.
It just test the PositionOnPath, it does not consider the location on the event list.
void Kaim::PositionOnLivePath::FindLocationOnEventListFromScratch |
( |
| ) |
|
const NavTag * Kaim::PositionOnLivePath::GetCurrentOrNextNavTag |
( |
| ) |
const |
|
inline |
Returns a pointer to the navTag along the path after the position on path.
If position on path is on a PathEvent, it returns the NavTag between this PathEvent and the next PathEvent. If it lies strictly within two PathEvents, it returns the NavTag along this PathEventInterval Note: if position on path is at the upper bound of the validity interval, it will return KY_NULL.
const NavTag * Kaim::PositionOnLivePath::GetCurrentOrPreviousNavTag |
( |
| ) |
const |
|
inline |
Returns a pointer to the navTag along the path before the position on path.
If position on path is on a PathEvent, it returns the NavTag between this PathEvent and the previous PathEvent. If it lies strictly within two PathEvents, it returns the NavTag along this PathEventInterval Note: if position on path is at the lower bound of the validity interval, it will return KY_NULL.
KyUInt32 Kaim::PositionOnLivePath::GetEdgeIdxToMoveOnBackward |
( |
| ) |
const |
|
inline |
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.
- Precondition
- Current instance must not be at the first node of the path.
KyUInt32 Kaim::PositionOnLivePath::GetEdgeIdxToMoveOnForward |
( |
| ) |
const |
|
inline |
If this in on a Path node, it returns the index of the edge starting at this path node, else it returns the index of the edge it lies on.
- Precondition
- Current instance must not be at the last node of the path.
PathEdgeType Kaim::PositionOnLivePath::GetEdgeTypeToMoveOnBackward |
( |
| ) |
const |
|
inline |
PathEdgeType Kaim::PositionOnLivePath::GetEdgeTypeToMoveOnForward |
( |
| ) |
const |
|
inline |
KyUInt32 Kaim::PositionOnLivePath::GetNextPathEventIdx |
( |
| ) |
const |
|
inline |
This function has to be used carefully:
- if this in on an PathEvent different from the UpperBound, it returns the index of the next PathEvent,
if this in on an EventInterval, it returns the index of the ending PathEvent.
Can return KyUInt32MAXVAL if current instance is on the Upper bound or if it is not located on the PathEventList. if IsEventListStatusValid() == false, does nothing
KyUInt32 Kaim::PositionOnLivePath::GetOnEventListIndex |
( |
| ) |
const |
|
inline |
This function has to be used carefully:
KyUInt32 Kaim::PositionOnLivePath::GetPathEdgeIndex |
( |
| ) |
const |
|
inline |
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).
If this is on a Path edge it returns the index of the edge it lies on.
KyUInt32 Kaim::PositionOnLivePath::GetPrevPathEventIdx |
( |
| ) |
const |
|
inline |
This function has to be used carefully:
- if this in on an PathEvent different from the LowerBound, it returns the index of the previous PathEvent,
if this in on an EventInterval, it returns the index of the starting PathEvent.
Can return KyUInt32MAXVAL if current instance is on the Upper bound or if it is not located on the PathEventList. if IsEventListStatusValid() == false, does nothing
const PositionOnPath * Kaim::PositionOnLivePath::GetUpcomingEventPositionOnPath |
( |
| ) |
const |
|
inline |
Returns a pointer to the PositionOnPath along the path after positionOnLivePath.
If positionOnLivePath is on a PathEvent, it returns the current PositionOnPath of the event. If it lies strictly within two PathEvents, it returns the PositionOnPath at the end of this PathEventInterval Note: if position on path is at the upper bound of the validity interval, it will return KY_NULL.
void Kaim::PositionOnLivePath::InitOnPathFirstNode |
( |
Path * |
path | ) |
|
|
inline |
bool Kaim::PositionOnLivePath::IsAtACheckPoint |
( |
| ) |
const |
|
inline |
Indicates if the PositionOnLIvePath is at an event that is a check point.
Returns true when this PositionOnLivePath precede than the other one; returns false if it as as the same pos.
It just test the PositionOnPath, it does not consider the location on the event list.
void Kaim::PositionOnLivePath::MoveBackward |
( |
KyFloat32 |
distanceMove | ) |
|
|
inline |
This function moves backward the position along distanceMove meters measured on the broken-line.
If the LowerBound of the PathValidityInterval is reached, this instance is stopped at this lower bound.
- Precondition
- distanceMove >= 0.0f if IsEventListStatusValid() == false, does nothing
void Kaim::PositionOnLivePath::MoveBackward_StopAtEvent |
( |
KyFloat32 |
distanceMove | ) |
|
|
inline |
This function moves backward the position along distanceMove meters measured on the broken-line.
If a PathEvent is reached before covering the distanceMove, this instance is stopped at this path event.
- Precondition
- distanceMove >= 0.0f if IsEventListStatusValid() == false, does nothing
void Kaim::PositionOnLivePath::MoveBackward_StopAtEventOrAtPathNode |
( |
KyFloat32 |
distanceMove | ) |
|
|
inline |
This function moves backward the position along distanceMove meters measured on the broken-line.
If a PathEvent or a Path node is reached before covering the distanceMove, this instance is stopped at this PathEvent or Path node.
- Precondition
- distanceMove >= 0.0f if IsEventListStatusValid() == false, does nothing
void Kaim::PositionOnLivePath::MoveBackward_StopAtPathNode |
( |
KyFloat32 |
distanceMove | ) |
|
|
inline |
This function moves backward the position along distanceMove meters measured on the broken-line.
If a Path node is reached before covering the distanceMove, this instance is stopped at this Path node.
If the LowerBound of the PathValidityInterval is reached, this instance is stopped at this lower bound.
- Precondition
- distanceMove >= 0.0f if IsEventListStatusValid() == false, does nothing
void Kaim::PositionOnLivePath::MoveBackwardToPrevCheckPoint |
( |
| ) |
|
This function moves backward the position up to the previous path event that is a check point.
If located on the LowerBound, does nothing. if IsEventListStatusValid() == false, does nothing
This function will move positionOnLivePath backward until the predicate returns false.
If it reaches the LowerBound, it stops.
void Kaim::PositionOnLivePath::MoveBackwardToPrevPathEdge |
( |
| ) |
|
|
inline |
This function moves forward the position up to the start of the next path edge.
If located on the LowerBound, does nothing. if IsEventListStatusValid() == false, does nothing.
void Kaim::PositionOnLivePath::MoveBackwardToPrevPathEvent |
( |
| ) |
|
|
inline |
This function moves backward the position up to the previous path event.
If located on the LowerBound, does nothing. if IsEventListStatusValid() == false, does nothing.
void Kaim::PositionOnLivePath::MoveBackwardToPrevPathNode |
( |
| ) |
|
|
inline |
This function moves backward the position up to the previous Path node.
If located on the LowerBound, does nothing. if IsEventListStatusValid() == false, does nothing.
void Kaim::PositionOnLivePath::MoveForward |
( |
KyFloat32 |
distanceMove | ) |
|
|
inline |
This function moves forward the position along distanceMove meters measured on the broken-line.
If the UpperBound of the PathValidityInterval is reached, this instance is stopped at this upper bound.
- Precondition
- distanceMove >= 0.0f if IsEventListStatusValid() == false, does nothing
void Kaim::PositionOnLivePath::MoveForward_StopAtCheckPoint |
( |
KyFloat32 |
distanceMove | ) |
|
|
inline |
This function moves forward the position along distanceMove meters measured on the broken-line.
If a PathEvent which is a checkpoint is reached before covering the distanceMove, this instance is stopped at this path event.
If located on the UpperBound, does nothing.
- Precondition
- distanceMove >= 0.0f if IsEventListStatusValid() == false, does nothing
void Kaim::PositionOnLivePath::MoveForward_StopAtEvent |
( |
KyFloat32 |
distanceMove | ) |
|
|
inline |
This function moves forward the position along distanceMove meters measured on the broken-line.
If a PathEvent is reached before covering the distanceMove, this instance is stopped at this path event.
- Precondition
- distanceMove >= 0.0f if IsEventListStatusValid() == false, does nothing
void Kaim::PositionOnLivePath::MoveForward_StopAtEventOrAtPathNode |
( |
KyFloat32 |
distanceMove | ) |
|
|
inline |
This function moves forward the position along distanceMove meters measured on the broken-line.
If a PathEvent or a Path node is reached before covering the distanceMove, this instance is stopped at this PathEvent or Path node.
- Precondition
- distanceMove >= 0.0f if IsEventListStatusValid() == false, does nothing
void Kaim::PositionOnLivePath::MoveForward_StopAtPathNode |
( |
KyFloat32 |
distanceMove | ) |
|
|
inline |
This function moves forward the position along distanceMove meters measured on the broken-line.
If a Path node is reached before covering the distanceMove, this instance is stopped at this Path node.
If the UpperBound of the PathValidityInterval is reached, this instance is stopped at this upper bound.
- Precondition
- distanceMove >= 0.0f if IsEventListStatusValid() == false, does nothing
template<class TLogic >
void Kaim::PositionOnLivePath::MoveForwardAndGetCost_StopAtEventOrAtPathNode |
( |
void * |
traverseLogicUserData, |
|
|
KyFloat32 |
distanceMove, |
|
|
RayCanGoMarginMode |
rayCanGoMarginMode, |
|
|
KyFloat32 & |
cost |
|
) |
| |
|
inline |
This function moves forward the position along distanceMove meters measured on the broken-line.
If a PathEvent or a Path node is reached before covering the distanceMove, this instance is stopped at this PathEvent or Path node. It compute the cost that corresponds to that move according to the the NavTag and the cost multipliers of the TraverseLogic
- Precondition
- distanceMove >= 0.0f if IsEventListStatusValid() == false, does nothing
KyFloat32 Kaim::PositionOnLivePath::MoveForwardToClosestPositionOnPath |
( |
const Vec3f & |
position | ) |
|
|
inline |
Move forward to the closest position on path from originalPosition.
Returns the distance between position and the positionOnPath found.
If located on the LowerBound, does nothing. if IsEventListStatusValid() == false, does nothing.
void Kaim::PositionOnLivePath::MoveForwardToNextCheckPoint |
( |
| ) |
|
This function moves forward the position up to the next path event that is a check point.
- Precondition
- This current instance must not be located on the UpperBound. if IsEventListStatusValid() == false, does nothing.
void Kaim::PositionOnLivePath::MoveForwardToNextPathEdge |
( |
| ) |
|
|
inline |
This function moves forward the position up to the start of the next path edge.
If located on the UpperBound, does nothing. if IsEventListStatusValid() == false, does nothing.
void Kaim::PositionOnLivePath::MoveForwardToNextPathEvent |
( |
| ) |
|
|
inline |
This function moves forward the position up to the next path event.
If located on the UpperBound, does nothing. if IsEventListStatusValid() == false, does nothing.
void Kaim::PositionOnLivePath::MoveForwardToNextPathEventInterval |
( |
| ) |
|
|
inline |
This function moves forward the position up to the next path event interval.
If located on the UpperBound, does nothing. if IsEventListStatusValid() == false, does nothing.
This function will move positionOnLivePath forward until the predicate returns false.
If it reaches the UpperBound, it stops.
void Kaim::PositionOnLivePath::MoveForwardToNextPathNode |
( |
| ) |
|
|
inline |
This function moves forward the position up to the next Path node.
If located on the UpperBound, does nothing. if IsEventListStatusValid() == false, does nothing.
void Kaim::PositionOnLivePath::MoveToNextEventOrPathNode |
( |
| ) |
|
|
inline |
This function moves forward the position until an event or a pathNode is reached.
void Kaim::PositionOnLivePath::MoveToPathEvent |
( |
KyUInt32 |
pathEventIdx | ) |
|
|
inline |
This function moves the position to the specified path event.
if IsEventListStatusValid() == false, does nothing.
void Kaim::PositionOnLivePath::MoveToPrevEventOrPathNode |
( |
| ) |
|
|
inline |
This function moves backward the position until an event or a pathNode is reached.
void Kaim::PositionOnLivePath::SetNewPositionOnPathBackward |
( |
const PositionOnPath & |
newPositionOnPathBackward | ) |
|
|
inline |
void Kaim::PositionOnLivePath::SetNewPositionOnPathForward |
( |
const PositionOnPath & |
newPositionOnPathForward | ) |
|
|
inline |
The documentation for this class was generated from the following files: