Kaim::PositionOnPath Class Reference
#include <positiononpath.h>
This class aggregates all necessary information about a position on a Path.
- a Vec3f position,
- a PositionOnPathStatus
- a Path edge or node index
|
KyFloat32 | MoveForward_StopAtPathNode_Unsafe (KyFloat32 distanceMove) |
| These functions are unsafe in regard to the pre-conditions mentioned in the functions of similar name without the _Unsafe prefix. More...
|
|
KyFloat32 | MoveBackward_StopAtPathNode_Unsafe (KyFloat32 distanceMove) |
|
void | MoveForwardToNextPathNode_Unsafe () |
|
void | MoveBackwardToPrevPathNode_Unsafe () |
|
void | MoveForwardToNextPathEdge_Unsafe () |
|
void | MoveBackwardToPrevPathEdge_Unsafe () |
|
Return the distance along the Path from/to the other position.
KyFloat32MAXVAL if the otherPositionOnPath is on a different Path.
bool Kaim::PositionOnPath::DoesPrecede |
( |
const PositionOnPath & |
other | ) |
const |
Returns true when this PositionOnPath precede or is at same position that the other one.
KyUInt32 Kaim::PositionOnPath::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 current instance lies on.
- Precondition
- GetPositionOnPathStatus() != PositionOnPathStatus_Undefined
-
Current instance must not be at the first node of the Path.
KyUInt32 Kaim::PositionOnPath::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 current instance lies on.
- Precondition
- GetPositionOnPathStatus() != PositionOnPathStatus_Undefined
-
Current instance must not be at the last node of the Path.
PathEdgeType Kaim::PositionOnPath::GetEdgeTypeToMoveOnBackward |
( |
| ) |
const |
|
inline |
PathEdgeType Kaim::PositionOnPath::GetEdgeTypeToMoveOnForward |
( |
| ) |
const |
|
inline |
KyUInt32 Kaim::PositionOnPath::GetPathEdgeIndex |
( |
| ) |
const |
|
inline |
This function has to be used carefully:
- if this instance is at the first Path node, it returns the first edge index (0),
- if it is on another Path node, it returns the index of the edge ending at this Path node,
- else it returns the index of the edge current instance lies on.
- Precondition
- GetPositionOnPathStatus() != PositionOnPathStatus_Undefined
PathEdgeType Kaim::PositionOnPath::GetPathEdgeType |
( |
| ) |
const |
|
inline |
bool Kaim::PositionOnPath::IsStrictlyBefore |
( |
const PositionOnPath & |
other | ) |
const |
Returns true when this PositionOnPath strictly precede the other one; returns false if it as as the same position or after.
void Kaim::PositionOnPath::MoveBackward |
( |
KyFloat32 |
distanceMove | ) |
|
Main distance-based backward move method: moves the position along distanceMove meters measured on the broken-line.
- Precondition
- distanceMove >= 0.0f
Atomic move method: moves backward the position on the current Path edge it lays on, up to distanceMove meters.
If the previous Path node is at a distance lower than distanceMove this instance position is set at this Path node, and the distance from initial position to this Path node is returned; else the position is moved for distanceMove meters on the edge it lays on, and distanceMove is returned.
- Precondition
- distanceMove >= 0.0f
void Kaim::PositionOnPath::MoveBackwardToPrevPathEdge |
( |
| ) |
|
|
inline |
Atomic forward move method: must be used with lot of care.
Consider using MoveForward method instead, unless you really need to finely control the PositionOnPath move.
- Precondition
- GetPositionOnPathStatus() != PositionOnPathStatus_Undefined
-
Current instance must not be at the first node or edge of the Path.
void Kaim::PositionOnPath::MoveBackwardToPrevPathNode |
( |
| ) |
|
|
inline |
Atomic backward move method: must be used with lot of care.
Consider using MoveBackward method instead, unless you really need to finely control the PositionOnPath move.
void Kaim::PositionOnPath::MoveForward |
( |
KyFloat32 |
distanceMove | ) |
|
Main distance-based forward move method: moves the position along distanceMove meters measured on the broken-line.
- Precondition
- distanceMove >= 0.0f
Atomic move method: moves forward the position on the current Path edge it lays on, up to distanceMove meters.
If the next Path node is at a distance lower than distanceMove this instance position is set at this Path node, and the distance from initial position to this Path node is returned; else the position is moved for distanceMove meters on the edge it lays on, and distanceMove is returned.
- Precondition
- distanceMove >= 0.0f
KyFloat32 Kaim::PositionOnPath::MoveForward_StopAtPathNode_Unsafe |
( |
KyFloat32 |
distanceMove | ) |
|
These functions are unsafe in regard to the pre-conditions mentioned in the functions of similar name without the _Unsafe prefix.
KyFloat32 Kaim::PositionOnPath::MoveForwardToClosestPositionOnPath |
( |
const Vec3f & |
originalPosition, |
|
|
const PositionOnPath * |
upToPosOnPath = nullptr |
|
) |
| |
Move forward to the closest position on path from originalPosition.
Returns the square distance between originalPosition and the positionOnPath
void Kaim::PositionOnPath::MoveForwardToNextPathEdge |
( |
| ) |
|
|
inline |
Atomic forward move method: must be used with lot of care.
Consider using MoveForward method instead, unless you really need to finely control the PositionOnPath move.
- Precondition
- GetPositionOnPathStatus() != PositionOnPathStatus_Undefined
-
Current instance must not be at the last node or edge of the Path.
void Kaim::PositionOnPath::MoveForwardToNextPathNode |
( |
| ) |
|
|
inline |
Atomic forward move method: must be used with lot of care.
Consider using MoveForward method instead, unless you really need to finely control the PositionOnPath move.
The documentation for this class was generated from the following files: