gwnavgamekit/itinerary.h Source File

itinerary.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 
8 #pragma once
9 
13 
14 namespace Kaim
15 {
16 
17 class ItineraryNode
18 {
19  KY_DEFINE_NEW_DELETE_OPERATORS(Kaim::MemStat_GameKit)
20 public:
21  Vec3f m_pos;
22 };
23 
24 class ItineraryEdge
25 {
26  KY_DEFINE_NEW_DELETE_OPERATORS(Kaim::MemStat_GameKit)
27 public:
28  PathEdgeType m_type;
29  DynamicNavTag m_navTag;
30  KyFloat32 m_length;
31 };
32 
35 class Itinerary
36 {
37  KY_DEFINE_NEW_DELETE_OPERATORS(Kaim::MemStat_GameKit)
38 public:
39  Itinerary() { m_length = 0.0f; }
40  ~Itinerary() {}
41 
42  template<class TLogic>
43  void Compute(Path* path, void* traverseLogicUserData)
44  {
45  PathValidityInterval pathValidityInterval;
46  PositionOnLivePath positionOnLivePath;
47  positionOnLivePath.BindToPathEventList(&pathValidityInterval.m_pathEventList);
48  positionOnLivePath.InitOnPathFirstNode(path);
49  pathValidityInterval.ReStartIntervalComputation<TLogic>(path, traverseLogicUserData, positionOnLivePath.GetPositionOnPath(), 0.0f, 0.0f);
50 
51  BuildItineraryNodes(positionOnLivePath);
52  }
53 
54 private:
55  void BuildItineraryNodes( PositionOnLivePath &positionOnLivePath );
56 
57 public:
58  KyArray<ItineraryEdge> m_edges;
59  KyArray<ItineraryNode> m_nodes;
60  KyFloat32 m_length;
61 };
62 
63 
64 }
65 
66 
67 
An itineray is split PathEventIntervalpath where each edge on NavMesh or graph contains a navtag...
Definition: itinerary.h:35
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
Maintains runtime validity information on a given Path.
Definition: pathvalidityinterval.h:110
This class aggregates all necessary information to describe a position on a LivePath, namely:
Definition: positiononlivepath.h:43
The class representing a path.
Definition: path.h:62
float KyFloat32
float
Definition: types.h:32
void InitOnPathFirstNode(Path *path)
The 5 Init functions initialize the positionOnPath, but they also clear all the data concerning the l...
Definition: positiononlivepath.inl:48