Kaim::NavGraphBlobBuilder Class Reference
#include <navgraphblobbuilder.h>
This class allows you to build a NavGraph, which you can then add to the NavData for a sector.
This class is typically used in a custom post-processing phase after generating the NavMesh for a terrain.
Inherits Kaim::BaseBlobBuilder< NavGraphBlob >.
|
The term 'ExclusiveNavTag' was confusing or ambiguous, it is not exclusive as in DynamicNavTag::IsExclusive().
It means a uniquely used NavTag in the NavGraph, no other edge or vertex is expected to use this NavTag.
Please use the Add*WithUnsharedNavTag functions instead.
|
KyUInt32 | AddVertexWithExclusiveNavTag (const Vec3f &position, DynamicNavTag *dynamicNavTag, NavGraphVertexLinkType vertexType=NavGraphVertexLinkType_LinkToNavMesh) |
|
KyUInt32 | AddMonodirectionalEdgeWithExclusiveNavTag (KyUInt32 startVertexIdx, KyUInt32 endVertexIdx, DynamicNavTag *dynamicNavTag) |
|
void | AddBidirectionalEdgeWithExclusiveNavTag (KyUInt32 startVertexIdx, KyUInt32 endVertexIdx, DynamicNavTag *dynamicNavTag) |
|
|
KyUInt32 | m_visualDebugId |
|
String | m_name |
|
KyArrayPOD< const DynamicNavTag * > | m_navTags |
|
KyArray< NavGraphBlobBuilder_Vertex > | m_vertices |
|
KyArray< NavGraphBlobBuilder_Edge > | m_edges |
|
void Kaim::NavGraphBlobBuilder::AddBidirectionalEdgeWithNavTag |
( |
KyUInt32 |
startVertexIdx, |
|
|
KyUInt32 |
endVertexIdx, |
|
|
KyUInt32 |
navTagIdx |
|
) |
| |
Adds a bidirectional edge that connects the specified vertices.
NOTE: this function will create two mono-directional edges. One from startVertexIdx to endVertexIdx and One from endVertexIdx to startVertexIdx the edge will be associated to the NavTag that is not supposed to be associated to other vertices or edges
- Parameters
-
startVertexIdx | The index of the starting vertex for the edge, which was returned by AddVertex(). |
endVertexIdx | The index of the ending vertex for the edge, which was returned by AddVertex(). |
navTagIdx | The associated navTag index that has already been added to Graph |
void Kaim::NavGraphBlobBuilder::AddBidirectionalEdgeWithoutNavTag |
( |
KyUInt32 |
startVertexIdx, |
|
|
KyUInt32 |
endVertexIdx |
|
) |
| |
Adds a bidirectional edge that connects the specified vertices.
NOTE: this function will create two mono-directional edges. One from startVertexIdx to endVertexIdx and One from endVertexIdx to startVertexIdx.
No navTag will be associated to this edge.
- Parameters
-
startVertexIdx | The index of the starting vertex for the edge, which was returned by AddVertex(). |
endVertexIdx | The index of the ending vertex for the edge, which was returned by AddVertex(). |
KyResult Kaim::NavGraphBlobBuilder::AddBidirectionalEdgeWithUnsharedNavTag |
( |
KyUInt32 |
startVertexIdx, |
|
|
KyUInt32 |
endVertexIdx, |
|
|
DynamicNavTag * |
dynamicNavTag |
|
) |
| |
Adds a bidirectional edge that connects the specified vertices.
NOTE: this function will create two mono-directional edges. One from startVertexIdx to endVertexIdx and one from endVertexIdx to startVertexIdx.
The edge will be associated to the NavTag that is not supposed to be associated to other vertices or edges
- Parameters
-
startVertexIdx | The index of the starting vertex for the edge, which was returned by AddVertex(). |
endVertexIdx | The index of the ending vertex for the edge, which was returned by AddVertex(). |
dynamicNavTag | A pointer to the associated dynamicNavTag that will be added to the NavGraph |
- Returns
- KY_ERROR if NavTag is exclusive which is not valid for NavGraphs.
Adds a new edge that connects the specified vertices.
Note that the edge is mono-directional, from the startVertex to the endVertex. If you want your characters to be able to plan paths that go between the two vertices in either direction, you must add a second edge from the endVertex to the startVertex, or use AddBidirectionalEdgeWithoutNavTag() instead. the edge will be associated to the NavTag that is not supposed to be associated to other vertices or edges
- Parameters
-
startVertexIdx | The index of the starting vertex for the edge, which was returned by AddVertex(). |
endVertexIdx | The index of the ending vertex for the edge, which was returned by AddVertex(). |
navTagIdx | The associated navTag index that has already been added to Graph |
- Returns
- the index of the newly created edge.
KyUInt32 Kaim::NavGraphBlobBuilder::AddMonodirectionalEdgeWithoutNavTag |
( |
KyUInt32 |
startVertexIdx, |
|
|
KyUInt32 |
endVertexIdx |
|
) |
| |
Adds a new edge that connects the specified vertices.
NOTE: the edge is mono-directional, from the startVertex to the endVertex. If you want your characters to be able to plan paths that go between the two vertices in either direction, you must add a second edge from the endVertex to the startVertex, or use AddBidirectionalEdgeWithoutNavTag() instead.
No navTag will be associated to this edge.
- Parameters
-
startVertexIdx | The index of the starting vertex for the edge, which was returned by AddVertex(). |
endVertexIdx | The index of the ending vertex for the edge, which was returned by AddVertex(). |
- Returns
- the index of the newly created edge.
KyUInt32 Kaim::NavGraphBlobBuilder::AddMonodirectionalEdgeWithUnsharedNavTag |
( |
KyUInt32 |
startVertexIdx, |
|
|
KyUInt32 |
endVertexIdx, |
|
|
DynamicNavTag * |
dynamicNavTag |
|
) |
| |
Adds a new edge that connects the specified vertices.
NOTE: the edge is mono-directional, from the startVertex to the endVertex. If you want your characters to be able to plan paths that go between the two vertices in either direction, you must add a second edge from the endVertex to the startVertex, or use AddBidirectionalEdgeWithoutNavTag() instead.
The edge will be associated to the NavTag that is not supposed to be associated to other vertices or edges.
- Parameters
-
startVertexIdx | The index of the starting vertex for the edge, which was returned by AddVertex(). |
endVertexIdx | The index of the ending vertex for the edge, which was returned by AddVertex(). |
dynamicNavTag | A pointer to the associated dynamicNavTag that will be added to the NavGraph |
- Returns
- the index of the newly created edge, or KyUInt32MAXVAL if NavTag is exclusive which is not valid for NavGraphs.
KyUInt32 Kaim::NavGraphBlobBuilder::AddNavTag |
( |
const DynamicNavTag * |
dynamicNavTag | ) |
|
Adds a NavTag that will be associated to edge and/or vertices.
- Parameters
-
dynamicNavTag | A pointer to the associated dynamicNavTag that will be added to the NavGraph. |
- Returns
- the index of the NavTag that should pass as parameters to associate this NavTag to vertices and/or edges, or KyUInt32MAXVAL if NavTag is exclusive which is not valid for NavGraphs.
Adds a new vertex to the Graph with an associated NavTag that has already been added to the graph.
- Parameters
-
position | The position of the vertex in 3D space, in the Gameware Navigation coordinate system. |
navTagIdx | The associated navTag index that has already been added to Graph . |
vertexType | A tag provides the way the vertex will be connected or not at run-time. |
- Returns
- the index of the newly created vertex.
Adds a new vertex to the Graph with no associated NavTag.
- Parameters
-
position | The position of the vertex in 3D space, in the Gameware Navigation coordinate system. |
vertexType | A tag provides the way the vertex will be connected or not at run-time. |
- Returns
- the index of the newly created vertex.
Adds a new vertex to the Graph with an associated NavTag that is not supposed to be associated to other vertices or edges.
- Parameters
-
position | The position of the vertex in 3D space, in the Gameware Navigation coordinate system. |
dynamicNavTag | A pointer to the associated dynamicNavTag that will be added to the NavGraph. |
vertexType | A tag providing the way the vertex will be connected at run-time (if conntected). |
- Returns
- the index of the newly created vertex, or KyUInt32MAXVAL if NavTag is exclusive which is not valid for NavGraphs.
This method:
- Calls DoBuild() in COUNT mode to determine the amount of memory needed for the blob to be built.
- Allocates the amount of memory in the specified BlobHandler.
- Calls DoBuild() again, in WRITE mode, to actually build the blob in the buffer allocated by the BlobHandler.
Simple way to use DoBuild in case of flat blob (that is, a blob that does not have a BlobArray or BlobRef)
virtual void Kaim::NavGraphBlobBuilder::DoBuild |
( |
| ) |
|
|
privatevirtual |
For internal use. Check if m_buildingPart == BUILDING_SHALLOW_PART and return this.
Indicates whether the builder is operating in COUNT mode or in WRITE mode.
This can be used in implementations of DoBuild().
void Kaim::NavGraphBlobBuilder::SetName |
( |
const char * |
graphName | ) |
|
// optional, only for Visual Debug
The blob maintained by this builder. Only modify using the macros listed under DoBuild().
The documentation for this class was generated from the following file: