Atoms Crowd  7.0.0
DetourNavMeshBuilder.h
1 //
2 // Copyright (c) 2009-2010 Mikko Mononen memon@inside.org
3 //
4 // This software is provided 'as-is', without any express or implied
5 // warranty. In no event will the authors be held liable for any damages
6 // arising from the use of this software.
7 // Permission is granted to anyone to use this software for any purpose,
8 // including commercial applications, and to alter it and redistribute it
9 // freely, subject to the following restrictions:
10 // 1. The origin of this software must not be misrepresented; you must not
11 // claim that you wrote the original software. If you use this software
12 // in a product, an acknowledgment in the product documentation would be
13 // appreciated but is not required.
14 // 2. Altered source versions must be plainly marked as such, and must not be
15 // misrepresented as being the original software.
16 // 3. This notice may not be removed or altered from any source distribution.
17 //
18 
19 #ifndef DETOURNAVMESHBUILDER_H
20 #define DETOURNAVMESHBUILDER_H
21 
22 #include <AtomsUtils/Globals.h>
23 #include <AtomsUtils/NavigationMesh/Detour/DetourAlloc.h>
24 
25 namespace AtomsUtils {
26 
28 {
30  float vertsA0[3];
31  float vertsA1[3];
32  float vertsB0[3];
33  float vertsB1[3];
35  float snapRadius;
37  float snapHeight;
39  unsigned int userID;
41  unsigned short polyFlag;
43  unsigned char area;
45  unsigned char type;
46 };
47 
49 {
51  unsigned char area;
53  float minH;
54  float maxH;
57 };
58 
62 {
63 
68 
69  const unsigned short* verts;
70  int vertCount;
71  const unsigned short* polys;
72  const unsigned short* polyFlags;
73  const unsigned char* polyAreas;
74  int polyCount;
75  int nvp;
76 
80  unsigned short* polyClusters;
81  unsigned short clusterCount;
82 
87 
88  const unsigned int* detailMeshes;
89  const float* detailVerts;
91  const unsigned char* detailTris;
93 
100 
105 
110 
115 
116 
121 
122  unsigned int userId;
123  int tileX;
124  int tileY;
125  int tileLayer;
126  float bmin[3];
127  float bmax[3];
128 
132 
136  float cs;
137  float ch;
138 
142 
144 };
145 
152 ATOMSUTILS_EXPORT bool dtCreateNavMeshData(dtNavMeshCreateParams* params, unsigned char** outData, int* outDataSize);
153 
157 ATOMSUTILS_EXPORT bool dtNavMeshHeaderSwapEndian(unsigned char* data, const int dataSize);
158 
162 ATOMSUTILS_EXPORT bool dtNavMeshDataSwapEndian(unsigned char* data, const int dataSize);
163 
164 }
165 
166 #endif // DETOURNAVMESHBUILDER_H
167 
168 // This section contains detailed documentation for members that don't have
169 // a source file. It reduces clutter in the main section of the header.
170 
ATOMSUTILS_EXPORT bool dtCreateNavMeshData(dtNavMeshCreateParams *params, unsigned char **outData, int *outDataSize)
AtomsCore namespace.
Definition: Base64.h:13
ATOMSUTILS_EXPORT bool dtNavMeshHeaderSwapEndian(unsigned char *data, const int dataSize)
ATOMSUTILS_EXPORT bool dtNavMeshDataSwapEndian(unsigned char *data, const int dataSize)
Definition: DetourNavMeshBuilder.h:49
dtChunkArray< float > verts
X,Z coords of covex.
Definition: DetourNavMeshBuilder.h:56
float minH
Covex min,max height.
Definition: DetourNavMeshBuilder.h:53
unsigned char area
Area id.
Definition: DetourNavMeshBuilder.h:51
Definition: DetourNavMeshBuilder.h:62
int nvp
Number maximum number of vertices per polygon. [Limit: >= 3].
Definition: DetourNavMeshBuilder.h:75
const unsigned char * detailTris
The detail mesh triangles. [Size: 4 * detailTriCount].
Definition: DetourNavMeshBuilder.h:91
const dtDynamicAreaCreateParams * dynamicAreas
Dynamic Area data. [Size: dynamicAreaCount] [Unit: wu].
Definition: DetourNavMeshBuilder.h:112
const dtOffMeshLinkCreateParams * offMeshCons
Off-mesh connection data. [Size: offMeshConCount] [Unit: wu].
Definition: DetourNavMeshBuilder.h:102
float bmax[3]
The maximum bounds of the tile. [(x, y, z)] [Unit: wu].
Definition: DetourNavMeshBuilder.h:127
const unsigned short * polyFlags
The user defined flags assigned to each polygon. [Size: polyCount].
Definition: DetourNavMeshBuilder.h:72
float walkableRadius
The agent radius. [Unit: wu].
Definition: DetourNavMeshBuilder.h:134
float cs
The xz-plane cell size of the polygon mesh. [Limit: > 0] [Unit: wu].
Definition: DetourNavMeshBuilder.h:136
float walkableHeight
The agent height. [Unit: wu].
Definition: DetourNavMeshBuilder.h:133
int polyCount
Number of polygons in the mesh. [Limit: >= 1].
Definition: DetourNavMeshBuilder.h:74
bool buildBvTree
Definition: DetourNavMeshBuilder.h:141
int dynamicAreaCount
The number of dynamic areas. [Limit: >= 0].
Definition: DetourNavMeshBuilder.h:114
int detailVertsCount
The number of vertices in the detail mesh.
Definition: DetourNavMeshBuilder.h:90
unsigned int userId
The user defined id of the tile.
Definition: DetourNavMeshBuilder.h:122
unsigned short clusterCount
Number of unique clusters.
Definition: DetourNavMeshBuilder.h:81
int tileY
The tile's y-grid location within the multi-tile desitation mesh. (Along the z-axis....
Definition: DetourNavMeshBuilder.h:124
unsigned short * polyClusters
Cluster Id for each polygon [Size: polyCount].
Definition: DetourNavMeshBuilder.h:80
float bmin[3]
The minimum bounds of the tile. [(x, y, z)] [Unit: wu].
Definition: DetourNavMeshBuilder.h:126
int tileX
The tile's x-grid location within the multi-tile destination mesh. (Along the x-axis....
Definition: DetourNavMeshBuilder.h:123
const unsigned char * polyAreas
The user defined area ids assigned to each polygon. [Size: polyCount].
Definition: DetourNavMeshBuilder.h:73
const unsigned short * polys
The polygon data. [Size: polyCount * 2 * nvp].
Definition: DetourNavMeshBuilder.h:71
const unsigned int * detailMeshes
The height detail sub-mesh data. [Size: 4 * polyCount].
Definition: DetourNavMeshBuilder.h:88
const float * detailVerts
The detail mesh vertices. [Size: 3 * detailVertsCount] [Unit: wu].
Definition: DetourNavMeshBuilder.h:89
float ch
The y-axis cell height of the polygon mesh. [Limit: > 0] [Unit: wu].
Definition: DetourNavMeshBuilder.h:137
const unsigned short * verts
The polygon mesh vertices. [(x, y, z) * vertCount] [Unit: vx].
Definition: DetourNavMeshBuilder.h:69
int detailTriCount
The number of triangles in the detail mesh.
Definition: DetourNavMeshBuilder.h:92
int vertCount
The number vertices in the polygon mesh. [Limit: >= 3].
Definition: DetourNavMeshBuilder.h:70
int offMeshConCount
The number of off-mesh connections. [Limit: >= 0].
Definition: DetourNavMeshBuilder.h:104
float walkableClimb
The agent maximum traversable ledge. (Up/Down) [Unit: wu].
Definition: DetourNavMeshBuilder.h:135
int tileLayer
The tile's layer within the layered destination mesh. (Along the y-axis.) [Limit: >= 0].
Definition: DetourNavMeshBuilder.h:125