10 #ifndef Navigation_PositionOnPath_H
11 #define Navigation_PositionOnPath_H
46 void InitOnPathFirstNode(
Path* path);
47 void InitOnPathLastNode (
Path* path);
48 void InitOnPathEdge (
Path* path,
const Vec3f& positionOnEdge,
KyUInt32 pathEdgeIdx);
52 bool IsAtFirstNodeOfPath()
const;
53 bool IsAtLastNodeOfPath()
const;
54 bool IsAtFirstEdgeOfPath()
const;
55 bool IsAtLastEdgeOfPath()
const;
56 bool IsAtLastNodeOfAChannel()
const;
57 Path* GetPath()
const;
58 const Vec3f& GetPosition()
const;
60 KyFloat32 GetRemainingDistanceToEndOfPath()
const;
172 void MoveForwardToNextPathNode_Unsafe();
174 void MoveBackwardToPrevPathNode_Unsafe();
176 void MoveForwardToNextPathEdge_Unsafe();
178 void MoveBackwardToPrevPathEdge_Unsafe();
181 KyFloat32 ComputeDistanceToEndOfPathFromPathEdge(
KyUInt32 pathEdgeIdx,
const Vec3f& positionOnEdge)
const;
185 void ClampOnCurrentPathEdge(
const Kaim::Vec3f& originalPosition);
191 position = m_position;
192 onPathStatus = m_onPathStatus;
193 currentIndexOnPath = m_currentIndexOnPath;
194 distanceToEndOfPath = m_distanceToEndOfPath;
199 m_position = position;
200 m_onPathStatus = onPathStatus;
201 m_currentIndexOnPath = currentIndexOnPath;
202 m_distanceToEndOfPath = distanceToEndOfPath;
213 bool m_mustUpdateDistanceInternalState;
221 #endif // Navigation_PositionOnPath_H
PathEdgeType GetEdgeTypeToMoveOnForward() const
return the type of the edge given by GetEdgeIdxToMoveOnForward()
Definition: positiononpath.inl:52
KyUInt32 GetPathEdgeIndex() const
This function has to be used carefully:
Definition: positiononpath.inl:23
KyUInt32 GetEdgeIdxToMoveOnForward() const
If this in on a Path node, it returns the index of the edge starting at this Path node...
Definition: positiononpath.inl:34
This class aggregates all necessary information about a position on a Path, namely: ...
Definition: positiononpath.h:33
void MoveBackwardToPrevPathEdge()
Atomic forward move method: must be used with lot of care.
Definition: positiononpath.inl:107
PositionOnPathStatus
< enumerates="" the="" different="" status="" an="" objectpositiononpath="" can="" have="" on="" its="" path.="" />
Definition: positiononpath.h:20
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 current instance lies on.
Definition: positiononpath.inl:42
bool IsStrictlyBefore(const PositionOnPath &other) const
Returns true when this PositionOnPath strictly precede the other one; returns false if it as as the s...
The PositionOnPath is on a Path node.
Definition: positiononpath.h:23
#define KY_NULL
Null value.
Definition: types.h:247
The PositionOnPath is on a Path edge.
Definition: positiononpath.h:24
PathEdgeType GetPathEdgeType() const
This function has to be used carefully, cf. GetPathEdgeIndex()
Definition: positiononpath.inl:50
void MoveForward(KyFloat32 distanceMove)
Main distance-based forward move method: moves the position along distanceMove meters measured on the...
void MoveBackward(KyFloat32 distanceMove)
Main distance-based backward move method: moves the position along distanceMove meters measured on th...
The PositionOnPath is not yet defined.
Definition: positiononpath.h:22
PathEdgeType GetEdgeTypeToMoveOnBackward() const
return the type of the edge given by GetEdgeIdxToMoveOnBackward()
Definition: positiononpath.inl:53
void MoveForwardToNextPathNode()
Atomic forward move method: must be used with lot of care.
Definition: positiononpath.inl:89
Definition: gamekitcrowddispersion.h:20
KyFloat32 ComputeDistance(const PositionOnPath &otherPositionOnPath) const
Return the distance along the Path from/to the other position.
KyFloat32 MoveForwardToClosestPositionOnPath(const Vec3f &originalPosition, const PositionOnPath *upToPosOnPath=0)
Move forward to the closest position on path from originalPosition.
KyFloat32 MoveBackward_StopAtPathNode(KyFloat32 distanceMove)
Atomic move method: moves backward the position on the current Path edge it lays on, up to distanceMove meters.
Definition: positiononpath.inl:82
void MoveBackwardToPrevPathNode()
Atomic backward move method: must be used with lot of care.
Definition: positiononpath.inl:95
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
void MoveForwardToNextPathEdge()
Atomic forward move method: must be used with lot of care.
Definition: positiononpath.inl:101
PathEdgeType
Defines the different kind of PathEdge within a Path.
Definition: path.h:26
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
bool DoesPrecede(const PositionOnPath &other) const
Returns true when this PositionOnPath precede or is at same position that the other one...
KyFloat32 MoveForward_StopAtPathNode(KyFloat32 distanceMove)
Atomic move method: moves forward the position on the current Path edge it lays on, up to distanceMove meters.
Definition: positiononpath.inl:75
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
This class defines a three-dimensional vector whose coordinates are stored using floating-point numbe...
Definition: vec3f.h:23