gwnavgamekit/itinerary.h Source File

itinerary.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 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 // primary contact: MAMU - secondary contact: NOBODY
9 
10 #ifndef Navigation_Itinerary_H
11 #define Navigation_Itinerary_H
12 
16 
17 namespace Kaim
18 {
19 
20 class ItineraryNode
21 {
22  KY_DEFINE_NEW_DELETE_OPERATORS(Kaim::MemStat_GameKit)
23 public:
24  Vec3f m_pos;
25 };
26 
27 class ItineraryEdge
28 {
29  KY_DEFINE_NEW_DELETE_OPERATORS(Kaim::MemStat_GameKit)
30 public:
31  PathEdgeType m_type;
32  DynamicNavTag m_navTag;
33  KyFloat32 m_length;
34 };
35 
38 class Itinerary
39 {
40  KY_DEFINE_NEW_DELETE_OPERATORS(Kaim::MemStat_GameKit)
41 public:
42  Itinerary() { m_length = 0.0f; }
43  ~Itinerary() {}
44 
45  template<class TLogic>
46  void Compute(Path* path, void* traverseLogicUserData)
47  {
48  PathValidityInterval pathValidityInterval;
49  PositionOnLivePath positionOnLivePath;
50  positionOnLivePath.BindToPathEventList(&pathValidityInterval.m_pathEventList);
51  positionOnLivePath.InitOnPathFirstNode(path);
52  pathValidityInterval.ReStartIntervalComputation<TLogic>(path, traverseLogicUserData, positionOnLivePath.GetPositionOnPath(), 0.0f, 0.0f);
53 
54  BuildItineraryNodes(positionOnLivePath);
55  }
56 
57 private:
58  void BuildItineraryNodes( PositionOnLivePath &positionOnLivePath );
59 
60 public:
61  KyArray<ItineraryEdge> m_edges;
62  KyArray<ItineraryNode> m_nodes;
63  KyFloat32 m_length;
64 };
65 
66 
67 }
68 
69 
70 
71 #endif
Definition: gamekitcrowddispersion.h:20
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
PathEdgeType
Defines the different kind of PathEdge within a Path.
Definition: path.h:26
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43