gwnavruntime/navgraph/blobs/navgraphblobbuilder.h Source File

navgraphblobbuilder.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 // Primary contact: LASI - secondary contact: NONE
8 #ifndef Navigation_NavGraphBlobBuilder_H
9 #define Navigation_NavGraphBlobBuilder_H
10 
14 
15 
16 namespace Kaim
17 {
18 
19 class NavGraphBlob;
20 
24 class NavGraphBlobBuilder : public BaseBlobBuilder<NavGraphBlob>
25 {
26 public:
28 
29  KyUInt32 GetEdgeCount() const;
30  KyUInt32 GetVertexCount() const;
31  KyUInt32 GetNavTagCount() const;
32 
34 
38  KyUInt32 AddNavTag(const DynamicNavTag* dynamicNavTag);
39 
40 
41  // ---- Add vertices ----
42 
48 
54  KyUInt32 AddVertexWithUnsharedNavTag(const Vec3f& position, DynamicNavTag* dynamicNavTag, NavGraphVertexLinkType vertexType = NavGraphVertexLinkType_LinkToNavMesh);
55 
62 
63  // ---- Add Monodirectional edges ---
64 
73  KyUInt32 AddMonodirectionalEdgeWithoutNavTag(KyUInt32 startVertexIdx, KyUInt32 endVertexIdx);
74 
84  KyUInt32 AddMonodirectionalEdgeWithUnsharedNavTag(KyUInt32 startVertexIdx, KyUInt32 endVertexIdx, DynamicNavTag* dynamicNavTag);
85 
95  KyUInt32 AddMonodirectionalEdgeWithNavTag(KyUInt32 startVertexIdx, KyUInt32 endVertexIdx, KyUInt32 navTagIdx);
96 
97  // ---- Add Bidirectional edges ---
98 
105  void AddBidirectionalEdgeWithoutNavTag(KyUInt32 startVertexIdx, KyUInt32 endVertexIdx);
106 
115  KyResult AddBidirectionalEdgeWithUnsharedNavTag(KyUInt32 startVertexIdx, KyUInt32 endVertexIdx, DynamicNavTag* dynamicNavTag);
116 
124  void AddBidirectionalEdgeWithNavTag(KyUInt32 startVertexIdx, KyUInt32 endVertexIdx, KyUInt32 navTagIdx);
125 
126  void SetName(const char* graphName);
127 
128 public: // DEPRECATED functions
129 
130  // --------- Deprecated ExclusiveNavTag ---------
134 
135  KY_DEPRECATED(KyUInt32 AddVertexWithExclusiveNavTag(const Vec3f& position, DynamicNavTag* dynamicNavTag, NavGraphVertexLinkType vertexType = NavGraphVertexLinkType_LinkToNavMesh));
136  KY_DEPRECATED(KyUInt32 AddMonodirectionalEdgeWithExclusiveNavTag(KyUInt32 startVertexIdx, KyUInt32 endVertexIdx, DynamicNavTag* dynamicNavTag));
137  KY_DEPRECATED(void AddBidirectionalEdgeWithExclusiveNavTag(KyUInt32 startVertexIdx, KyUInt32 endVertexIdx, DynamicNavTag* dynamicNavTag));
138 
139 private:
140  virtual void DoBuild();
141 
142 public: // internal
143  KyUInt32 m_visualDebugId; // unused since NavGraphBlobs were sent into NavGraphArray blob from a NavData
144  String m_name; // optional, only for Visual Debug
146  KyArray<NavGraphBlobBuilder_Vertex> m_vertices; //< Graph Vertices.
147  KyArray<NavGraphBlobBuilder_Edge> m_edges; //< Graph Edges.
148 };
149 
150 
151 KY_INLINE KyUInt32 NavGraphBlobBuilder::GetEdgeCount() const { return m_edges.GetCount(); }
152 KY_INLINE KyUInt32 NavGraphBlobBuilder::GetVertexCount() const { return m_vertices.GetCount(); }
153 KY_INLINE KyUInt32 NavGraphBlobBuilder::GetNavTagCount() const { return m_navTags.GetCount(); }
154 
155 }
156 
157 #endif // Navigation_NavGraphBlobBuilder_H
KyUInt16 NavGraphVertexLinkType
Defines a type for a tag that determines whether or not a vertex in a NavGraph should be connected to...
Definition: navgraphtypes.h:26
KyUInt32 AddMonodirectionalEdgeWithUnsharedNavTag(KyUInt32 startVertexIdx, KyUInt32 endVertexIdx, DynamicNavTag *dynamicNavTag)
Adds a new edge that connects the specified vertices.
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
static const NavGraphVertexLinkType NavGraphVertexLinkType_LinkToNavMesh
Indicates that this vertex should be connected to the NavMesh. If the vertex is outside, we try to link it inside.
Definition: navgraphtypes.h:28
void AddBidirectionalEdgeWithoutNavTag(KyUInt32 startVertexIdx, KyUInt32 endVertexIdx)
Adds a bidirectional edge that connects the specified vertices.
KyUInt32 AddVertexWithoutNavTag(const Vec3f &position, NavGraphVertexLinkType vertexType=NavGraphVertexLinkType_LinkToNavMesh)
Adds a new vertex to the Graph with no associated NavTag.
KyUInt32 AddMonodirectionalEdgeWithoutNavTag(KyUInt32 startVertexIdx, KyUInt32 endVertexIdx)
Adds a new edge that connects the specified vertices.
KyUInt32 AddMonodirectionalEdgeWithNavTag(KyUInt32 startVertexIdx, KyUInt32 endVertexIdx, KyUInt32 navTagIdx)
Adds a new edge that connects the specified vertices.
KyUInt32 AddVertexWithNavTag(const Vec3f &position, KyUInt32 navTagIdx, NavGraphVertexLinkType vertexType=NavGraphVertexLinkType_LinkToNavMesh)
Adds a new vertex to the Graph with an associated NavTag that has already been added to the graph...
virtual void DoBuild()
Implement this function in any class that derives from BaseBlobBuilder.
Definition: gamekitcrowddispersion.h:20
KyUInt32 AddVertexWithUnsharedNavTag(const Vec3f &position, DynamicNavTag *dynamicNavTag, NavGraphVertexLinkType vertexType=NavGraphVertexLinkType_LinkToNavMesh)
Adds a new vertex to the Graph with an associated NavTag that is not supposed to be associated to oth...
#define KY_DEPRECATED(f)
Macro to mark a function, class or method as deprecated.
Definition: types.h:289
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
This class allows you to build a NavGraph, which you can then add to the NavData for a sector...
Definition: navgraphblobbuilder.h:25
KyResult AddBidirectionalEdgeWithUnsharedNavTag(KyUInt32 startVertexIdx, KyUInt32 endVertexIdx, DynamicNavTag *dynamicNavTag)
Adds a bidirectional edge that connects the specified vertices.
void AddBidirectionalEdgeWithNavTag(KyUInt32 startVertexIdx, KyUInt32 endVertexIdx, KyUInt32 navTagIdx)
Adds a bidirectional edge that connects the specified vertices.
KyUInt32 AddNavTag(const DynamicNavTag *dynamicNavTag)
Adds a NavTag that will be associated to edge and/or vertices.
This class defines a three-dimensional vector whose coordinates are stored using floating-point numbe...
Definition: vec3f.h:23
void SetName(const char *graphName)
// optional, only for Visual Debug