diff --git a/Detour/Include/DetourDebugDraw.h b/Detour/Include/DetourDebugDraw.h index c20594c..5f53ed4 100755 --- a/Detour/Include/DetourDebugDraw.h +++ b/Detour/Include/DetourDebugDraw.h @@ -19,18 +19,10 @@ #ifndef DETOURDEBUGDRAW_H #define DETOURDEBUGDRAW_H -#include "DetourStatNavMesh.h" -#include "DetourTileNavMesh.h" #include "DetourNavMesh.h" -void dtDebugDrawStatNavMeshPoly(const dtStatNavMesh* mesh, dtStatPolyRef ref, const float* col); -void dtDebugDrawStatNavMeshBVTree(const dtStatNavMesh* mesh); -void dtDebugDrawStatNavMesh(const dtStatNavMesh* mesh, bool drawClosedList = false); - -void dtDebugDrawTiledNavMesh(const dtTiledNavMesh* mesh); -void dtDebugDrawTiledNavMeshPoly(const dtTiledNavMesh* mesh, dtTilePolyRef ref, const float* col); - void dtDebugDrawNavMesh(const dtNavMesh* mesh, bool drawClosedList = false); +void dtDebugDrawNavMeshBVTree(const dtNavMesh* mesh); void dtDebugDrawNavMeshPoly(const dtNavMesh* mesh, dtPolyRef ref, const float* col); #endif // DETOURDEBUGDRAW_H \ No newline at end of file diff --git a/Detour/Include/DetourStatNavMesh.h b/Detour/Include/DetourStatNavMesh.h deleted file mode 100755 index 65e69f4..0000000 --- a/Detour/Include/DetourStatNavMesh.h +++ /dev/null @@ -1,237 +0,0 @@ -// -// Copyright (c) 2009 Mikko Mononen memon@inside.org -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. -// - -#ifndef DETOURSTATNAVMESH_H -#define DETOURSTATNAVMESH_H - -// Reference to navigation polygon. -typedef unsigned short dtStatPolyRef; - -// Maximum number of vertices per navigation polygon. -static const int DT_STAT_VERTS_PER_POLYGON = 6; - -// Structure holding the navigation polygon data. -struct dtStatPoly -{ - unsigned short v[DT_STAT_VERTS_PER_POLYGON]; // Indices to vertices of the poly. - dtStatPolyRef n[DT_STAT_VERTS_PER_POLYGON]; // Refs to neighbours of the poly. - unsigned char nv; // Number of vertices. - unsigned char flags; // Flags (not used). -}; - -struct dtStatPolyDetail -{ - unsigned short vbase; // Offset to detail vertex array. - unsigned short nverts; // Number of vertices in the detail mesh. - unsigned short tbase; // Offset to detail triangle array. - unsigned short ntris; // Number of triangles. -}; - -const int DT_STAT_NAVMESH_MAGIC = 'NAVM'; -const int DT_STAT_NAVMESH_VERSION = 3; - -struct dtStatBVNode -{ - unsigned short bmin[3], bmax[3]; - int i; -}; - -struct dtStatNavMeshHeader -{ - int magic; - int version; - int npolys; - int nverts; - int nnodes; - int ndmeshes; - int ndverts; - int ndtris; - float cs; - float bmin[3], bmax[3]; - dtStatPoly* polys; - float* verts; - dtStatBVNode* bvtree; - dtStatPolyDetail* dmeshes; - float* dverts; - unsigned char* dtris; -}; - -class dtStatNavMesh -{ -public: - - dtStatNavMesh(); - ~dtStatNavMesh(); - - // Initializes the navmesh with data. - // Params: - // data - (in) Pointer to navmesh data. - // dataSize - (in) size of the navmesh data. - // ownsData - (in) Flag indicating if the navmesh should own and delete the data. - bool init(unsigned char* data, int dataSize, bool ownsData); - - // Finds the nearest navigation polygon around the center location. - // Params: - // center - (in) The center of the search box. - // extents - (in) The extents of the search box. - // Returns: Reference identifier for the polygon, or 0 if no polygons found. - dtStatPolyRef findNearestPoly(const float* center, const float* extents); - - // Returns polygons which touch the query box. - // Params: - // center - (in) the center of the search box. - // extents - (in) the extents of the search box. - // polys - (out) array holding the search result. - // maxPolys - (in) The max number of polygons the polys array can hold. - // Returns: Number of polygons in search result array. - int queryPolygons(const float* center, const float* extents, - dtStatPolyRef* polys, const int maxPolys); - - // Finds path from start polygon to end polygon. - // If target polygon canno be reached through the navigation graph, - // the last node on the array is nearest node to the end polygon. - // Params: - // startRef - (in) ref to path start polygon. - // endRef - (in) ref to path end polygon. - // path - (out) array holding the search result. - // maxPathSize - (in) The max number of polygons the path array can hold. - // Returns: Number of polygons in search result array. - int findPath(dtStatPolyRef startRef, dtStatPolyRef endRef, - const float* startPos, const float* endPos, - dtStatPolyRef* path, const int maxPathSize); - - // Finds a straight path from start to end locations within the corridor - // described by the path polygons. - // Start and end locations will be clamped on the corridor. - // Params: - // startPos - (in) Path start location. - // endPos - (in) Path end location. - // path - (in) Array of connected polygons describing the corridor. - // pathSize - (in) Number of polygons in path array. - // straightPath - (out) Points describing the straight path. - // maxStraightPathSize - (in) The max number of points the straight path array can hold. - // Returns: Number of points in the path. - int findStraightPath(const float* startPos, const float* endPos, - const dtStatPolyRef* path, const int pathSize, - float* straightPath, const int maxStraightPathSize); - - // Finds intersection againts walls starting from start pos. - // Params: - // startRef - (in) ref to the polygon where the start lies. - // startPos - (in) start position of the query. - // endPos - (in) end position of the query. - // t - (out) hit parameter along the segment, 0 if no hit. - // endRef - (out) ref to the last polygon which was processed. - // Returns: Number of polygons in path or 0 if failed. - int raycast(dtStatPolyRef startRef, const float* startPos, const float* endPos, - float& t, dtStatPolyRef* path, const int pathSize); - - // Returns distance to nearest wall from the specified location. - // Params: - // centerRef - (in) ref to the polygon where the center lies. - // centerPos - (in) center if the query circle. - // maxRadius - (in) max search radius. - // hitPos - (out) location of the nearest hit. - // hitNormal - (out) normal of the nearest hit. - // Returns: Distance to nearest wall from the test location. - float findDistanceToWall(dtStatPolyRef centerRef, const float* centerPos, float maxRadius, - float* hitPos, float* hitNormal); - - // Finds polygons found along the navigation graph which touch the specified circle. - // Params: - // centerRef - (in) ref to the polygon where the center lies. - // centerPos - (in) center if the query circle - // radius - (in) radius of the query circle - // resultRef - (out, opt) refs to the polygons touched by the circle. - // resultParent - (out, opt) parent of each result polygon. - // resultCost - (out, opt) search cost at each result polygon. - // maxResult - (int) maximum capacity of search results. - // Returns: Number of results. - int findPolysAround(dtStatPolyRef centerRef, const float* centerPos, float radius, - dtStatPolyRef* resultRef, dtStatPolyRef* resultParent, float* resultCost, - const int maxResult); - - // Returns closest point on navigation polygon. - // Params: - // ref - (in) ref to the polygon. - // pos - (in) the point to check. - // closest - (out) closest point. - // Returns: true if closest point found. - bool closestPointToPoly(dtStatPolyRef ref, const float* pos, float* closest) const; - - // Returns height of the polygon at specified location. - // Params: - // ref - (in) ref to the polygon. - // pos - (in) the point where to locate the height. - // height - (out) height at the location. - // Returns: true if oer polygon. - bool getPolyHeight(dtStatPolyRef ref, const float* pos, float* height) const; - - int moveAlongPath(const float* startPos, const float* endPos, float* resultPos, - const dtStatPolyRef* path, const int pathSize); - - // Returns pointer to a polygon based on ref. - const dtStatPoly* getPolyByRef(dtStatPolyRef ref) const; - // Returns polygon index based on ref, or -1 if failed. - int getPolyIndexByRef(dtStatPolyRef ref) const; - // Returns number of navigation polygons. - inline int getPolyCount() const { return m_header ? m_header->npolys : 0; } - // Rerturns pointer to specified navigation polygon. - inline const dtStatPoly* getPoly(int i) const { return &m_header->polys[i]; } - // Returns number of vertices. - inline int getVertexCount() const { return m_header ? m_header->nverts : 0; } - // Returns pointer to specified vertex. - inline const float* getVertex(int i) const { return &m_header->verts[i*3]; } - // Returns number of navigation polygons details. - inline int getPolyDetailCount() const { return m_header ? m_header->ndmeshes : 0; } - // Rerturns pointer to specified navigation polygon detail. - const dtStatPolyDetail* getPolyDetail(int i) const { return &m_header->dmeshes[i]; } - // Returns pointer to specified vertex. - inline const float* getDetailVertex(int i) const { return &m_header->dverts[i*3]; } - // Returns pointer to specified vertex. - inline const unsigned char* getDetailTri(int i) const { return &m_header->dtris[i*4]; } - - bool isInClosedList(dtStatPolyRef ref) const; - - int getMemUsed() const; - - inline unsigned char* getData() const { return m_data; } - inline int getDataSize() const { return m_dataSize; } - inline const dtStatNavMeshHeader* getHeader() const { return m_header; } - inline const dtStatBVNode* getBvTreeNodes() const { return m_header ? m_header->bvtree : 0; } - inline int getBvTreeNodeCount() const { return m_header ? m_header->nnodes : 0; } - -private: - - // Copies the locations of vertices of a polygon to an array. - int getPolyVerts(dtStatPolyRef ref, float* verts) const; - // Returns portal points between two polygons. - bool getPortalPoints(dtStatPolyRef from, dtStatPolyRef to, float* left, float* right) const; - // Returns edge mid point between two polygons. - bool getEdgeMidPoint(dtStatPolyRef from, dtStatPolyRef to, float* mid) const; - - unsigned char* m_data; - int m_dataSize; - - dtStatNavMeshHeader* m_header; - - class dtNodePool* m_nodePool; - class dtNodeQueue* m_openList; -}; - -#endif // DETOURSTATNAVMESH_H diff --git a/Detour/Include/DetourStatNavMeshBuilder.h b/Detour/Include/DetourStatNavMeshBuilder.h deleted file mode 100755 index 3b8f751..0000000 --- a/Detour/Include/DetourStatNavMeshBuilder.h +++ /dev/null @@ -1,29 +0,0 @@ -// -// Copyright (c) 2009 Mikko Mononen memon@inside.org -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. -// - -#ifndef DETOURSTATNAVMESHBUILDER_H -#define DETOURSTATNAVMESHBUILDER_H - -bool dtCreateNavMeshData(const unsigned short* verts, const int nverts, - const unsigned short* polys, const int npolys, const int nvp, - const float* bmin, const float* bmax, float cs, float ch, - const unsigned short* dmeshes, const float* dverts, const int ndverts, - const unsigned char* dtris, const int ndtris, - unsigned char** outData, int* outDataSize); - -#endif // DETOURSTATNAVMESHBUILDER_H \ No newline at end of file diff --git a/Detour/Include/DetourTileNavMesh.h b/Detour/Include/DetourTileNavMesh.h deleted file mode 100644 index d615b17..0000000 --- a/Detour/Include/DetourTileNavMesh.h +++ /dev/null @@ -1,315 +0,0 @@ -// -// Copyright (c) 2009 Mikko Mononen memon@inside.org -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. -// - -#ifndef DETOURTILENAVMESH_H -#define DETOURTILENAVMESH_H - -// Reference to navigation polygon. -typedef unsigned int dtTilePolyRef; - -// The bits used in the poly ref. -static const int DT_TILE_REF_SALT_BITS = 12; -static const int DT_TILE_REF_TILE_BITS = 12; -static const int DT_TILE_REF_POLY_BITS = 8; -static const int DT_TILE_REF_SALT_MASK = (1<> (DT_TILE_REF_POLY_BITS+DT_TILE_REF_TILE_BITS)) & DT_TILE_REF_SALT_MASK; - it = ((ref >> DT_TILE_REF_POLY_BITS) & DT_TILE_REF_TILE_MASK) - 1; - ip = ref & DT_TILE_REF_POLY_MASK; -} - -static const int DT_TILE_LOOKUP_SIZE = DT_MAX_TILES/4; - -class dtTiledNavMesh -{ -public: - dtTiledNavMesh(); - ~dtTiledNavMesh(); - - // Initializes the nav mesh. - // Params: - // orig - (in) origin of the nav mesh tile space. - // tileSiz - (in) size of a tile. - // portalheight - (in) height of the portal region between tiles. - // Returns: True if succeed, else false. - bool init(const float* orig, float tileSize, float portalHeight); - - // Adds new tile into the navmesh. - // The add will fail if the data is in wrong format, - // there is not enough tiles left, or if there is a tile already at the location. - // Params: - // x,y - (in) Location of the new tile. - // data - (in) Data of the new tile mesh. - // dataSize - (in) Data size of the new tile mesh. - // ownsData - (in) Flag indicating if the navmesh should own and delete the data. - // Returns: True if tile was added, else false. - bool addTileAt(int x, int y, unsigned char* data, int dataSize, bool ownsData); - - // Removes tile at specified location. - // Params: - // x,y - (in) Location of the tile to remove. - // data - (out) Data associated with deleted tile. - // dataSize - (out) Size of the data associated with deleted tile. - // Returns: True if remove suceed, else false. - bool removeTileAt(int x, int y, unsigned char** data, int* dataSize); - - // Returns pointer to tile at specified location. - // Params: - // x,y - (in) Location of the tile to get. - // Returns: pointer to tile if tile exists or 0 tile does not exists. - dtTile* getTileAt(int x, int y); - - // Returns pointer to tile in the tile array. - // Params: - // i - (in) Index to the tile to retrieve, must be in range [0,DT_MAX_TILES[ - // Returns: Pointer to specified tile. - dtTile* getTile(int i); - const dtTile* getTile(int i) const; - - // Finds the nearest navigation polygon around the center location. - // Params: - // center - (in) The center of the search box. - // extents - (in) The extents of the search box. - // Returns: Reference identifier for the polygon, or 0 if no polygons found. - dtTilePolyRef findNearestPoly(const float* center, const float* extents); - - // Returns polygons which touch the query box. - // Params: - // center - (in) the center of the search box. - // extents - (in) the extents of the search box. - // polys - (out) array holding the search result. - // maxPolys - (in) The max number of polygons the polys array can hold. - // Returns: Number of polygons in search result array. - int queryPolygons(const float* center, const float* extents, - dtTilePolyRef* polys, const int maxPolys); - - // Finds path from start polygon to end polygon. - // If target polygon canno be reached through the navigation graph, - // the last node on the array is nearest node to the end polygon. - // Params: - // startRef - (in) ref to path start polygon. - // endRef - (in) ref to path end polygon. - // path - (out) array holding the search result. - // maxPathSize - (in) The max number of polygons the path array can hold. - // Returns: Number of polygons in search result array. - int findPath(dtTilePolyRef startRef, dtTilePolyRef endRef, - const float* startPos, const float* endPos, - dtTilePolyRef* path, const int maxPathSize); - - // Finds a straight path from start to end locations within the corridor - // described by the path polygons. - // Start and end locations will be clamped on the corridor. - // Params: - // startPos - (in) Path start location. - // endPos - (in) Path end location. - // path - (in) Array of connected polygons describing the corridor. - // pathSize - (in) Number of polygons in path array. - // straightPath - (out) Points describing the straight path. - // maxStraightPathSize - (in) The max number of points the straight path array can hold. - // Returns: Number of points in the path. - int findStraightPath(const float* startPos, const float* endPos, - const dtTilePolyRef* path, const int pathSize, - float* straightPath, const int maxStraightPathSize); - - // Finds intersection againts walls starting from start pos. - // Params: - // startRef - (in) ref to the polygon where the start lies. - // startPos - (in) start position of the query. - // endPos - (in) end position of the query. - // t - (out) hit parameter along the segment, 0 if no hit. - // endRef - (out) ref to the last polygon which was processed. - // Returns: Number of polygons in path or 0 if failed. - int raycast(dtTilePolyRef startRef, const float* startPos, const float* endPos, - float& t, dtTilePolyRef* path, const int pathSize); - - // Returns distance to nearest wall from the specified location. - // Params: - // centerRef - (in) ref to the polygon where the center lies. - // centerPos - (in) center if the query circle. - // maxRadius - (in) max search radius. - // hitPos - (out) location of the nearest hit. - // hitNormal - (out) normal of the nearest hit. - // Returns: Distance to nearest wall from the test location. - float findDistanceToWall(dtTilePolyRef centerRef, const float* centerPos, float maxRadius, - float* hitPos, float* hitNormal); - - // Finds polygons found along the navigation graph which touch the specified circle. - // Params: - // centerRef - (in) ref to the polygon where the center lies. - // centerPos - (in) center if the query circle - // radius - (in) radius of the query circle - // resultRef - (out, opt) refs to the polygons touched by the circle. - // resultParent - (out, opt) parent of each result polygon. - // resultCost - (out, opt) search cost at each result polygon. - // maxResult - (int) maximum capacity of search results. - // Returns: Number of results. - int findPolysAround(dtTilePolyRef centerRef, const float* centerPos, float radius, - dtTilePolyRef* resultRef, dtTilePolyRef* resultParent, float* resultCost, - const int maxResult); - - // Returns closest point on navigation polygon. - // Params: - // ref - (in) ref to the polygon. - // pos - (in) the point to check. - // closest - (out) closest point. - // Returns: true if closest point found. - bool closestPointToPoly(dtTilePolyRef ref, const float* pos, float* closest) const; - - // Returns height of the polygon at specified location. - // Params: - // ref - (in) ref to the polygon. - // pos - (in) the point where to locate the height. - // height - (out) height at the location. - // Returns: true if over polygon. - bool getPolyHeight(dtTilePolyRef ref, const float* pos, float* height) const; - - // Returns pointer to a polygon based on ref. - const dtTilePoly* getPolyByRef(dtTilePolyRef ref) const; - - // Returns pointer to a polygon vertices based on ref. - const float* getPolyVertsByRef(dtTilePolyRef ref) const; - - // Returns pointer to a polygon link based on ref. - const dtTileLink* getPolyLinksByRef(dtTilePolyRef ref) const; - -private: - - // Returns base id for the tile. - dtTilePolyRef getTileId(dtTile* tile); - // Returns neighbour tile based on side. - dtTile* getNeighbourTileAt(int x, int y, int side); - // Returns all polygons in neighbour tile based on portal defined by the segment. - int findConnectingPolys(const float* va, const float* vb, - dtTile* tile, int side, - dtTilePolyRef* con, float* conarea, int maxcon); - // Builds internal polygons links for a tile. - void buildIntLinks(dtTile* tile); - // Builds external polygon links for a tile. - void buildExtLinks(dtTile* tile, dtTile* target, int side); - // Removes external links at specified side. - void removeExtLinks(dtTile* tile, int side); - // Queries polygons within a tile. - int queryTilePolygons(dtTile* tile, const float* qmin, const float* qmax, - dtTilePolyRef* polys, const int maxPolys); - - float getCost(dtTilePolyRef prev, dtTilePolyRef from, dtTilePolyRef to) const; - float getFirstCost(const float* pos, dtTilePolyRef from, dtTilePolyRef to) const; - float getLastCost(dtTilePolyRef from, dtTilePolyRef to, const float* pos) const; - float getHeuristic(const float* from, const float* to) const; - - // Returns portal points between two polygons. - bool getPortalPoints(dtTilePolyRef from, dtTilePolyRef to, float* left, float* right) const; - // Returns edge mid point between two polygons. - bool getEdgeMidPoint(dtTilePolyRef from, dtTilePolyRef to, float* mid) const; - - float m_orig[3]; - float m_tileSize; - float m_portalHeight; - - dtTile* m_posLookup[DT_TILE_LOOKUP_SIZE]; - dtTile* m_nextFree; - dtTile m_tiles[DT_MAX_TILES]; - - dtTileLink* m_tmpLinks; - int m_ntmpLinks; - - class dtNodePool* m_nodePool; - class dtNodeQueue* m_openList; -}; - -#endif // DETOURTILENAVMESH_H diff --git a/Detour/Include/DetourTileNavMeshBuilder.h b/Detour/Include/DetourTileNavMeshBuilder.h deleted file mode 100644 index 643dec1..0000000 --- a/Detour/Include/DetourTileNavMeshBuilder.h +++ /dev/null @@ -1,29 +0,0 @@ -// -// Copyright (c) 2009 Mikko Mononen memon@inside.org -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. -// - -#ifndef DETOURTILEDNAVMESHBUILDER_H -#define DETOURTILEDNAVMESHBUILDER_H - -bool dtCreateNavMeshTileData(const unsigned short* verts, const int nverts, - const unsigned short* polys, const int npolys, const int nvp, - const unsigned short* dmeshes, const float* dverts, const int ndverts, - const unsigned char* dtris, const int ndtris, - const float* bmin, const float* bmax, float cs, float ch, int tileSize, int walkableClimb, - unsigned char** outData, int* outDataSize); - -#endif // DETOURTILEDNAVMESHBUILDER_H \ No newline at end of file diff --git a/Detour/Source/DetourDebugDraw.cpp b/Detour/Source/DetourDebugDraw.cpp index e15e3eb..12db317 100755 --- a/Detour/Source/DetourDebugDraw.cpp +++ b/Detour/Source/DetourDebugDraw.cpp @@ -17,57 +17,10 @@ // #include "DetourDebugDraw.h" -#include "DetourStatNavMesh.h" -#include "DetourTileNavMesh.h" #include "DetourNavMesh.h" #include "SDL.h" #include "SDL_opengl.h" -void dtDebugDrawStatNavMeshPoly(const dtStatNavMesh* mesh, dtStatPolyRef ref, const float* col) -{ - int idx = mesh->getPolyIndexByRef(ref); - if (idx == -1) return; - - glColor4f(col[0],col[1],col[2],0.25f); - - if (mesh->getPolyDetailCount()) - { - const dtStatPoly* p = mesh->getPoly(idx); - const dtStatPolyDetail* pd = mesh->getPolyDetail(idx); - glBegin(GL_TRIANGLES); - for (int j = 0; j < pd->ntris; ++j) - { - const unsigned char* t = mesh->getDetailTri(pd->tbase+j); - for (int k = 0; k < 3; ++k) - { - if (t[k] < p->nv) - glVertex3fv(mesh->getVertex(p->v[t[k]])); - else - glVertex3fv(mesh->getDetailVertex(pd->vbase+(t[k]-p->nv))); - } - } - glEnd(); - } - else - { - const dtStatPoly* p = mesh->getPoly(idx); - glBegin(GL_TRIANGLES); - unsigned short vi[3]; - for (int j = 2; j < (int)p->nv; ++j) - { - vi[0] = p->v[0]; - vi[1] = p->v[j-1]; - vi[2] = p->v[j]; - for (int k = 0; k < 3; ++k) - { - const float* v = mesh->getVertex(vi[k]); - glVertex3f(v[0], v[1]+0.2f, v[2]); - } - } - glEnd(); - } -} - static void drawBoxWire(float minx, float miny, float minz, float maxx, float maxy, float maxz, const float* col) { glColor4fv(col); @@ -103,32 +56,6 @@ static void drawBoxWire(float minx, float miny, float minz, float maxx, float ma glVertex3f(minx, maxy, maxz); } -void dtDebugDrawStatNavMeshBVTree(const dtStatNavMesh* mesh) -{ - const float col[] = { 1,1,1,0.5f }; - const dtStatNavMeshHeader* hdr = mesh->getHeader(); - - const dtStatBVNode* nodes = mesh->getBvTreeNodes(); - int nnodes = mesh->getBvTreeNodeCount(); - - glBegin(GL_LINES); - - for (int i = 0; i < nnodes; ++i) - { - const dtStatBVNode* n = &nodes[i]; - if (n->i < 0) // Leaf indices are positive. - continue; - drawBoxWire(hdr->bmin[0] + n->bmin[0]*hdr->cs, - hdr->bmin[1] + n->bmin[1]*hdr->cs, - hdr->bmin[2] + n->bmin[2]*hdr->cs, - hdr->bmin[0] + n->bmax[0]*hdr->cs, - hdr->bmin[1] + n->bmax[1]*hdr->cs, - hdr->bmin[2] + n->bmax[2]*hdr->cs, col); - } - glEnd(); -} - - static float distancePtLine2d(const float* pt, const float* p, const float* q) { float pqx = q[0] - p[0]; @@ -143,363 +70,6 @@ static float distancePtLine2d(const float* pt, const float* p, const float* q) return dx*dx + dz*dz; } -static void drawStatMeshPolyBoundaries(const dtStatNavMesh* mesh, bool inner) -{ - static const float thr = 0.01f*0.01f; - - glBegin(GL_LINES); - for (int i = 0; i < mesh->getPolyCount(); ++i) - { - const dtStatPoly* p = mesh->getPoly(i); - const dtStatPolyDetail* pd = mesh->getPolyDetail(i); - - for (int j = 0, nj = (int)p->nv; j < nj; ++j) - { - if (inner) - { - // Skip non-connected edges. - if (p->n[j] == 0) continue; - } - else - { - // Skip connected edges. - if (p->n[j] != 0) continue; - } - - const float* v0 = mesh->getVertex(p->v[j]); - const float* v1 = mesh->getVertex(p->v[(j+1) % nj]); - - // Draw detail mesh edges which align with the actual poly edge. - // This is really slow. - for (int k = 0; k < pd->ntris; ++k) - { - const unsigned char* t = mesh->getDetailTri(pd->tbase+k); - const float* tv[3]; - for (int m = 0; m < 3; ++m) - { - if (t[m] < p->nv) - tv[m] = mesh->getVertex(p->v[t[m]]); - else - tv[m] = mesh->getDetailVertex(pd->vbase+(t[m]-p->nv)); - } - for (int m = 0, n = 2; m < 3; n=m++) - { - if (((t[3] >> (n*2)) & 0x3) == 0) continue; // Skip inner edges. - if (distancePtLine2d(tv[n],v0,v1) < thr && - distancePtLine2d(tv[m],v0,v1) < thr) - { - glVertex3fv(tv[n]); - glVertex3fv(tv[m]); - } - } - } - } - } - glEnd(); -} - -void dtDebugDrawStatNavMesh(const dtStatNavMesh* mesh, bool drawClosedList) -{ - glBegin(GL_TRIANGLES); - for (int i = 0; i < mesh->getPolyDetailCount(); ++i) - { - const dtStatPoly* p = mesh->getPoly(i); - const dtStatPolyDetail* pd = mesh->getPolyDetail(i); - - if (drawClosedList && mesh->isInClosedList(i+1)) - glColor4ub(255,196,0,64); - else - glColor4ub(0,196,255,64); - - for (int j = 0; j < pd->ntris; ++j) - { - const unsigned char* t = mesh->getDetailTri(pd->tbase+j); - for (int k = 0; k < 3; ++k) - { - if (t[k] < p->nv) - glVertex3fv(mesh->getVertex(p->v[t[k]])); - else - glVertex3fv(mesh->getDetailVertex(pd->vbase+(t[k]-p->nv))); - } - } - } - glEnd(); - - // Draw inter poly boundaries - glColor4ub(0,48,64,32); - glLineWidth(1.5f); - drawStatMeshPolyBoundaries(mesh, true); - - // Draw outer poly boundaries - glLineWidth(2.5f); - glColor4ub(0,48,64,220); - drawStatMeshPolyBoundaries(mesh, false); - - glLineWidth(1.0f); - - glPointSize(3.0f); - glColor4ub(0,0,0,196); - glBegin(GL_POINTS); - for (int i = 0; i < mesh->getVertexCount(); ++i) - { - const float* v = mesh->getVertex(i); - glVertex3f(v[0], v[1], v[2]); - } - glEnd(); - glPointSize(1.0f); -} - - -static void drawTilePolyBoundaries(const dtTileHeader* header, bool inner) -{ - static const float thr = 0.01f*0.01f; - - glBegin(GL_LINES); - for (int i = 0; i < header->npolys; ++i) - { - const dtTilePoly* p = &header->polys[i]; - const dtTilePolyDetail* pd = &header->dmeshes[i]; - - for (int j = 0, nj = (int)p->nv; j < nj; ++j) - { - if (inner) - { - if (p->n[j] == 0) continue; - if (p->n[j] & 0x8000) - { - bool con = false; - for (int k = 0; k < p->nlinks; ++k) - { - if (header->links[p->links+k].e == j) - { - con = true; - break; - } - } - if (con) - glColor4ub(255,255,255,128); - else - glColor4ub(0,0,0,128); - } - else - glColor4ub(0,48,64,32); - } - else - { - if (p->n[j] != 0) continue; - } - - const float* v0 = &header->verts[p->v[j]*3]; - const float* v1 = &header->verts[p->v[(j+1)%nj]*3]; - - // Draw detail mesh edges which align with the actual poly edge. - // This is really slow. - for (int k = 0; k < pd->ntris; ++k) - { - const unsigned char* t = &header->dtris[(pd->tbase+k)*4]; - const float* tv[3]; - for (int m = 0; m < 3; ++m) - { - if (t[m] < p->nv) - tv[m] = &header->verts[p->v[t[m]]*3]; - else - tv[m] = &header->dverts[(pd->vbase+(t[m]-p->nv))*3]; - } - for (int m = 0, n = 2; m < 3; n=m++) - { - if (((t[3] >> (n*2)) & 0x3) == 0) continue; // Skip inner detail edges. - if (distancePtLine2d(tv[n],v0,v1) < thr && - distancePtLine2d(tv[m],v0,v1) < thr) - { - glVertex3fv(tv[n]); - glVertex3fv(tv[m]); - } - } - } - } - } - glEnd(); -} - -static void drawTile(const dtTileHeader* header) -{ - glBegin(GL_TRIANGLES); - for (int i = 0; i < header->npolys; ++i) - { - const dtTilePoly* p = &header->polys[i]; - const dtTilePolyDetail* pd = &header->dmeshes[i]; - - glColor4ub(0,196,255,64); - - for (int j = 0; j < pd->ntris; ++j) - { - const unsigned char* t = &header->dtris[(pd->tbase+j)*4]; - for (int k = 0; k < 3; ++k) - { - if (t[k] < p->nv) - glVertex3fv(&header->verts[p->v[t[k]]*3]); - else - glVertex3fv(&header->dverts[(pd->vbase+t[k]-p->nv)*3]); - } - } - } - glEnd(); - - // Draw inter poly boundaries - glColor4ub(0,48,64,32); - glLineWidth(1.5f); - - drawTilePolyBoundaries(header, true); - - // Draw outer poly boundaries - glLineWidth(2.5f); - glColor4ub(0,48,64,220); - - drawTilePolyBoundaries(header, false); - - glLineWidth(1.0f); - - glPointSize(3.0f); - glColor4ub(0,0,0,196); - glBegin(GL_POINTS); - for (int i = 0; i < header->nverts; ++i) - { - const float* v = &header->verts[i*3]; - glVertex3f(v[0], v[1], v[2]); - } - glEnd(); - glPointSize(1.0f); - - // Draw portals -/* glBegin(GL_LINES); - - for (int i = 0; i < header->nportals[0]; ++i) - { - const dtTilePortal* p = &header->portals[0][i]; - if (p->ncon) - glColor4ub(255,255,255,192); - else - glColor4ub(255,0,0,64); - glVertex3f(header->bmax[0]-0.1f, p->bmin[1], p->bmin[0]); - glVertex3f(header->bmax[0]-0.1f, p->bmax[1], p->bmin[0]); - - glVertex3f(header->bmax[0]-0.1f, p->bmax[1], p->bmin[0]); - glVertex3f(header->bmax[0]-0.1f, p->bmax[1], p->bmax[0]); - - glVertex3f(header->bmax[0]-0.1f, p->bmax[1], p->bmax[0]); - glVertex3f(header->bmax[0]-0.1f, p->bmin[1], p->bmax[0]); - - glVertex3f(header->bmax[0]-0.1f, p->bmin[1], p->bmax[0]); - glVertex3f(header->bmax[0]-0.1f, p->bmin[1], p->bmin[0]); - } - for (int i = 0; i < header->nportals[1]; ++i) - { - const dtTilePortal* p = &header->portals[1][i]; - if (p->ncon) - glColor4ub(255,255,255,192); - else - glColor4ub(255,0,0,64); - glVertex3f(p->bmin[0], p->bmin[1], header->bmax[2]-0.1f); - glVertex3f(p->bmin[0], p->bmax[1], header->bmax[2]-0.1f); - - glVertex3f(p->bmin[0], p->bmax[1], header->bmax[2]-0.1f); - glVertex3f(p->bmax[0], p->bmax[1], header->bmax[2]-0.1f); - - glVertex3f(p->bmax[0], p->bmax[1], header->bmax[2]-0.1f); - glVertex3f(p->bmax[0], p->bmin[1], header->bmax[2]-0.1f); - - glVertex3f(p->bmax[0], p->bmin[1], header->bmax[2]-0.1f); - glVertex3f(p->bmin[0], p->bmin[1], header->bmax[2]-0.1f); - } - for (int i = 0; i < header->nportals[2]; ++i) - { - const dtTilePortal* p = &header->portals[2][i]; - if (p->ncon) - glColor4ub(255,255,255,192); - else - glColor4ub(255,0,0,64); - glVertex3f(header->bmin[0]+0.1f, p->bmin[1], p->bmin[0]); - glVertex3f(header->bmin[0]+0.1f, p->bmax[1], p->bmin[0]); - - glVertex3f(header->bmin[0]+0.1f, p->bmax[1], p->bmin[0]); - glVertex3f(header->bmin[0]+0.1f, p->bmax[1], p->bmax[0]); - - glVertex3f(header->bmin[0]+0.1f, p->bmax[1], p->bmax[0]); - glVertex3f(header->bmin[0]+0.1f, p->bmin[1], p->bmax[0]); - - glVertex3f(header->bmin[0]+0.1f, p->bmin[1], p->bmax[0]); - glVertex3f(header->bmin[0]+0.1f, p->bmin[1], p->bmin[0]); - } - for (int i = 0; i < header->nportals[3]; ++i) - { - const dtTilePortal* p = &header->portals[3][i]; - if (p->ncon) - glColor4ub(255,255,255,192); - else - glColor4ub(255,0,0,64); - glVertex3f(p->bmin[0], p->bmin[1], header->bmin[2]+0.1f); - glVertex3f(p->bmin[0], p->bmax[1], header->bmin[2]+0.1f); - - glVertex3f(p->bmin[0], p->bmax[1], header->bmin[2]+0.1f); - glVertex3f(p->bmax[0], p->bmax[1], header->bmin[2]+0.1f); - - glVertex3f(p->bmax[0], p->bmax[1], header->bmin[2]+0.1f); - glVertex3f(p->bmax[0], p->bmin[1], header->bmin[2]+0.1f); - - glVertex3f(p->bmax[0], p->bmin[1], header->bmin[2]+0.1f); - glVertex3f(p->bmin[0], p->bmin[1], header->bmin[2]+0.1f); - } - glEnd();*/ -} - -void dtDebugDrawTiledNavMesh(const dtTiledNavMesh* mesh) -{ - if (!mesh) return; - - for (int i = 0; i < DT_MAX_TILES; ++i) - { - const dtTile* tile = mesh->getTile(i); - if (!tile->header) continue; - - drawTile(tile->header); - } -} - -void dtDebugDrawTiledNavMeshPoly(const dtTiledNavMesh* mesh, dtTilePolyRef ref, const float* col) -{ - unsigned int salt, it, ip; - dtDecodeTileId(ref, salt, it, ip); - if (it >= DT_MAX_TILES) return; - const dtTile* tile = mesh->getTile(it); - if (tile->salt != salt || tile->header == 0) return; - const dtTileHeader* header = tile->header; - - if (ip >= (unsigned int)header->npolys) return; - - glColor4f(col[0],col[1],col[2],0.25f); - - const dtTilePoly* p = &header->polys[ip]; - const dtTilePolyDetail* pd = &header->dmeshes[ip]; - - glBegin(GL_TRIANGLES); - for (int i = 0; i < pd->ntris; ++i) - { - const unsigned char* t = &header->dtris[(pd->tbase+i)*4]; - for (int j = 0; j < 3; ++j) - { - if (t[j] < p->nv) - glVertex3fv(&header->verts[p->v[t[j]]*3]); - else - glVertex3fv(&header->dverts[(pd->vbase+t[j]-p->nv)*3]); - } - } - glEnd(); -} - - - - - static void drawPolyBoundaries(const dtMeshHeader* header, bool inner) { static const float thr = 0.01f*0.01f; @@ -626,26 +196,6 @@ static void drawMeshTile(const dtNavMesh* mesh, const dtMeshTile* tile, bool dra glEnd(); glPointSize(1.0f); -/* - // Draw BV nodes. - const float col[] = { 1,1,1,0.5f }; - const float cs = 1.0f / header->bvquant; - glBegin(GL_LINES); - for (int i = 0; i < header->nbvtree; ++i) - { - const dtBVNode* n = &header->bvtree[i]; - if (n->i < 0) // Leaf indices are positive. - continue; - drawBoxWire(header->bmin[0] + n->bmin[0]*cs, - header->bmin[1] + n->bmin[1]*cs, - header->bmin[2] + n->bmin[2]*cs, - header->bmin[0] + n->bmax[0]*cs, - header->bmin[1] + n->bmax[1]*cs, - header->bmin[2] + n->bmax[2]*cs, col); - } - glEnd(); -*/ - // Draw portals /* glBegin(GL_LINES); @@ -741,6 +291,121 @@ void dtDebugDrawNavMesh(const dtNavMesh* mesh, bool drawClosedList) } +static void drawMeshTileBVTree(const dtNavMesh* mesh, const dtMeshTile* tile) +{ + const dtMeshHeader* header = tile->header; + + // Draw BV nodes. + const float col[] = { 1,1,1,0.5f }; + const float cs = 1.0f / header->bvquant; + glBegin(GL_LINES); + for (int i = 0; i < header->nbvtree; ++i) + { + const dtBVNode* n = &header->bvtree[i]; + if (n->i < 0) // Leaf indices are positive. + continue; + drawBoxWire(header->bmin[0] + n->bmin[0]*cs, + header->bmin[1] + n->bmin[1]*cs, + header->bmin[2] + n->bmin[2]*cs, + header->bmin[0] + n->bmax[0]*cs, + header->bmin[1] + n->bmax[1]*cs, + header->bmin[2] + n->bmax[2]*cs, col); + } + glEnd(); + + // Draw portals + /* glBegin(GL_LINES); + + for (int i = 0; i < header->nportals[0]; ++i) + { + const dtTilePortal* p = &header->portals[0][i]; + if (p->ncon) + glColor4ub(255,255,255,192); + else + glColor4ub(255,0,0,64); + glVertex3f(header->bmax[0]-0.1f, p->bmin[1], p->bmin[0]); + glVertex3f(header->bmax[0]-0.1f, p->bmax[1], p->bmin[0]); + + glVertex3f(header->bmax[0]-0.1f, p->bmax[1], p->bmin[0]); + glVertex3f(header->bmax[0]-0.1f, p->bmax[1], p->bmax[0]); + + glVertex3f(header->bmax[0]-0.1f, p->bmax[1], p->bmax[0]); + glVertex3f(header->bmax[0]-0.1f, p->bmin[1], p->bmax[0]); + + glVertex3f(header->bmax[0]-0.1f, p->bmin[1], p->bmax[0]); + glVertex3f(header->bmax[0]-0.1f, p->bmin[1], p->bmin[0]); + } + for (int i = 0; i < header->nportals[1]; ++i) + { + const dtTilePortal* p = &header->portals[1][i]; + if (p->ncon) + glColor4ub(255,255,255,192); + else + glColor4ub(255,0,0,64); + glVertex3f(p->bmin[0], p->bmin[1], header->bmax[2]-0.1f); + glVertex3f(p->bmin[0], p->bmax[1], header->bmax[2]-0.1f); + + glVertex3f(p->bmin[0], p->bmax[1], header->bmax[2]-0.1f); + glVertex3f(p->bmax[0], p->bmax[1], header->bmax[2]-0.1f); + + glVertex3f(p->bmax[0], p->bmax[1], header->bmax[2]-0.1f); + glVertex3f(p->bmax[0], p->bmin[1], header->bmax[2]-0.1f); + + glVertex3f(p->bmax[0], p->bmin[1], header->bmax[2]-0.1f); + glVertex3f(p->bmin[0], p->bmin[1], header->bmax[2]-0.1f); + } + for (int i = 0; i < header->nportals[2]; ++i) + { + const dtTilePortal* p = &header->portals[2][i]; + if (p->ncon) + glColor4ub(255,255,255,192); + else + glColor4ub(255,0,0,64); + glVertex3f(header->bmin[0]+0.1f, p->bmin[1], p->bmin[0]); + glVertex3f(header->bmin[0]+0.1f, p->bmax[1], p->bmin[0]); + + glVertex3f(header->bmin[0]+0.1f, p->bmax[1], p->bmin[0]); + glVertex3f(header->bmin[0]+0.1f, p->bmax[1], p->bmax[0]); + + glVertex3f(header->bmin[0]+0.1f, p->bmax[1], p->bmax[0]); + glVertex3f(header->bmin[0]+0.1f, p->bmin[1], p->bmax[0]); + + glVertex3f(header->bmin[0]+0.1f, p->bmin[1], p->bmax[0]); + glVertex3f(header->bmin[0]+0.1f, p->bmin[1], p->bmin[0]); + } + for (int i = 0; i < header->nportals[3]; ++i) + { + const dtTilePortal* p = &header->portals[3][i]; + if (p->ncon) + glColor4ub(255,255,255,192); + else + glColor4ub(255,0,0,64); + glVertex3f(p->bmin[0], p->bmin[1], header->bmin[2]+0.1f); + glVertex3f(p->bmin[0], p->bmax[1], header->bmin[2]+0.1f); + + glVertex3f(p->bmin[0], p->bmax[1], header->bmin[2]+0.1f); + glVertex3f(p->bmax[0], p->bmax[1], header->bmin[2]+0.1f); + + glVertex3f(p->bmax[0], p->bmax[1], header->bmin[2]+0.1f); + glVertex3f(p->bmax[0], p->bmin[1], header->bmin[2]+0.1f); + + glVertex3f(p->bmax[0], p->bmin[1], header->bmin[2]+0.1f); + glVertex3f(p->bmin[0], p->bmin[1], header->bmin[2]+0.1f); + } + glEnd();*/ +} + +void dtDebugDrawNavMeshBVTree(const dtNavMesh* mesh) +{ + if (!mesh) return; + + for (int i = 0; i < mesh->getMaxTiles(); ++i) + { + const dtMeshTile* tile = mesh->getTile(i); + if (!tile->header) continue; + drawMeshTileBVTree(mesh, tile); + } +} void dtDebugDrawNavMeshPoly(const dtNavMesh* mesh, dtPolyRef ref, const float* col) { diff --git a/Detour/Source/DetourNavMesh.cpp b/Detour/Source/DetourNavMesh.cpp index 005ce81..c83012b 100644 --- a/Detour/Source/DetourNavMesh.cpp +++ b/Detour/Source/DetourNavMesh.cpp @@ -76,19 +76,30 @@ inline int computeTileHash(int x, int y, const int mask) return (int)(n & mask); } + + ////////////////////////////////////////////////////////////////////////////////////////// dtNavMesh::dtNavMesh() : m_tileWidth(0), m_tileHeight(0), m_portalHeight(0), + m_maxTiles(0), + m_tileLutSize(0), + m_tileLutMask(0), + m_posLookup(0), m_nextFree(0), + m_tiles(0), m_tmpLinks(0), m_ntmpLinks(0), + m_saltBits(0), + m_tileBits(0), + m_polyBits(0), m_nodePool(0), - m_openList(0), - m_posLookup(0), - m_tiles(0) + m_openList(0) { + m_orig[0] = 0; + m_orig[1] = 0; + m_orig[2] = 0; } dtNavMesh::~dtNavMesh() diff --git a/Detour/Source/DetourStatNavMesh.cpp b/Detour/Source/DetourStatNavMesh.cpp deleted file mode 100755 index c165189..0000000 --- a/Detour/Source/DetourStatNavMesh.cpp +++ /dev/null @@ -1,953 +0,0 @@ -// -// Copyright (c) 2009 Mikko Mononen memon@inside.org -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. -// - -#include -#include -#include -#include -#include "DetourStatNavMesh.h" -#include "DetourNode.h" -#include "DetourCommon.h" - - -////////////////////////////////////////////////////////////////////////////////////////// -dtStatNavMesh::dtStatNavMesh() : - m_data(0), - m_dataSize(0), - m_header(0), - m_nodePool(0), - m_openList(0) -{ -} - -dtStatNavMesh::~dtStatNavMesh() -{ - delete m_nodePool; - delete m_openList; - if (m_data) - delete [] m_data; -} - -bool dtStatNavMesh::init(unsigned char* data, int dataSize, bool ownsData) -{ - dtStatNavMeshHeader* header = (dtStatNavMeshHeader*)data; - - if (header->magic != DT_STAT_NAVMESH_MAGIC) - return false; - if (header->version != DT_STAT_NAVMESH_VERSION) - return false; - - const int headerSize = align4(sizeof(dtStatNavMeshHeader)); - const int vertsSize = align4(sizeof(float)*3*header->nverts); - const int polysSize = align4(sizeof(dtStatPoly)*header->npolys); - const int nodesSize = align4(sizeof(dtStatBVNode)*header->npolys*2); - const int detailMeshesSize = align4(sizeof(dtStatPolyDetail)*header->ndmeshes); - const int detailVertsSize = align4(sizeof(float)*3*header->ndverts); - const int detailTrisSize = align4(sizeof(unsigned char)*4*header->ndtris); - - - unsigned char* d = data + headerSize; - header->verts = (float*)d; d += vertsSize; - header->polys = (dtStatPoly*)d; d += polysSize; - header->bvtree = (dtStatBVNode*)d; d += nodesSize; - header->dmeshes = (dtStatPolyDetail*)d; d += detailMeshesSize; - header->dverts = (float*)d; d += detailVertsSize; - header->dtris = (unsigned char*)d; d += detailTrisSize; - - m_nodePool = new dtNodePool(2048, 256); - if (!m_nodePool) - return false; - - m_openList = new dtNodeQueue(2048); - if (!m_openList) - return false; - - if (ownsData) - { - m_data = data; - m_dataSize = dataSize; - } - - m_header = header; - - return true; -} - -const dtStatPoly* dtStatNavMesh::getPolyByRef(dtStatPolyRef ref) const -{ - if (!m_header || ref == 0 || (int)ref > m_header->npolys) return 0; - return &m_header->polys[ref-1]; -} - -int dtStatNavMesh::getPolyIndexByRef(dtStatPolyRef ref) const -{ - if (!m_header || ref == 0 || (int)ref > m_header->npolys) return -1; - return (int)ref-1; -} - -int dtStatNavMesh::findPath(dtStatPolyRef startRef, dtStatPolyRef endRef, - const float* startPos, const float* endPos, - dtStatPolyRef* path, const int maxPathSize) -{ - if (!m_header) return 0; - - if (!startRef || !endRef) - return 0; - - if (!maxPathSize) - return 0; - - if (startRef == endRef) - { - path[0] = startRef; - return 1; - } - - m_nodePool->clear(); - m_openList->clear(); - - static const float H_SCALE = 1.1f; // Heuristic scale. - - dtNode* startNode = m_nodePool->getNode(startRef); - startNode->pidx = 0; - startNode->cost = 0; - startNode->total = vdist(startPos, endPos) * H_SCALE; - startNode->id = startRef; - startNode->flags = DT_NODE_OPEN; - m_openList->push(startNode); - - dtNode* lastBestNode = startNode; - float lastBestNodeCost = startNode->total; - while (!m_openList->empty()) - { - dtNode* bestNode = m_openList->pop(); - - if (bestNode->id == endRef) - { - lastBestNode = bestNode; - break; - } - - const dtStatPoly* poly = getPoly(bestNode->id-1); - for (int i = 0; i < (int)poly->nv; ++i) - { - dtStatPolyRef neighbour = poly->n[i]; - if (neighbour) - { - // Skip parent node. - if (bestNode->pidx && m_nodePool->getNodeAtIdx(bestNode->pidx)->id == neighbour) - continue; - - dtNode* parent = bestNode; - dtNode newNode; - newNode.pidx = m_nodePool->getNodeIdx(parent); - newNode.id = neighbour; - - // Calculate cost. - float p0[3], p1[3]; - if (!parent->pidx) - vcopy(p0, startPos); - else - getEdgeMidPoint(m_nodePool->getNodeAtIdx(parent->pidx)->id, parent->id, p0); - getEdgeMidPoint(parent->id, newNode.id, p1); - newNode.cost = parent->cost + vdist(p0,p1); - // Special case for last node. - if (newNode.id == endRef) - newNode.cost += vdist(p1, endPos); - - // Heuristic - const float h = vdist(p1,endPos)*H_SCALE; - newNode.total = newNode.cost + h; - - dtNode* actualNode = m_nodePool->getNode(newNode.id); - if (!actualNode) - continue; - - if (!((actualNode->flags & DT_NODE_OPEN) && newNode.total > actualNode->total) && - !((actualNode->flags & DT_NODE_CLOSED) && newNode.total > actualNode->total)) - { - actualNode->flags &= ~DT_NODE_CLOSED; - actualNode->pidx = newNode.pidx; - actualNode->cost = newNode.cost; - actualNode->total = newNode.total; - - if (h < lastBestNodeCost) - { - lastBestNodeCost = h; - lastBestNode = actualNode; - } - - if (actualNode->flags & DT_NODE_OPEN) - { - m_openList->modify(actualNode); - } - else - { - actualNode->flags |= DT_NODE_OPEN; - m_openList->push(actualNode); - } - } - } - } - bestNode->flags |= DT_NODE_CLOSED; - } - - // Reverse the path. - dtNode* prev = 0; - dtNode* node = lastBestNode; - do - { - dtNode* next = m_nodePool->getNodeAtIdx(node->pidx); - node->pidx = m_nodePool->getNodeIdx(prev); - prev = node; - node = next; - } - while (node); - - // Store path - node = prev; - int n = 0; - do - { - path[n++] = node->id; - node = m_nodePool->getNodeAtIdx(node->pidx); - } - while (node && n < maxPathSize); - - return n; -} - -bool dtStatNavMesh::closestPointToPoly(dtStatPolyRef ref, const float* pos, float* closest) const -{ - int idx = getPolyIndexByRef(ref); - if (idx == -1) - return false; - - float closestDistSqr = FLT_MAX; - const dtStatPoly* p = getPoly(idx); - const dtStatPolyDetail* pd = getPolyDetail(idx); - - for (int j = 0; j < pd->ntris; ++j) - { - const unsigned char* t = getDetailTri(pd->tbase+j); - const float* v[3]; - for (int k = 0; k < 3; ++k) - { - if (t[k] < p->nv) - v[k] = getVertex(p->v[t[k]]); - else - v[k] = getDetailVertex(pd->vbase+(t[k]-p->nv)); - } - float pt[3]; - closestPtPointTriangle(pt, pos, v[0], v[1], v[2]); - float d = vdistSqr(pos, pt); - if (d < closestDistSqr) - { - vcopy(closest, pt); - closestDistSqr = d; - } - } - - return true; -} - -bool dtStatNavMesh::getPolyHeight(dtStatPolyRef ref, const float* pos, float* height) const -{ - int idx = getPolyIndexByRef(ref); - if (idx == -1) - return false; - - const dtStatPoly* p = getPoly(idx); - const dtStatPolyDetail* pd = getPolyDetail(idx); - - for (int i = 0; i < pd->ntris; ++i) - { - const unsigned char* t = getDetailTri(pd->tbase+i); - const float* v[3]; - for (int j = 0; j < 3; ++j) - { - if (t[j] < p->nv) - v[j] = getVertex(p->v[t[j]]); - else - v[j] = getDetailVertex(pd->vbase+(t[j]-p->nv)); - } - float h; - if (closestHeightPointTriangle(pos, v[0], v[1], v[2], h)) - { - if (height) - *height = h; - return true; - } - } - - return false; -} - -int dtStatNavMesh::findStraightPath(const float* startPos, const float* endPos, - const dtStatPolyRef* path, const int pathSize, - float* straightPath, const int maxStraightPathSize) -{ - if (!m_header) return 0; - - if (!maxStraightPathSize) - return 0; - - if (!path[0]) - return 0; - - int straightPathSize = 0; - - float closestStartPos[3]; - if (!closestPointToPoly(path[0], startPos, closestStartPos)) - return 0; - - // Add start point. - vcopy(&straightPath[straightPathSize*3], closestStartPos); - straightPathSize++; - if (straightPathSize >= maxStraightPathSize) - return straightPathSize; - - float closestEndPos[3]; - if (!closestPointToPoly(path[pathSize-1], endPos, closestEndPos)) - return 0; - - float portalApex[3], portalLeft[3], portalRight[3]; - - if (pathSize > 1) - { - vcopy(portalApex, closestStartPos); - vcopy(portalLeft, portalApex); - vcopy(portalRight, portalApex); - int apexIndex = 0; - int leftIndex = 0; - int rightIndex = 0; - - for (int i = 0; i < pathSize; ++i) - { - float left[3], right[3]; - if (i < pathSize-1) - { - // Next portal. - getPortalPoints(path[i], path[i+1], left, right); - } - else - { - // End of the path. - vcopy(left, closestEndPos); - vcopy(right, closestEndPos); - } - - // Right vertex. - if (vequal(portalApex, portalRight)) - { - vcopy(portalRight, right); - rightIndex = i; - } - else - { - if (triArea2D(portalApex, portalRight, right) <= 0.0f) - { - if (triArea2D(portalApex, portalLeft, right) > 0.0f) - { - vcopy(portalRight, right); - rightIndex = i; - } - else - { - vcopy(portalApex, portalLeft); - apexIndex = leftIndex; - - if (!vequal(&straightPath[(straightPathSize-1)*3], portalApex)) - { - vcopy(&straightPath[straightPathSize*3], portalApex); - straightPathSize++; - if (straightPathSize >= maxStraightPathSize) - return straightPathSize; - } - - vcopy(portalLeft, portalApex); - vcopy(portalRight, portalApex); - leftIndex = apexIndex; - rightIndex = apexIndex; - - // Restart - i = apexIndex; - - continue; - } - } - } - - // Left vertex. - if (vequal(portalApex, portalLeft)) - { - vcopy(portalLeft, left); - leftIndex = i; - } - else - { - if (triArea2D(portalApex, portalLeft, left) >= 0.0f) - { - if (triArea2D(portalApex, portalRight, left) < 0.0f) - { - vcopy(portalLeft, left); - leftIndex = i; - } - else - { - vcopy(portalApex, portalRight); - apexIndex = rightIndex; - - if (!vequal(&straightPath[(straightPathSize-1)*3], portalApex)) - { - vcopy(&straightPath[straightPathSize*3], portalApex); - straightPathSize++; - if (straightPathSize >= maxStraightPathSize) - return straightPathSize; - } - - vcopy(portalLeft, portalApex); - vcopy(portalRight, portalApex); - leftIndex = apexIndex; - rightIndex = apexIndex; - - // Restart - i = apexIndex; - - continue; - } - } - } - } - } - - // Add end point. - vcopy(&straightPath[straightPathSize*3], closestEndPos); - straightPathSize++; - - return straightPathSize; -} - -static bool pointInPoly(int nvert, const float* verts, const float* p) -{ - - int i, j, c = 0; - for (i = 0, j = nvert-1; i < nvert; j = i++) - { - const float* vi = &verts[i*3]; - const float* vj = &verts[j*3]; - if (((vi[2] > p[2]) != (vj[2] > p[2])) && - (p[0] < (vj[0]-vi[0]) * (p[2]-vi[2]) / (vj[2]-vi[2]) + vi[0]) ) - c = !c; - } - return c != 0; -} - -int dtStatNavMesh::moveAlongPath(const float* startPos, const float* endPos, float* resultPos, - const dtStatPolyRef* path, const int pathSize) -{ - static const float SLOP = 0.01f; - float verts[DT_STAT_VERTS_PER_POLYGON*3]; - int n = 0, prevn = 0; - - vcopy(resultPos, startPos); - - while (n < pathSize) - { - // Cast ray against current polygon. - int nv = getPolyVerts(path[n], verts); - if (nv < 3) - { - return prevn; - } - - if (pointInPoly(nv, verts, endPos)) - { - vcopy(resultPos, endPos); - return n; - } - - float tmin, tmax; - int segMin, segMax; - if (!intersectSegmentPoly2D(startPos, endPos, verts, nv, tmin, tmax, segMin, segMax)) - { - // Could not a polygon - return prevn; - } - - resultPos[0] = startPos[0] + (endPos[0] - startPos[0])*tmax; - resultPos[1] = startPos[1] + (endPos[1] - startPos[1])*tmax; - resultPos[2] = startPos[2] + (endPos[2] - startPos[2])*tmax; - - // Check if the hitpos is on the exit segment. - float p0[3], p1[3]; - if (!getPortalPoints(path[n], path[n+1], p0, p1)) - return 0; - float segt; - float distToPortalSqr = distancePtSegSqr2D(resultPos, p0, p1, segt); - if (distToPortalSqr > SLOP*SLOP) - { - // Hit wall, return pos so far. - return n; - } - - prevn = n; - n++; - } - - return n; - -/* // Check the neighbour of this polygon. - const dtStatPoly* poly = getPolyByRef(curRef); - dtStatPolyRef nextRef = poly->n[segMax]; - if (!nextRef)*/ - - -} - -int dtStatNavMesh::getPolyVerts(dtStatPolyRef ref, float* verts) const -{ - if (!m_header) return 0; - const dtStatPoly* poly = getPolyByRef(ref); - if (!poly) return 0; - float* v = verts; - for (int i = 0; i < (int)poly->nv; ++i) - { - const float* cv = &m_header->verts[poly->v[i]*3]; - *v++ = cv[0]; - *v++ = cv[1]; - *v++ = cv[2]; - } - return (int)poly->nv; -} - -int dtStatNavMesh::raycast(dtStatPolyRef centerRef, const float* startPos, const float* endPos, - float& t, dtStatPolyRef* path, const int pathSize) -{ - if (!m_header) return 0; - if (!centerRef) return 0; - - dtStatPolyRef prevRef = centerRef; - dtStatPolyRef curRef = centerRef; - t = 0; - - float verts[DT_STAT_VERTS_PER_POLYGON*3]; - int n = 0; - - while (curRef) - { - // Cast ray against current polygon. - int nv = getPolyVerts(curRef, verts); - if (nv < 3) - { - // Hit bad polygon, report hit. - return n; - } - - float tmin, tmax; - int segMin, segMax; - if (!intersectSegmentPoly2D(startPos, endPos, verts, nv, tmin, tmax, segMin, segMax)) - { - // Could not a polygon, keep the old t and report hit. - return n; - } - // Keep track of furthest t so far. - if (tmax > t) - t = tmax; - - if (n < pathSize) - path[n++] = curRef; - - // Check the neighbour of this polygon. - const dtStatPoly* poly = getPolyByRef(curRef); - dtStatPolyRef nextRef = poly->n[segMax]; - if (!nextRef) - { - // No neighbour, we hit a wall. - return n; - } - - // No hit, advance to neighbour polygon. - prevRef = curRef; - curRef = nextRef; - } - - return n; -} - - -float dtStatNavMesh::findDistanceToWall(dtStatPolyRef centerRef, const float* centerPos, float maxRadius, - float* hitPos, float* hitNormal) -{ - if (!m_header) return 0; - if (!centerRef) return 0; - - m_nodePool->clear(); - m_openList->clear(); - - dtNode* startNode = m_nodePool->getNode(centerRef); - startNode->pidx = 0; - startNode->cost = 0; - startNode->total = 0; - startNode->id = centerRef; - startNode->flags = DT_NODE_OPEN; - m_openList->push(startNode); - - float radiusSqr = sqr(maxRadius); - - hitNormal[0] = 1; - hitNormal[1] = 0; - hitNormal[2] = 0; - - while (!m_openList->empty()) - { - dtNode* bestNode = m_openList->pop(); - const dtStatPoly* poly = getPoly(bestNode->id-1); - - // Hit test walls. - for (int i = 0, j = (int)poly->nv-1; i < (int)poly->nv; j = i++) - { - // Skip non-solid edges. - if (poly->n[j]) continue; - - // Calc distance to the edge. - const float* vj = getVertex(poly->v[j]); - const float* vi = getVertex(poly->v[i]); - float tseg; - float distSqr = distancePtSegSqr2D(centerPos, vj, vi, tseg); - - // Edge is too far, skip. - if (distSqr > radiusSqr) - continue; - - // Hit wall, update radius. - radiusSqr = distSqr; - // Calculate hit pos. - hitPos[0] = vj[0] + (vi[0] - vj[0])*tseg; - hitPos[1] = vj[1] + (vi[1] - vj[1])*tseg; - hitPos[2] = vj[2] + (vi[2] - vj[2])*tseg; - } - - // Check to see if teh circle expands to one of the neighbours and expand. - for (int i = 0, j = (int)poly->nv-1; i < (int)poly->nv; j = i++) - { - // Skip solid edges. - if (!poly->n[j]) continue; - - // Expand to neighbour if not visited yet. - dtStatPolyRef neighbour = poly->n[j]; - - // Skip parent node. - if (bestNode->pidx && m_nodePool->getNodeAtIdx(bestNode->pidx)->id == neighbour) - continue; - - // Calc distance to the edge. - const float* vj = getVertex(poly->v[j]); - const float* vi = getVertex(poly->v[i]); - float tseg; - float distSqr = distancePtSegSqr2D(centerPos, vj, vi, tseg); - - // Edge is too far, skip. - if (distSqr > radiusSqr) - continue; - - dtNode* parent = bestNode; - dtNode newNode; - newNode.pidx = m_nodePool->getNodeIdx(parent); - newNode.id = neighbour; - - // Cost - float p0[3], p1[3]; - if (!parent->pidx) - vcopy(p0, centerPos); - else - getEdgeMidPoint(m_nodePool->getNodeAtIdx(parent->pidx)->id, parent->id, p0); - getEdgeMidPoint(parent->id, newNode.id, p1); - newNode.total = parent->total + vdist(p0,p1); - - dtNode* actualNode = m_nodePool->getNode(newNode.id); - if (!actualNode) - continue; - - if (!((actualNode->flags & DT_NODE_OPEN) && newNode.total > actualNode->total) && - !((actualNode->flags & DT_NODE_CLOSED) && newNode.total > actualNode->total)) - { - actualNode->flags &= ~DT_NODE_CLOSED; - actualNode->pidx = newNode.pidx; - actualNode->total = newNode.total; - - if (actualNode->flags & DT_NODE_OPEN) - { - m_openList->modify(actualNode); - } - else - { - actualNode->flags |= DT_NODE_OPEN; - m_openList->push(actualNode); - } - } - } - bestNode->flags |= DT_NODE_CLOSED; - } - - // Calc hit normal. - vsub(hitNormal, centerPos, hitPos); - vnormalize(hitNormal); - - return sqrtf(radiusSqr); -} - -int dtStatNavMesh::findPolysAround(dtStatPolyRef centerRef, const float* centerPos, float radius, - dtStatPolyRef* resultRef, dtStatPolyRef* resultParent, float* resultCost, - const int maxResult) -{ - if (!m_header) return 0; - if (!centerRef) return 0; - - m_nodePool->clear(); - m_openList->clear(); - - dtNode* startNode = m_nodePool->getNode(centerRef); - startNode->pidx = 0; - startNode->cost = 0; - startNode->total = 0; - startNode->id = centerRef; - startNode->flags = DT_NODE_OPEN; - m_openList->push(startNode); - - int n = 0; - if (n < maxResult) - { - if (resultRef) - resultRef[n] = startNode->id; - if (resultParent) - resultParent[n] = 0; - if (resultCost) - resultCost[n] = 0; - ++n; - } - - const float radiusSqr = sqr(radius); - - while (!m_openList->empty()) - { - dtNode* bestNode = m_openList->pop(); - const dtStatPoly* poly = getPoly(bestNode->id-1); - for (unsigned i = 0, j = (int)poly->nv-1; i < (int)poly->nv; j=i++) - { - dtStatPolyRef neighbour = poly->n[j]; - - if (neighbour) - { - // Skip parent node. - if (bestNode->pidx && m_nodePool->getNodeAtIdx(bestNode->pidx)->id == neighbour) - continue; - - // Calc distance to the edge. - const float* vj = getVertex(poly->v[j]); - const float* vi = getVertex(poly->v[i]); - float tseg; - float distSqr = distancePtSegSqr2D(centerPos, vj, vi, tseg); - - // If the circle is not touching the next polygon, skip it. - if (distSqr > radiusSqr) - continue; - - dtNode* parent = bestNode; - dtNode newNode; - newNode.pidx = m_nodePool->getNodeIdx(parent); - newNode.id = neighbour; - - // Cost - float p0[3], p1[3]; - if (!parent->pidx) - vcopy(p0, centerPos); - else - getEdgeMidPoint(m_nodePool->getNodeAtIdx(parent->pidx)->id, parent->id, p0); - getEdgeMidPoint(parent->id, newNode.id, p1); - newNode.total = parent->total + vdist(p0,p1); - - dtNode* actualNode = m_nodePool->getNode(newNode.id); - if (!actualNode) - continue; - - if (!((actualNode->flags & DT_NODE_OPEN) && newNode.total > actualNode->total) && - !((actualNode->flags & DT_NODE_CLOSED) && newNode.total > actualNode->total)) - { - actualNode->flags &= ~DT_NODE_CLOSED; - actualNode->pidx = newNode.pidx; - actualNode->total = newNode.total; - - if (actualNode->flags & DT_NODE_OPEN) - { - m_openList->modify(actualNode); - } - else - { - if (n < maxResult) - { - if (resultRef) - resultRef[n] = actualNode->id; - if (resultParent) - resultParent[n] = m_nodePool->getNodeAtIdx(actualNode->pidx)->id; - if (resultCost) - resultCost[n] = actualNode->total; - ++n; - } - actualNode->flags |= DT_NODE_OPEN; - m_openList->push(actualNode); - } - } - } - } - bestNode->flags |= DT_NODE_CLOSED; - - } - - return n; -} - -// Returns polygons which are withing certain radius from the query location. -int dtStatNavMesh::queryPolygons(const float* center, const float* extents, - dtStatPolyRef* polys, const int maxIds) -{ - if (!m_header) return 0; - - const dtStatBVNode* node = &m_header->bvtree[0]; - const dtStatBVNode* end = &m_header->bvtree[m_header->nnodes]; - - // Calculate quantized box - const float ics = 1.0f / m_header->cs; - unsigned short bmin[3], bmax[3]; - // Clamp query box to world box. - float minx = clamp(center[0] - extents[0], m_header->bmin[0], m_header->bmax[0]) - m_header->bmin[0]; - float miny = clamp(center[1] - extents[1], m_header->bmin[1], m_header->bmax[1]) - m_header->bmin[1]; - float minz = clamp(center[2] - extents[2], m_header->bmin[2], m_header->bmax[2]) - m_header->bmin[2]; - float maxx = clamp(center[0] + extents[0], m_header->bmin[0], m_header->bmax[0]) - m_header->bmin[0]; - float maxy = clamp(center[1] + extents[1], m_header->bmin[1], m_header->bmax[1]) - m_header->bmin[1]; - float maxz = clamp(center[2] + extents[2], m_header->bmin[2], m_header->bmax[2]) - m_header->bmin[2]; - // Quantize - bmin[0] = (unsigned short)(ics * minx) & 0xfffe; - bmin[1] = (unsigned short)(ics * miny) & 0xfffe; - bmin[2] = (unsigned short)(ics * minz) & 0xfffe; - bmax[0] = (unsigned short)(ics * maxx + 1) | 1; - bmax[1] = (unsigned short)(ics * maxy + 1) | 1; - bmax[2] = (unsigned short)(ics * maxz + 1) | 1; - - // Traverse tree - int n = 0; - while (node < end) - { - bool overlap = checkOverlapBox(bmin, bmax, node->bmin, node->bmax); - bool isLeafNode = node->i >= 0; - - if (isLeafNode && overlap) - { - if (n < maxIds) - { - polys[n] = (dtStatPolyRef)node->i; - n++; - } - } - - if (overlap || isLeafNode) - node++; - else - { - const int escapeIndex = -node->i; - node += escapeIndex; - } - } - - return n; -} - -dtStatPolyRef dtStatNavMesh::findNearestPoly(const float* center, const float* extents) -{ - if (!m_header) return 0; - - // Get nearby polygons from proximity grid. - dtStatPolyRef polys[128]; - int npolys = queryPolygons(center, extents, polys, 128); - - // Find nearest polygon amongst the nearby polygons. - dtStatPolyRef nearest = 0; - float nearestDistanceSqr = FLT_MAX; - for (int i = 0; i < npolys; ++i) - { - dtStatPolyRef ref = polys[i]; - float closest[3]; - if (!closestPointToPoly(ref, center, closest)) - continue; - float d = vdistSqr(center, closest); - if (d < nearestDistanceSqr) - { - nearestDistanceSqr = d; - nearest = ref; - } - } - - return nearest; -} - -bool dtStatNavMesh::getPortalPoints(dtStatPolyRef from, dtStatPolyRef to, float* left, float* right) const -{ - const dtStatPoly* fromPoly = getPolyByRef(from); - if (!fromPoly) - return false; - - // Find common edge between the polygons and returns the segment end points. - for (unsigned i = 0, j = (int)fromPoly->nv - 1; i < (int)fromPoly->nv; j = i++) - { - unsigned short neighbour = fromPoly->n[j]; - if (neighbour == to) - { - vcopy(left, getVertex(fromPoly->v[j])); - vcopy(right, getVertex(fromPoly->v[i])); - return true; - } - } - - return false; -} - -bool dtStatNavMesh::getEdgeMidPoint(dtStatPolyRef from, dtStatPolyRef to, float* mid) const -{ - float left[3], right[3]; - if (!getPortalPoints(from, to, left,right)) return false; - mid[0] = (left[0]+right[0])*0.5f; - mid[1] = (left[1]+right[1])*0.5f; - mid[2] = (left[2]+right[2])*0.5f; - return true; -} - -bool dtStatNavMesh::isInClosedList(dtStatPolyRef ref) const -{ - if (!m_nodePool) return false; - const dtNode* node = m_nodePool->findNode(ref); - return node && node->flags & DT_NODE_CLOSED; -} - -int dtStatNavMesh::getMemUsed() const -{ - if (!m_nodePool || ! m_openList) - return 0; - return sizeof(*this) + m_dataSize + - m_nodePool->getMemUsed() + - m_openList->getMemUsed(); -} diff --git a/Detour/Source/DetourStatNavMeshBuilder.cpp b/Detour/Source/DetourStatNavMeshBuilder.cpp deleted file mode 100755 index ea88944..0000000 --- a/Detour/Source/DetourStatNavMeshBuilder.cpp +++ /dev/null @@ -1,347 +0,0 @@ -// -// Copyright (c) 2009 Mikko Mononen memon@inside.org -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. -// - -#include -#include -#include -#include "DetourCommon.h" -#include "DetourStatNavMesh.h" - -struct BVItem -{ - unsigned short bmin[3]; - unsigned short bmax[3]; - int i; -}; - -static int compareItemX(const void* va, const void* vb) -{ - const BVItem* a = (const BVItem*)va; - const BVItem* b = (const BVItem*)vb; - if (a->bmin[0] < b->bmin[0]) - return -1; - if (a->bmin[0] > b->bmin[0]) - return 1; - return 0; -} - -static int compareItemY(const void* va, const void* vb) -{ - const BVItem* a = (const BVItem*)va; - const BVItem* b = (const BVItem*)vb; - if (a->bmin[1] < b->bmin[1]) - return -1; - if (a->bmin[1] > b->bmin[1]) - return 1; - return 0; -} - -static int compareItemZ(const void* va, const void* vb) -{ - const BVItem* a = (const BVItem*)va; - const BVItem* b = (const BVItem*)vb; - if (a->bmin[2] < b->bmin[2]) - return -1; - if (a->bmin[2] > b->bmin[2]) - return 1; - return 0; -} - -static void calcExtends(BVItem* items, int nitems, int imin, int imax, - unsigned short* bmin, unsigned short* bmax) -{ - bmin[0] = items[imin].bmin[0]; - bmin[1] = items[imin].bmin[1]; - bmin[2] = items[imin].bmin[2]; - - bmax[0] = items[imin].bmax[0]; - bmax[1] = items[imin].bmax[1]; - bmax[2] = items[imin].bmax[2]; - - for (int i = imin+1; i < imax; ++i) - { - const BVItem& it = items[i]; - if (it.bmin[0] < bmin[0]) bmin[0] = it.bmin[0]; - if (it.bmin[1] < bmin[1]) bmin[1] = it.bmin[1]; - if (it.bmin[2] < bmin[2]) bmin[2] = it.bmin[2]; - - if (it.bmax[0] > bmax[0]) bmax[0] = it.bmax[0]; - if (it.bmax[1] > bmax[1]) bmax[1] = it.bmax[1]; - if (it.bmax[2] > bmax[2]) bmax[2] = it.bmax[2]; - } -} - -inline int longestAxis(unsigned short x, unsigned short y, unsigned short z) -{ - int axis = 0; - unsigned short maxVal = x; - if (y > maxVal) - { - axis = 1; - maxVal = y; - } - if (z > maxVal) - { - axis = 2; - maxVal = z; - } - return axis; -} - -static void subdivide(BVItem* items, int nitems, int imin, int imax, int& curNode, dtStatBVNode* nodes) -{ - int inum = imax - imin; - int icur = curNode; - - dtStatBVNode& node = nodes[curNode++]; - - if (inum == 1) - { - // Leaf - node.bmin[0] = items[imin].bmin[0]; - node.bmin[1] = items[imin].bmin[1]; - node.bmin[2] = items[imin].bmin[2]; - - node.bmax[0] = items[imin].bmax[0]; - node.bmax[1] = items[imin].bmax[1]; - node.bmax[2] = items[imin].bmax[2]; - - node.i = items[imin].i; - } - else - { - // Split - calcExtends(items, nitems, imin, imax, node.bmin, node.bmax); - - int axis = longestAxis(node.bmax[0] - node.bmin[0], - node.bmax[1] - node.bmin[1], - node.bmax[2] - node.bmin[2]); - - if (axis == 0) - { - // Sort along x-axis - qsort(items+imin, inum, sizeof(BVItem), compareItemX); - } - else if (axis == 1) - { - // Sort along y-axis - qsort(items+imin, inum, sizeof(BVItem), compareItemY); - } - else - { - // Sort along z-axis - qsort(items+imin, inum, sizeof(BVItem), compareItemZ); - } - - int isplit = imin+inum/2; - - // Left - subdivide(items, nitems, imin, isplit, curNode, nodes); - // Right - subdivide(items, nitems, isplit, imax, curNode, nodes); - - int iescape = curNode - icur; - // Negative index means escape. - node.i = -iescape; - } -} - -static int createBVTree(const unsigned short* verts, const int nverts, - const unsigned short* polys, const int npolys, const int nvp, - float cs, float ch, - int nnodes, dtStatBVNode* nodes) -{ - // Build tree - BVItem* items = new BVItem[npolys]; - for (int i = 0; i < npolys; i++) - { - BVItem& it = items[i]; - it.i = i+1; - // Calc polygon bounds. - const unsigned short* p = &polys[i*nvp*2]; - it.bmin[0] = it.bmax[0] = verts[p[0]*3+0]; - it.bmin[1] = it.bmax[1] = verts[p[0]*3+1]; - it.bmin[2] = it.bmax[2] = verts[p[0]*3+2]; - - for (int j = 1; j < nvp; ++j) - { - if (p[j] == 0xffff) break; - unsigned short x = verts[p[j]*3+0]; - unsigned short y = verts[p[j]*3+1]; - unsigned short z = verts[p[j]*3+2]; - - if (x < it.bmin[0]) it.bmin[0] = x; - if (y < it.bmin[1]) it.bmin[1] = y; - if (z < it.bmin[2]) it.bmin[2] = z; - - if (x > it.bmax[0]) it.bmax[0] = x; - if (y > it.bmax[1]) it.bmax[1] = y; - if (z > it.bmax[2]) it.bmax[2] = z; - } - // Remap y - it.bmin[1] = (unsigned short)floorf((float)it.bmin[1]*ch/cs); - it.bmax[1] = (unsigned short)ceilf((float)it.bmax[1]*ch/cs); - } - - int curNode = 0; - subdivide(items, npolys, 0, npolys, curNode, nodes); - - delete [] items; - - return curNode; -} - - -bool dtCreateNavMeshData(const unsigned short* verts, const int nverts, - const unsigned short* polys, const int npolys, const int nvp, - const float* bmin, const float* bmax, float cs, float ch, - const unsigned short* dmeshes, const float* dverts, const int ndverts, - const unsigned char* dtris, const int ndtris, - unsigned char** outData, int* outDataSize) -{ - if (nvp > DT_STAT_VERTS_PER_POLYGON) - return false; - if (nverts >= 0xffff) - return false; - - if (!nverts) - return false; - if (!npolys) - return false; - if (!dmeshes || !dverts || ! dtris) - return false; - - // Find unique detail vertices. - int uniqueDetailVerts = 0; - if (dmeshes) - { - for (int i = 0; i < npolys; ++i) - { - const unsigned short* p = &polys[i*nvp*2]; - int ndv = dmeshes[i*4+1]; - int nv = 0; - for (int j = 0; j < nvp; ++j) - { - if (p[j] == 0xffff) break; - nv++; - } - ndv -= nv; - uniqueDetailVerts += ndv; - } - } - - // Calculate data size - const int headerSize = align4(sizeof(dtStatNavMeshHeader)); - const int vertsSize = align4(sizeof(float)*3*nverts); - const int polysSize = align4(sizeof(dtStatPoly)*npolys); - const int nodesSize = align4(sizeof(dtStatBVNode)*npolys*2); - const int detailMeshesSize = align4(sizeof(dtStatPolyDetail)*npolys); - const int detailVertsSize = align4(sizeof(float)*3*uniqueDetailVerts); - const int detailTrisSize = align4(sizeof(unsigned char)*4*ndtris); - - const int dataSize = headerSize + vertsSize + polysSize + nodesSize + - detailMeshesSize + detailVertsSize + detailTrisSize; - unsigned char* data = new unsigned char[dataSize]; - if (!data) - return false; - memset(data, 0, dataSize); - - unsigned char* d = data; - dtStatNavMeshHeader* header = (dtStatNavMeshHeader*)d; d += headerSize; - float* navVerts = (float*)d; d += vertsSize; - dtStatPoly* navPolys = (dtStatPoly*)d; d += polysSize; - dtStatBVNode* navNodes = (dtStatBVNode*)d; d += nodesSize; - dtStatPolyDetail* navDMeshes = (dtStatPolyDetail*)d; d += detailMeshesSize; - float* navDVerts = (float*)d; d += detailVertsSize; - unsigned char* navDTris = (unsigned char*)d; d += detailTrisSize; - - // Store header - header->magic = DT_STAT_NAVMESH_MAGIC; - header->version = DT_STAT_NAVMESH_VERSION; - header->npolys = npolys; - header->nverts = nverts; - header->cs = cs; - header->bmin[0] = bmin[0]; - header->bmin[1] = bmin[1]; - header->bmin[2] = bmin[2]; - header->bmax[0] = bmax[0]; - header->bmax[1] = bmax[1]; - header->bmax[2] = bmax[2]; - header->ndmeshes = dmeshes ? npolys : 0; - header->ndverts = dmeshes ? uniqueDetailVerts : 0; - header->ndtris = dmeshes ? ndtris : 0; - - // Store vertices - for (int i = 0; i < nverts; ++i) - { - const unsigned short* iv = &verts[i*3]; - float* v = &navVerts[i*3]; - v[0] = bmin[0] + iv[0] * cs; - v[1] = bmin[1] + iv[1] * ch; - v[2] = bmin[2] + iv[2] * cs; - } - - // Store polygons - const unsigned short* src = polys; - for (int i = 0; i < npolys; ++i) - { - dtStatPoly* p = &navPolys[i]; - p->nv = 0; - for (int j = 0; j < nvp; ++j) - { - if (src[j] == 0xffff) break; - p->v[j] = src[j]; - p->n[j] = src[nvp+j]+1; - p->nv++; - } - src += nvp*2; - } - - header->nnodes = createBVTree(verts, nverts, polys, npolys, nvp, - cs, ch, npolys*2, navNodes); - - - // Store detail meshes and vertices. - // The nav polygon vertices are stored as the first vertices on each mesh. - // We compress the mesh data by skipping them and using the navmesh coordinates. - unsigned short vbase = 0; - for (int i = 0; i < npolys; ++i) - { - dtStatPolyDetail& dtl = navDMeshes[i]; - const int vb = dmeshes[i*4+0]; - const int ndv = dmeshes[i*4+1]; - const int nv = navPolys[i].nv; - dtl.vbase = vbase; - dtl.nverts = ndv-nv; - dtl.tbase = dmeshes[i*4+2]; - dtl.ntris = dmeshes[i*4+3]; - // Copy vertices except the first 'nv' verts which are equal to nav poly verts. - if (ndv-nv > 0) - { - memcpy(&navDVerts[vbase*3], &dverts[(vb+nv)*3], sizeof(float)*3*(ndv-nv)); - vbase += ndv-nv; - } - } - // Store triangles. - memcpy(navDTris, dtris, sizeof(unsigned char)*4*ndtris); - - *outData = data; - *outDataSize = dataSize; - - return true; -} diff --git a/Detour/Source/DetourTileNavMesh.cpp b/Detour/Source/DetourTileNavMesh.cpp deleted file mode 100644 index 4e4ff8f..0000000 --- a/Detour/Source/DetourTileNavMesh.cpp +++ /dev/null @@ -1,1428 +0,0 @@ -// -// Copyright (c) 2009 Mikko Mononen memon@inside.org -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. -// - -#include -#include -#include -#include -#include "DetourTileNavMesh.h" -#include "DetourNode.h" -#include "DetourCommon.h" - - -inline int opposite(int side) { return (side+2) & 0x3; } - -inline bool overlapBoxes(const float* amin, const float* amax, - const float* bmin, const float* bmax) -{ - bool overlap = true; - overlap = (amin[0] > bmax[0] || amax[0] < bmin[0]) ? false : overlap; - overlap = (amin[1] > bmax[1] || amax[1] < bmin[1]) ? false : overlap; - overlap = (amin[2] > bmax[2] || amax[2] < bmin[2]) ? false : overlap; - return overlap; -} - -inline bool overlapRects(const float* amin, const float* amax, - const float* bmin, const float* bmax) -{ - bool overlap = true; - overlap = (amin[0] > bmax[0] || amax[0] < bmin[0]) ? false : overlap; - overlap = (amin[1] > bmax[1] || amax[1] < bmin[1]) ? false : overlap; - return overlap; -} - -static void calcRect(const float* va, const float* vb, - float* bmin, float* bmax, - int side, float padx, float pady) -{ - if ((side&1) == 0) - { - bmin[0] = min(va[2],vb[2]) + padx; - bmin[1] = min(va[1],vb[1]) - pady; - bmax[0] = max(va[2],vb[2]) - padx; - bmax[1] = max(va[1],vb[1]) + pady; - } - else - { - bmin[0] = min(va[0],vb[0]) + padx; - bmin[1] = min(va[1],vb[1]) - pady; - bmax[0] = max(va[0],vb[0]) - padx; - bmax[1] = max(va[1],vb[1]) + pady; - } -} - -inline int computeTileHash(int x, int y) -{ - const unsigned int h1 = 0x8da6b343; // Large multiplicative constants; - const unsigned int h2 = 0xd8163841; // here arbitrarily chosen primes - unsigned int n = h1 * x + h2 * y; - return (int)(n & (DT_TILE_LOOKUP_SIZE-1)); -} - -////////////////////////////////////////////////////////////////////////////////////////// -dtTiledNavMesh::dtTiledNavMesh() : - m_tileSize(0), - m_portalHeight(0), - m_nextFree(0), - m_tmpLinks(0), - m_ntmpLinks(0), - m_nodePool(0), - m_openList(0) -{ -} - -dtTiledNavMesh::~dtTiledNavMesh() -{ - for (int i = 0; i < DT_MAX_TILES; ++i) - { - if (m_tiles[i].data && m_tiles[i].ownsData) - { - delete [] m_tiles[i].data; - m_tiles[i].data = 0; - m_tiles[i].dataSize = 0; - } - } - delete [] m_tmpLinks; - delete m_nodePool; - delete m_openList; -} - -bool dtTiledNavMesh::init(const float* orig, float tileSize, float portalHeight) -{ - vcopy(m_orig, orig); - m_tileSize = tileSize; - m_portalHeight = portalHeight; - - // Init tiles - memset(m_tiles, 0, sizeof(dtTile)*DT_MAX_TILES); - memset(m_posLookup, 0, sizeof(dtTile*)*DT_TILE_LOOKUP_SIZE); - m_nextFree = 0; - for (int i = DT_MAX_TILES-1; i >= 0; --i) - { - m_tiles[i].next = m_nextFree; - m_nextFree = &m_tiles[i]; - } - - if (!m_nodePool) - { - m_nodePool = new dtNodePool(2048, 256); - if (!m_nodePool) - return false; - } - - if (!m_openList) - { - m_openList = new dtNodeQueue(2048); - if (!m_openList) - return false; - } - - return true; -} - -////////////////////////////////////////////////////////////////////////////////////////// -int dtTiledNavMesh::findConnectingPolys(const float* va, const float* vb, - dtTile* tile, int side, - dtTilePolyRef* con, float* conarea, int maxcon) -{ - if (!tile) return 0; - dtTileHeader* h = tile->header; - - float amin[2], amax[2]; - calcRect(va,vb, amin,amax, side, 0.01f, m_portalHeight); - - // Remove links pointing to 'side' and compact the links array. - float bmin[2], bmax[2]; - unsigned short m = 0x8000 | (unsigned short)side; - int n = 0; - - dtTilePolyRef base = getTileId(tile); - - for (int i = 0; i < h->npolys; ++i) - { - dtTilePoly* poly = &h->polys[i]; - for (int j = 0; j < poly->nv; ++j) - { - // Skip edges which do not point to the right side. - if (poly->n[j] != m) continue; - // Check if the segments touch. - const float* vc = &h->verts[poly->v[j]*3]; - const float* vd = &h->verts[poly->v[(j+1) % (int)poly->nv]*3]; - calcRect(vc,vd, bmin,bmax, side, 0.01f, m_portalHeight); - if (!overlapRects(amin,amax, bmin,bmax)) continue; - // Add return value. - if (n < maxcon) - { - conarea[n*2+0] = max(amin[0], bmin[0]); - conarea[n*2+1] = min(amax[0], bmax[0]); - con[n] = base | (unsigned int)i; - n++; - } - break; - } - } - return n; -} - -void dtTiledNavMesh::removeExtLinks(dtTile* tile, int side) -{ - if (!tile) return; - dtTileHeader* h = tile->header; - - // Remove links pointing to 'side' and compact the links array. - dtTileLink* pool = m_tmpLinks; - int nlinks = 0; - for (int i = 0; i < h->npolys; ++i) - { - dtTilePoly* poly = &h->polys[i]; - int plinks = nlinks; - int nplinks = 0; - for (int j = 0; j < poly->nlinks; ++j) - { - dtTileLink* link = &h->links[poly->links+j]; - if ((int)link->side != side) - { - if (nlinks < h->maxlinks) - { - dtTileLink* dst = &pool[nlinks++]; - memcpy(dst, link, sizeof(dtTileLink)); - nplinks++; - } - } - } - poly->links = plinks; - poly->nlinks = nplinks; - } - h->nlinks = nlinks; - if (h->nlinks) - memcpy(h->links, m_tmpLinks, sizeof(dtTileLink)*nlinks); -} - -void dtTiledNavMesh::buildExtLinks(dtTile* tile, dtTile* target, int side) -{ - if (!tile) return; - dtTileHeader* h = tile->header; - - // Remove links pointing to 'side' and compact the links array. - dtTileLink* pool = m_tmpLinks; - int nlinks = 0; - for (int i = 0; i < h->npolys; ++i) - { - dtTilePoly* poly = &h->polys[i]; - int plinks = nlinks; - int nplinks = 0; - // Copy internal and other external links. - for (int j = 0; j < poly->nlinks; ++j) - { - dtTileLink* link = &h->links[poly->links+j]; - if ((int)link->side != side) - { - if (nlinks < h->maxlinks) - { - dtTileLink* dst = &pool[nlinks++]; - memcpy(dst, link, sizeof(dtTileLink)); - nplinks++; - } - } - } - // Create new links. - unsigned short m = 0x8000 | (unsigned short)side; - for (int j = 0; j < poly->nv; ++j) - { - // Skip edges which do not point to the right side. - if (poly->n[j] != m) continue; - - // Create new links - const float* va = &h->verts[poly->v[j]*3]; - const float* vb = &h->verts[poly->v[(j+1)%(int)poly->nv]*3]; - dtTilePolyRef nei[4]; - float neia[4*2]; - int nnei = findConnectingPolys(va,vb, target, opposite(side), nei,neia,4); - for (int k = 0; k < nnei; ++k) - { - if (nlinks < h->maxlinks) - { - dtTileLink* link = &pool[nlinks++]; - link->ref = nei[k]; - link->p = (unsigned short)i; - link->e = (unsigned char)j; - link->side = (unsigned char)side; - - // Compress portal limits to a byte value. - if (side == 0 || side == 2) - { - const float lmin = min(va[2], vb[2]); - const float lmax = max(va[2], vb[2]); - link->bmin = (unsigned char)(clamp((neia[k*2+0]-lmin)/(lmax-lmin), 0.0f, 1.0f)*255.0f); - link->bmax = (unsigned char)(clamp((neia[k*2+1]-lmin)/(lmax-lmin), 0.0f, 1.0f)*255.0f); - } - else - { - const float lmin = min(va[0], vb[0]); - const float lmax = max(va[0], vb[0]); - link->bmin = (unsigned char)(clamp((neia[k*2+0]-lmin)/(lmax-lmin), 0.0f, 1.0f)*255.0f); - link->bmax = (unsigned char)(clamp((neia[k*2+1]-lmin)/(lmax-lmin), 0.0f, 1.0f)*255.0f); - } - nplinks++; - } - } - } - - poly->links = plinks; - poly->nlinks = nplinks; - } - h->nlinks = nlinks; - if (h->nlinks) - memcpy(h->links, m_tmpLinks, sizeof(dtTileLink)*nlinks); -} - -void dtTiledNavMesh::buildIntLinks(dtTile* tile) -{ - if (!tile) return; - dtTileHeader* h = tile->header; - - dtTilePolyRef base = getTileId(tile); - dtTileLink* pool = h->links; - int nlinks = 0; - for (int i = 0; i < h->npolys; ++i) - { - dtTilePoly* poly = &h->polys[i]; - poly->links = nlinks; - poly->nlinks = 0; - for (int j = 0; j < poly->nv; ++j) - { - // Skip hard and non-internal edges. - if (poly->n[j] == 0 || (poly->n[j] & 0x8000)) continue; - - if (nlinks < h->maxlinks) - { - dtTileLink* link = &pool[nlinks++]; - link->ref = base | (unsigned int)(poly->n[j]-1); - link->p = (unsigned short)i; - link->e = (unsigned char)j; - link->side = 0xff; - link->bmin = link->bmax = 0; - poly->nlinks++; - } - } - } - h->nlinks = nlinks; -} - -bool dtTiledNavMesh::addTileAt(int x, int y, unsigned char* data, int dataSize, bool ownsData) -{ - if (getTileAt(x,y)) - return false; - // Make sure there is enough space for new tile. - if (!m_nextFree) - return false; - // Make sure the data is in right format. - dtTileHeader* header = (dtTileHeader*)data; - if (header->magic != DT_TILE_NAVMESH_MAGIC) - return false; - if (header->version != DT_TILE_NAVMESH_VERSION) - return false; - - // Make sure the tmp link array is large enough. - if (header->maxlinks > m_ntmpLinks) - { - m_ntmpLinks = header->maxlinks; - delete [] m_tmpLinks; - m_tmpLinks = 0; - m_tmpLinks = new dtTileLink[m_ntmpLinks]; - } - if (!m_tmpLinks) - return false; - - // Allocate a tile. - dtTile* tile = m_nextFree; - m_nextFree = tile->next; - tile->next = 0; - - // Insert tile into the position lut. - int h = computeTileHash(x,y); - tile->next = m_posLookup[h]; - m_posLookup[h] = tile; - - // Patch header pointers. - const int headerSize = align4(sizeof(dtTileHeader)); - const int vertsSize = align4(sizeof(float)*3*header->nverts); - const int polysSize = align4(sizeof(dtTilePoly)*header->npolys); - const int linksSize = align4(sizeof(dtTileLink)*(header->maxlinks)); - const int detailMeshesSize = align4(sizeof(dtTilePolyDetail)*header->ndmeshes); - const int detailVertsSize = align4(sizeof(float)*3*header->ndverts); - const int detailTrisSize = align4(sizeof(unsigned char)*4*header->ndtris); - - unsigned char* d = data + headerSize; - header->verts = (float*)d; d += vertsSize; - header->polys = (dtTilePoly*)d; d += polysSize; - header->links = (dtTileLink*)d; d += linksSize; - header->dmeshes = (dtTilePolyDetail*)d; d += detailMeshesSize; - header->dverts = (float*)d; d += detailVertsSize; - header->dtris = (unsigned char*)d; d += detailTrisSize; - - // Init tile. - tile->header = header; - tile->x = x; - tile->y = y; - tile->data = data; - tile->dataSize = dataSize; - tile->ownsData = ownsData; - - buildIntLinks(tile); - - // Create connections connections. - for (int i = 0; i < 4; ++i) - { - dtTile* nei = getNeighbourTileAt(x,y,i); - if (nei) - { - buildExtLinks(tile, nei, i); - buildExtLinks(nei, tile, opposite(i)); - } - } - - return true; -} - -dtTile* dtTiledNavMesh::getTileAt(int x, int y) -{ - // Find tile based on hash. - int h = computeTileHash(x,y); - dtTile* tile = m_posLookup[h]; - while (tile) - { - if (tile->x == x && tile->y == y) - return tile; - tile = tile->next; - } - return 0; -} - -dtTile* dtTiledNavMesh::getTile(int i) -{ - return &m_tiles[i]; -} - -const dtTile* dtTiledNavMesh::getTile(int i) const -{ - return &m_tiles[i]; -} - -dtTile* dtTiledNavMesh::getNeighbourTileAt(int x, int y, int side) -{ - switch (side) - { - case 0: x++; break; - case 1: y++; break; - case 2: x--; break; - case 3: y--; break; - }; - return getTileAt(x,y); -} - -bool dtTiledNavMesh::removeTileAt(int x, int y, unsigned char** data, int* dataSize) -{ - // Remove tile from hash lookup. - int h = computeTileHash(x,y); - dtTile* prev = 0; - dtTile* tile = m_posLookup[h]; - while (tile) - { - if (tile->x == x && tile->y == y) - { - if (prev) - prev->next = tile->next; - else - m_posLookup[h] = tile->next; - break; - } - prev = tile; - tile = tile->next; - } - if (!tile) - return false; - - // Remove connections to neighbour tiles. - for (int i = 0; i < 4; ++i) - { - dtTile* nei = getNeighbourTileAt(x,y,i); - if (!nei) continue; - removeExtLinks(nei, opposite(i)); - } - - - // Reset tile. - if (tile->ownsData) - { - // Owns data - delete [] tile->data; - tile->data = 0; - tile->dataSize = 0; - if (data) *data = 0; - if (dataSize) *dataSize = 0; - } - else - { - if (data) *data = tile->data; - if (dataSize) *dataSize = tile->dataSize; - } - tile->header = 0; - tile->x = tile->y = 0; - tile->salt++; - - // Add to free list. - tile->next = m_nextFree; - m_nextFree = tile; - - return true; -} - - - -bool dtTiledNavMesh::closestPointToPoly(dtTilePolyRef ref, const float* pos, float* closest) const -{ - unsigned int salt, it, ip; - dtDecodeTileId(ref, salt, it, ip); - if (it >= DT_MAX_TILES) return false; - if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return false; - const dtTileHeader* header = m_tiles[it].header; - - if (ip >= (unsigned int)header->npolys) return false; - const dtTilePoly* poly = &header->polys[ip]; - - float closestDistSqr = FLT_MAX; - const dtTilePolyDetail* pd = &header->dmeshes[ip]; - - for (int j = 0; j < pd->ntris; ++j) - { - const unsigned char* t = &header->dtris[(pd->tbase+j)*4]; - const float* v[3]; - for (int k = 0; k < 3; ++k) - { - if (t[k] < poly->nv) - v[k] = &header->verts[poly->v[t[k]]*3]; - else - v[k] = &header->dverts[(pd->vbase+(t[k]-poly->nv))*3]; - } - float pt[3]; - closestPtPointTriangle(pt, pos, v[0], v[1], v[2]); - float d = vdistSqr(pos, pt); - if (d < closestDistSqr) - { - vcopy(closest, pt); - closestDistSqr = d; - } - } - - return true; -} - -bool dtTiledNavMesh::getPolyHeight(dtTilePolyRef ref, const float* pos, float* height) const -{ - unsigned int salt, it, ip; - dtDecodeTileId(ref, salt, it, ip); - if (it >= DT_MAX_TILES) return false; - if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return false; - const dtTileHeader* header = m_tiles[it].header; - - if (ip >= (unsigned int)header->npolys) return false; - const dtTilePoly* poly = &header->polys[ip]; - - const dtTilePolyDetail* pd = &header->dmeshes[ip]; - for (int j = 0; j < pd->ntris; ++j) - { - const unsigned char* t = &header->dtris[(pd->tbase+j)*4]; - const float* v[3]; - for (int k = 0; k < 3; ++k) - { - if (t[k] < poly->nv) - v[k] = &header->verts[poly->v[t[k]]*3]; - else - v[k] = &header->dverts[(pd->vbase+(t[k]-poly->nv))*3]; - } - float h; - if (closestHeightPointTriangle(pos, v[0], v[1], v[2], h)) - { - if (height) - *height = h; - return true; - } - } - - return false; -} - - -dtTilePolyRef dtTiledNavMesh::findNearestPoly(const float* center, const float* extents) -{ - // Get nearby polygons from proximity grid. - dtTilePolyRef polys[128]; - int npolys = queryPolygons(center, extents, polys, 128); - - // Find nearest polygon amongst the nearby polygons. - dtTilePolyRef nearest = 0; - float nearestDistanceSqr = FLT_MAX; - for (int i = 0; i < npolys; ++i) - { - dtTilePolyRef ref = polys[i]; - float closest[3]; - if (!closestPointToPoly(ref, center, closest)) - continue; - float d = vdistSqr(center, closest); - if (d < nearestDistanceSqr) - { - nearestDistanceSqr = d; - nearest = ref; - } - } - - return nearest; -} - -dtTilePolyRef dtTiledNavMesh::getTileId(dtTile* tile) -{ - if (!tile) return 0; - const unsigned int it = tile - m_tiles; - return dtEncodeTileId(tile->salt, it, 0); -} - -int dtTiledNavMesh::queryTilePolygons(dtTile* tile, - const float* qmin, const float* qmax, - dtTilePolyRef* polys, const int maxPolys) -{ - float bmin[3], bmax[3]; - const dtTileHeader* header = tile->header; - int n = 0; - dtTilePolyRef base = getTileId(tile); - for (int i = 0; i < header->npolys; ++i) - { - // Calc polygon bounds. - dtTilePoly* p = &header->polys[i]; - const float* v = &header->verts[p->v[0]*3]; - vcopy(bmin, v); - vcopy(bmax, v); - for (int j = 1; j < p->nv; ++j) - { - v = &header->verts[p->v[j]*3]; - vmin(bmin, v); - vmax(bmax, v); - } - if (overlapBoxes(qmin,qmax, bmin,bmax)) - { - if (n < maxPolys) - polys[n++] = base | (dtTilePolyRef)i; - } - } - return n; -} - -int dtTiledNavMesh::queryPolygons(const float* center, const float* extents, - dtTilePolyRef* polys, const int maxPolys) -{ - float bmin[3], bmax[3]; - bmin[0] = center[0] - extents[0]; - bmin[1] = center[1] - extents[1]; - bmin[2] = center[2] - extents[2]; - - bmax[0] = center[0] + extents[0]; - bmax[1] = center[1] + extents[1]; - bmax[2] = center[2] + extents[2]; - - // Find tiles the query touches. - const int minx = (int)floorf((bmin[0]-m_orig[0]) / m_tileSize); - const int maxx = (int)ceilf((bmax[0]-m_orig[0]) / m_tileSize); - - const int miny = (int)floorf((bmin[2]-m_orig[2]) / m_tileSize); - const int maxy = (int)ceilf((bmax[2]-m_orig[2]) / m_tileSize); - - int n = 0; - for (int y = miny; y < maxy; ++y) - { - for (int x = minx; x < maxx; ++x) - { - dtTile* tile = getTileAt(x,y); - if (!tile) continue; - n += queryTilePolygons(tile, bmin, bmax, polys+n, maxPolys-n); - if (n >= maxPolys) return n; - } - } - - return n; -} - -int dtTiledNavMesh::findPath(dtTilePolyRef startRef, dtTilePolyRef endRef, - const float* startPos, const float* endPos, - dtTilePolyRef* path, const int maxPathSize) -{ - if (!startRef || !endRef) - return 0; - - if (!maxPathSize) - return 0; - - if (!getPolyByRef(startRef) || !getPolyByRef(endRef)) - return 0; - - if (startRef == endRef) - { - path[0] = startRef; - return 1; - } - - if (!m_nodePool || !m_openList) - return 0; - - m_nodePool->clear(); - m_openList->clear(); - - static const float H_SCALE = 1.1f; // Heuristic scale. - - dtNode* startNode = m_nodePool->getNode(startRef); - startNode->pidx = 0; - startNode->cost = 0; - startNode->total = vdist(startPos, endPos) * H_SCALE; - startNode->id = startRef; - startNode->flags = DT_NODE_OPEN; - m_openList->push(startNode); - - dtNode* lastBestNode = startNode; - float lastBestNodeCost = startNode->total; - while (!m_openList->empty()) - { - dtNode* bestNode = m_openList->pop(); - - if (bestNode->id == endRef) - { - lastBestNode = bestNode; - break; - } - - // Get poly and tile. - unsigned int salt, it, ip; - dtDecodeTileId(bestNode->id, salt, it, ip); - // The API input has been cheked already, skip checking internal data. - const dtTileHeader* header = m_tiles[it].header; - const dtTilePoly* poly = &header->polys[ip]; - - for (int i = 0; i < poly->nlinks; ++i) - { - dtTilePolyRef neighbour = header->links[poly->links+i].ref; - if (neighbour) - { - // Skip parent node. - if (bestNode->pidx && m_nodePool->getNodeAtIdx(bestNode->pidx)->id == neighbour) - continue; - - dtNode* parent = bestNode; - dtNode newNode; - newNode.pidx = m_nodePool->getNodeIdx(parent); - newNode.id = neighbour; - - // Calculate cost. - float p0[3], p1[3]; - if (!parent->pidx) - vcopy(p0, startPos); - else - getEdgeMidPoint(m_nodePool->getNodeAtIdx(parent->pidx)->id, parent->id, p0); - getEdgeMidPoint(parent->id, newNode.id, p1); - newNode.cost = parent->cost + vdist(p0,p1); - // Special case for last node. - if (newNode.id == endRef) - newNode.cost += vdist(p1, endPos); - - // Heuristic - const float h = vdist(p1,endPos)*H_SCALE; - newNode.total = newNode.cost + h; - - dtNode* actualNode = m_nodePool->getNode(newNode.id); - if (!actualNode) - continue; - - if (!((actualNode->flags & DT_NODE_OPEN) && newNode.total > actualNode->total) && - !((actualNode->flags & DT_NODE_CLOSED) && newNode.total > actualNode->total)) - { - actualNode->flags &= ~DT_NODE_CLOSED; - actualNode->pidx = newNode.pidx; - actualNode->cost = newNode.cost; - actualNode->total = newNode.total; - - if (h < lastBestNodeCost) - { - lastBestNodeCost = h; - lastBestNode = actualNode; - } - - if (actualNode->flags & DT_NODE_OPEN) - { - m_openList->modify(actualNode); - } - else - { - actualNode->flags |= DT_NODE_OPEN; - m_openList->push(actualNode); - } - } - } - } - bestNode->flags |= DT_NODE_CLOSED; - } - - // Reverse the path. - dtNode* prev = 0; - dtNode* node = lastBestNode; - do - { - dtNode* next = m_nodePool->getNodeAtIdx(node->pidx); - node->pidx = m_nodePool->getNodeIdx(prev); - prev = node; - node = next; - } - while (node); - - // Store path - node = prev; - int n = 0; - do - { - path[n++] = node->id; - node = m_nodePool->getNodeAtIdx(node->pidx); - } - while (node && n < maxPathSize); - - return n; -} - -int dtTiledNavMesh::findStraightPath(const float* startPos, const float* endPos, - const dtTilePolyRef* path, const int pathSize, - float* straightPath, const int maxStraightPathSize) -{ - if (!maxStraightPathSize) - return 0; - - if (!path[0]) - return 0; - - int straightPathSize = 0; - - float closestStartPos[3]; - if (!closestPointToPoly(path[0], startPos, closestStartPos)) - return 0; - - // Add start point. - vcopy(&straightPath[straightPathSize*3], closestStartPos); - straightPathSize++; - if (straightPathSize >= maxStraightPathSize) - return straightPathSize; - - float closestEndPos[3]; - if (!closestPointToPoly(path[pathSize-1], endPos, closestEndPos)) - return 0; - - float portalApex[3], portalLeft[3], portalRight[3]; - - if (pathSize > 1) - { - vcopy(portalApex, closestStartPos); - vcopy(portalLeft, portalApex); - vcopy(portalRight, portalApex); - int apexIndex = 0; - int leftIndex = 0; - int rightIndex = 0; - - for (int i = 0; i < pathSize; ++i) - { - float left[3], right[3]; - if (i < pathSize-1) - { - // Next portal. - if (!getPortalPoints(path[i], path[i+1], left, right)) - { - if (!closestPointToPoly(path[i], endPos, closestEndPos)) - return 0; - vcopy(&straightPath[straightPathSize*3], closestEndPos); - straightPathSize++; - return straightPathSize; - } - } - else - { - // End of the path. - vcopy(left, closestEndPos); - vcopy(right, closestEndPos); - } - - // Right vertex. - if (vequal(portalApex, portalRight)) - { - vcopy(portalRight, right); - rightIndex = i; - } - else - { - if (triArea2D(portalApex, portalRight, right) <= 0.0f) - { - if (triArea2D(portalApex, portalLeft, right) > 0.0f) - { - vcopy(portalRight, right); - rightIndex = i; - } - else - { - vcopy(portalApex, portalLeft); - apexIndex = leftIndex; - - if (!vequal(&straightPath[(straightPathSize-1)*3], portalApex)) - { - vcopy(&straightPath[straightPathSize*3], portalApex); - straightPathSize++; - if (straightPathSize >= maxStraightPathSize) - return straightPathSize; - } - - vcopy(portalLeft, portalApex); - vcopy(portalRight, portalApex); - leftIndex = apexIndex; - rightIndex = apexIndex; - - // Restart - i = apexIndex; - - continue; - } - } - } - - // Left vertex. - if (vequal(portalApex, portalLeft)) - { - vcopy(portalLeft, left); - leftIndex = i; - } - else - { - if (triArea2D(portalApex, portalLeft, left) >= 0.0f) - { - if (triArea2D(portalApex, portalRight, left) < 0.0f) - { - vcopy(portalLeft, left); - leftIndex = i; - } - else - { - vcopy(portalApex, portalRight); - apexIndex = rightIndex; - - if (!vequal(&straightPath[(straightPathSize-1)*3], portalApex)) - { - vcopy(&straightPath[straightPathSize*3], portalApex); - straightPathSize++; - if (straightPathSize >= maxStraightPathSize) - return straightPathSize; - } - - vcopy(portalLeft, portalApex); - vcopy(portalRight, portalApex); - leftIndex = apexIndex; - rightIndex = apexIndex; - - // Restart - i = apexIndex; - - continue; - } - } - } - } - } - - // Add end point. - vcopy(&straightPath[straightPathSize*3], closestEndPos); - straightPathSize++; - - return straightPathSize; -} - -// Returns portal points between two polygons. -bool dtTiledNavMesh::getPortalPoints(dtTilePolyRef from, dtTilePolyRef to, float* left, float* right) const -{ - unsigned int salt, it, ip; - dtDecodeTileId(from, salt, it, ip); - if (it >= DT_MAX_TILES) return false; - if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return false; - if (ip >= (unsigned int)m_tiles[it].header->npolys) return false; - const dtTileHeader* fromHeader = m_tiles[it].header; - const dtTilePoly* fromPoly = &fromHeader->polys[ip]; - - for (int i = 0; i < fromPoly->nlinks; ++i) - { - const dtTileLink* link = &fromHeader->links[fromPoly->links+i]; - if (link->ref == to) - { - // Find portal vertices. - const int v0 = fromPoly->v[link->e]; - const int v1 = fromPoly->v[(link->e+1) % fromPoly->nv]; - vcopy(left, &fromHeader->verts[v0*3]); - vcopy(right, &fromHeader->verts[v1*3]); - // If the link is at tile boundary, clamp the vertices to - // the link width. - if (link->side == 0 || link->side == 2) - { - // Unpack portal limits. - const float smin = min(left[2],right[2]); - const float smax = max(left[2],right[2]); - const float s = (smax-smin) / 255.0f; - const float lmin = smin + link->bmin*s; - const float lmax = smin + link->bmax*s; - left[2] = max(left[2],lmin); - left[2] = min(left[2],lmax); - right[2] = max(right[2],lmin); - right[2] = min(right[2],lmax); - } - else if (link->side == 1 || link->side == 3) - { - // Unpack portal limits. - const float smin = min(left[0],right[0]); - const float smax = max(left[0],right[0]); - const float s = (smax-smin) / 255.0f; - const float lmin = smin + link->bmin*s; - const float lmax = smin + link->bmax*s; - left[0] = max(left[0],lmin); - left[0] = min(left[0],lmax); - right[0] = max(right[0],lmin); - right[0] = min(right[0],lmax); - } - return true; - } - } - return false; -} - -// Returns edge mid point between two polygons. -bool dtTiledNavMesh::getEdgeMidPoint(dtTilePolyRef from, dtTilePolyRef to, float* mid) const -{ - float left[3], right[3]; - if (!getPortalPoints(from, to, left,right)) return false; - mid[0] = (left[0]+right[0])*0.5f; - mid[1] = (left[1]+right[1])*0.5f; - mid[2] = (left[2]+right[2])*0.5f; - return true; -} - -int dtTiledNavMesh::raycast(dtTilePolyRef centerRef, const float* startPos, const float* endPos, - float& t, dtTilePolyRef* path, const int pathSize) -{ - t = 0; - - if (!centerRef || !getPolyByRef(centerRef)) - return 0; - - dtTilePolyRef curRef = centerRef; - float verts[DT_TILE_VERTS_PER_POLYGON*3]; - int n = 0; - - while (curRef) - { - // Cast ray against current polygon. - - // The API input has been cheked already, skip checking internal data. - unsigned int salt, it, ip; - dtDecodeTileId(curRef, salt, it, ip); - const dtTileHeader* header = m_tiles[it].header; - const dtTilePoly* poly = &header->polys[ip]; - - // Collect vertices. - int nv = 0; - for (int i = 0; i < (int)poly->nv; ++i) - { - vcopy(&verts[nv*3], &header->verts[poly->v[i]*3]); - nv++; - } - if (nv < 3) - { - // Hit bad polygon, report hit. - return n; - } - - float tmin, tmax; - int segMin, segMax; - if (!intersectSegmentPoly2D(startPos, endPos, verts, nv, tmin, tmax, segMin, segMax)) - { - // Could not hit the polygon, keep the old t and report hit. - return n; - } - // Keep track of furthest t so far. - if (tmax > t) - t = tmax; - - if (n < pathSize) - path[n++] = curRef; - - // Follow neighbours. - dtTilePolyRef nextRef = 0; - for (int i = 0; i < poly->nlinks; ++i) - { - const dtTileLink* link = &header->links[poly->links+i]; - if ((int)link->e == segMax) - { - // If the link is internal, just return the ref. - if (link->side == 0xff) - { - nextRef = link->ref; - break; - } - - // If the link is at tile boundary, - const int v0 = poly->v[link->e]; - const int v1 = poly->v[(link->e+1) % poly->nv]; - const float* left = &header->verts[v0*3]; - const float* right = &header->verts[v1*3]; - - // Check that the intersection lies inside the link portal. - if (link->side == 0 || link->side == 2) - { - // Calculate link size. - const float smin = min(left[2],right[2]); - const float smax = max(left[2],right[2]); - const float s = (smax-smin) / 255.0f; - const float lmin = smin + link->bmin*s; - const float lmax = smin + link->bmax*s; - // Find Z intersection. - float z = startPos[2] + (endPos[2]-startPos[2])*tmax; - if (z >= lmin && z <= lmax) - { - nextRef = link->ref; - break; - } - } - else if (link->side == 1 || link->side == 3) - { - // Calculate link size. - const float smin = min(left[0],right[0]); - const float smax = max(left[0],right[0]); - const float s = (smax-smin) / 255.0f; - const float lmin = smin + link->bmin*s; - const float lmax = smin + link->bmax*s; - // Find X intersection. - float x = startPos[0] + (endPos[0]-startPos[0])*tmax; - if (x >= lmin && x <= lmax) - { - nextRef = link->ref; - break; - } - } - } - } - - if (!nextRef) - { - // No neighbour, we hit a wall. - return n; - } - - // No hit, advance to neighbour polygon. - curRef = nextRef; - } - - return n; -} - -int dtTiledNavMesh::findPolysAround(dtTilePolyRef centerRef, const float* centerPos, float radius, - dtTilePolyRef* resultRef, dtTilePolyRef* resultParent, float* resultCost, - const int maxResult) -{ - if (!centerRef) return 0; - if (!getPolyByRef(centerRef)) return 0; - if (!m_nodePool || !m_openList) return 0; - - m_nodePool->clear(); - m_openList->clear(); - - dtNode* startNode = m_nodePool->getNode(centerRef); - startNode->pidx = 0; - startNode->cost = 0; - startNode->total = 0; - startNode->id = centerRef; - startNode->flags = DT_NODE_OPEN; - m_openList->push(startNode); - - int n = 0; - if (n < maxResult) - { - if (resultRef) - resultRef[n] = startNode->id; - if (resultParent) - resultParent[n] = 0; - if (resultCost) - resultCost[n] = 0; - ++n; - } - - const float radiusSqr = sqr(radius); - - while (!m_openList->empty()) - { - dtNode* bestNode = m_openList->pop(); - - // Get poly and tile. - unsigned int salt, it, ip; - dtDecodeTileId(bestNode->id, salt, it, ip); - // The API input has been cheked already, skip checking internal data. - const dtTileHeader* header = m_tiles[it].header; - const dtTilePoly* poly = &header->polys[ip]; - - for (int i = 0; i < poly->nlinks; ++i) - { - const dtTileLink* link = &header->links[poly->links+i]; - dtTilePolyRef neighbour = link->ref; - if (neighbour) - { - // Skip parent node. - if (bestNode->pidx && m_nodePool->getNodeAtIdx(bestNode->pidx)->id == neighbour) - continue; - - // Calc distance to the edge. - const float* va = &header->verts[poly->v[link->e]*3]; - const float* vb = &header->verts[poly->v[(link->e+1)%poly->nv]*3]; - float tseg; - float distSqr = distancePtSegSqr2D(centerPos, va, vb, tseg); - - // If the circle is not touching the next polygon, skip it. - if (distSqr > radiusSqr) - continue; - - dtNode* parent = bestNode; - dtNode newNode; - newNode.pidx = m_nodePool->getNodeIdx(parent); - newNode.id = neighbour; - - // Cost - float p0[3], p1[3]; - if (!parent->pidx) - vcopy(p0, centerPos); - else - getEdgeMidPoint(m_nodePool->getNodeAtIdx(parent->pidx)->id, parent->id, p0); - getEdgeMidPoint(parent->id, newNode.id, p1); - newNode.total = parent->total + vdist(p0,p1); - - dtNode* actualNode = m_nodePool->getNode(newNode.id); - if (!actualNode) - continue; - - if (!((actualNode->flags & DT_NODE_OPEN) && newNode.total > actualNode->total) && - !((actualNode->flags & DT_NODE_CLOSED) && newNode.total > actualNode->total)) - { - actualNode->flags &= ~DT_NODE_CLOSED; - actualNode->pidx = newNode.pidx; - actualNode->total = newNode.total; - - if (actualNode->flags & DT_NODE_OPEN) - { - m_openList->modify(actualNode); - } - else - { - if (n < maxResult) - { - if (resultRef) - resultRef[n] = actualNode->id; - if (resultParent) - resultParent[n] = m_nodePool->getNodeAtIdx(actualNode->pidx)->id; - if (resultCost) - resultCost[n] = actualNode->total; - ++n; - } - actualNode->flags = DT_NODE_OPEN; - m_openList->push(actualNode); - } - } - } - } - } - - return n; -} - -float dtTiledNavMesh::findDistanceToWall(dtTilePolyRef centerRef, const float* centerPos, float maxRadius, - float* hitPos, float* hitNormal) -{ - if (!centerRef) return 0; - if (!getPolyByRef(centerRef)) return 0; - if (!m_nodePool || !m_openList) return 0; - - m_nodePool->clear(); - m_openList->clear(); - - dtNode* startNode = m_nodePool->getNode(centerRef); - startNode->pidx = 0; - startNode->cost = 0; - startNode->total = 0; - startNode->id = centerRef; - startNode->flags = DT_NODE_OPEN; - m_openList->push(startNode); - - float radiusSqr = sqr(maxRadius); - - while (!m_openList->empty()) - { - dtNode* bestNode = m_openList->pop(); - - // Get poly and tile. - unsigned int salt, it, ip; - dtDecodeTileId(bestNode->id, salt, it, ip); - // The API input has been cheked already, skip checking internal data. - const dtTileHeader* header = m_tiles[it].header; - const dtTilePoly* poly = &header->polys[ip]; - - // Hit test walls. - for (int i = 0, j = (int)poly->nv-1; i < (int)poly->nv; j = i++) - { - // Skip non-solid edges. - if (poly->n[j] & 0x8000) - { - // Tile border. - bool solid = true; - for (int i = 0; i < poly->nlinks; ++i) - { - const dtTileLink* link = &header->links[poly->links+i]; - if (link->e == j && link->ref != 0) - { - solid = false; - break; - } - } - if (!solid) continue; - } - else if (poly->n[j]) - { - // Internal edge - continue; - } - - // Calc distance to the edge. - const float* vj = &header->verts[poly->v[j]*3]; - const float* vi = &header->verts[poly->v[i]*3]; - float tseg; - float distSqr = distancePtSegSqr2D(centerPos, vj, vi, tseg); - - // Edge is too far, skip. - if (distSqr > radiusSqr) - continue; - - // Hit wall, update radius. - radiusSqr = distSqr; - // Calculate hit pos. - hitPos[0] = vj[0] + (vi[0] - vj[0])*tseg; - hitPos[1] = vj[1] + (vi[1] - vj[1])*tseg; - hitPos[2] = vj[2] + (vi[2] - vj[2])*tseg; - } - - for (int i = 0; i < poly->nlinks; ++i) - { - const dtTileLink* link = &header->links[poly->links+i]; - dtTilePolyRef neighbour = link->ref; - if (neighbour) - { - // Skip parent node. - if (bestNode->pidx && m_nodePool->getNodeAtIdx(bestNode->pidx)->id == neighbour) - continue; - - // Calc distance to the edge. - const float* va = &header->verts[poly->v[link->e]*3]; - const float* vb = &header->verts[poly->v[(link->e+1)%poly->nv]*3]; - float tseg; - float distSqr = distancePtSegSqr2D(centerPos, va, vb, tseg); - - // If the circle is not touching the next polygon, skip it. - if (distSqr > radiusSqr) - continue; - - dtNode* parent = bestNode; - dtNode newNode; - newNode.pidx = m_nodePool->getNodeIdx(parent); - newNode.id = neighbour; - - float p0[3], p1[3]; - if (!parent->pidx) - vcopy(p0, centerPos); - else - getEdgeMidPoint(m_nodePool->getNodeAtIdx(parent->pidx)->id, parent->id, p0); - getEdgeMidPoint(parent->id, newNode.id, p1); - newNode.total = parent->total + vdist(p0,p1); - - dtNode* actualNode = m_nodePool->getNode(newNode.id); - if (!actualNode) - continue; - - if (!((actualNode->flags & DT_NODE_OPEN) && newNode.total > actualNode->total) && - !((actualNode->flags & DT_NODE_CLOSED) && newNode.total > actualNode->total)) - { - actualNode->flags &= ~DT_NODE_CLOSED; - actualNode->pidx = newNode.pidx; - actualNode->total = newNode.total; - - if (actualNode->flags & DT_NODE_OPEN) - { - m_openList->modify(actualNode); - } - else - { - actualNode->flags = DT_NODE_OPEN; - m_openList->push(actualNode); - } - } - } - } - } - - // Calc hit normal. - vsub(hitNormal, centerPos, hitPos); - vnormalize(hitNormal); - - return sqrtf(radiusSqr); -} - -const dtTilePoly* dtTiledNavMesh::getPolyByRef(dtTilePolyRef ref) const -{ - unsigned int salt, it, ip; - dtDecodeTileId(ref, salt, it, ip); - if (it >= DT_MAX_TILES) return 0; - if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return 0; - if (ip >= (unsigned int)m_tiles[it].header->npolys) return 0; - return &m_tiles[it].header->polys[ip]; -} - -const float* dtTiledNavMesh::getPolyVertsByRef(dtTilePolyRef ref) const -{ - unsigned int salt, it, ip; - dtDecodeTileId(ref, salt, it, ip); - if (it >= DT_MAX_TILES) return 0; - if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return 0; - if (ip >= (unsigned int)m_tiles[it].header->npolys) return 0; - return m_tiles[it].header->verts; -} - -const dtTileLink* dtTiledNavMesh::getPolyLinksByRef(dtTilePolyRef ref) const -{ - unsigned int salt, it, ip; - dtDecodeTileId(ref, salt, it, ip); - if (it >= DT_MAX_TILES) return 0; - if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return 0; - if (ip >= (unsigned int)m_tiles[it].header->npolys) return 0; - return m_tiles[it].header->links; -} diff --git a/Detour/Source/DetourTileNavMeshBuilder.cpp b/Detour/Source/DetourTileNavMeshBuilder.cpp deleted file mode 100644 index 7010976..0000000 --- a/Detour/Source/DetourTileNavMeshBuilder.cpp +++ /dev/null @@ -1,215 +0,0 @@ -// -// Copyright (c) 2009 Mikko Mononen memon@inside.org -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. -// - -#include -#include -#include -#include -#include "DetourTileNavMesh.h" -#include "DetourCommon.h" - -bool dtCreateNavMeshTileData(const unsigned short* verts, const int nverts, - const unsigned short* polys, const int npolys, const int nvp, - const unsigned short* dmeshes, const float* dverts, const int ndverts, - const unsigned char* dtris, const int ndtris, - const float* bmin, const float* bmax, float cs, float ch, int tileSize, int walkableClimb, - unsigned char** outData, int* outDataSize) -{ - if (nvp != DT_TILE_VERTS_PER_POLYGON) - return false; - if (nverts >= 0xffff) - return false; - if (npolys > DT_MAX_TILES) - return false; - - if (!nverts) - return false; - if (!npolys) - return false; - if (!dmeshes || !dverts || ! dtris) - return false; - - // Find portal edges which are at tile borders. - int nedges = 0; - int nportals = 0; - for (int i = 0; i < npolys; ++i) - { - const unsigned short* p = &polys[i*2*nvp]; - for (int j = 0; j < nvp; ++j) - { - if (p[j] == 0xffff) break; - int nj = j+1; - if (nj >= nvp || p[nj] == 0xffff) nj = 0; - const unsigned short* va = &verts[p[j]*3]; - const unsigned short* vb = &verts[p[nj]*3]; - - nedges++; - - if (va[0] == tileSize && vb[0] == tileSize) - nportals++; // x+ - else if (va[2] == tileSize && vb[2] == tileSize) - nportals++; // z+ - else if (va[0] == 0 && vb[0] == 0) - nportals++; // x- - else if (va[2] == 0 && vb[2] == 0) - nportals++; // z- - } - } - - const int maxLinks = nedges + nportals*2; - - - // Find unique detail vertices. - int uniqueDetailVerts = 0; - if (dmeshes) - { - for (int i = 0; i < npolys; ++i) - { - const unsigned short* p = &polys[i*nvp*2]; - int ndv = dmeshes[i*4+1]; - int nv = 0; - for (int j = 0; j < nvp; ++j) - { - if (p[j] == 0xffff) break; - nv++; - } - ndv -= nv; - uniqueDetailVerts += ndv; - } - } - - // Calculate data size - const int headerSize = align4(sizeof(dtTileHeader)); - const int vertsSize = align4(sizeof(float)*3*nverts); - const int polysSize = align4(sizeof(dtTilePoly)*npolys); - const int linksSize = align4(sizeof(dtTileLink)*maxLinks); - const int detailMeshesSize = align4(sizeof(dtTilePolyDetail)*npolys); - const int detailVertsSize = align4(sizeof(float)*3*uniqueDetailVerts); - const int detailTrisSize = align4(sizeof(unsigned char)*4*ndtris); - - const int dataSize = headerSize + vertsSize + polysSize + linksSize + - detailMeshesSize + detailVertsSize + detailTrisSize; - unsigned char* data = new unsigned char[dataSize]; - if (!data) - return false; - memset(data, 0, dataSize); - - unsigned char* d = data; - dtTileHeader* header = (dtTileHeader*)d; d += headerSize; - float* navVerts = (float*)d; d += vertsSize; - dtTilePoly* navPolys = (dtTilePoly*)d; d += polysSize; - d += linksSize; - dtTilePolyDetail* navDMeshes = (dtTilePolyDetail*)d; d += detailMeshesSize; - float* navDVerts = (float*)d; d += detailVertsSize; - unsigned char* navDTris = (unsigned char*)d; d += detailTrisSize; - - - // Store header - header->magic = DT_TILE_NAVMESH_MAGIC; - header->version = DT_TILE_NAVMESH_VERSION; - header->npolys = npolys; - header->nverts = nverts; - header->maxlinks = maxLinks; - header->bmin[0] = bmin[0]; - header->bmin[1] = bmin[1]; - header->bmin[2] = bmin[2]; - header->bmax[0] = bmax[0]; - header->bmax[1] = bmax[1]; - header->bmax[2] = bmax[2]; - header->ndmeshes = npolys; - header->ndverts = uniqueDetailVerts; - header->ndtris = ndtris; - - // Store vertices - for (int i = 0; i < nverts; ++i) - { - const unsigned short* iv = &verts[i*3]; - float* v = &navVerts[i*3]; - v[0] = bmin[0] + iv[0] * cs; - v[1] = bmin[1] + iv[1] * ch; - v[2] = bmin[2] + iv[2] * cs; - } - - // Store polygons - const unsigned short* src = polys; - for (int i = 0; i < npolys; ++i) - { - dtTilePoly* p = &navPolys[i]; - p->nv = 0; - for (int j = 0; j < nvp; ++j) - { - if (src[j] == 0xffff) break; - p->v[j] = src[j]; - p->n[j] = (src[nvp+j]+1) & 0xffff; - p->nv++; - } - src += nvp*2; - } - - // Store portal edges. - for (int i = 0; i < npolys; ++i) - { - dtTilePoly* poly = &navPolys[i]; - for (int j = 0; j < poly->nv; ++j) - { - int nj = j+1; - if (nj >= poly->nv) nj = 0; - - const unsigned short* va = &verts[poly->v[j]*3]; - const unsigned short* vb = &verts[poly->v[nj]*3]; - - if (va[0] == tileSize && vb[0] == tileSize) // x+ - poly->n[j] = 0x8000 | 0; - else if (va[2] == tileSize && vb[2] == tileSize) // z+ - poly->n[j] = 0x8000 | 1; - else if (va[0] == 0 && vb[0] == 0) // x- - poly->n[j] = 0x8000 | 2; - else if (va[2] == 0 && vb[2] == 0) // z- - poly->n[j] = 0x8000 | 3; - } - } - - // Store detail meshes and vertices. - // The nav polygon vertices are stored as the first vertices on each mesh. - // We compress the mesh data by skipping them and using the navmesh coordinates. - unsigned short vbase = 0; - for (int i = 0; i < npolys; ++i) - { - dtTilePolyDetail& dtl = navDMeshes[i]; - const int vb = dmeshes[i*4+0]; - const int ndv = dmeshes[i*4+1]; - const int nv = navPolys[i].nv; - dtl.vbase = vbase; - dtl.nverts = ndv-nv; - dtl.tbase = dmeshes[i*4+2]; - dtl.ntris = dmeshes[i*4+3]; - // Copy vertices except the first 'nv' verts which are equal to nav poly verts. - if (ndv-nv) - { - memcpy(&navDVerts[vbase*3], &dverts[(vb+nv)*3], sizeof(float)*3*(ndv-nv)); - vbase += ndv-nv; - } - } - // Store triangles. - memcpy(navDTris, dtris, sizeof(unsigned char)*4*ndtris); - - *outData = data; - *outDataSize = dataSize; - - return true; -} diff --git a/RecastDemo/Bin/Recast.app/Contents/Info.plist b/RecastDemo/Bin/Recast.app/Contents/Info.plist index ae9e84b..a29bbdc 100644 --- a/RecastDemo/Bin/Recast.app/Contents/Info.plist +++ b/RecastDemo/Bin/Recast.app/Contents/Info.plist @@ -6,6 +6,8 @@ English CFBundleExecutable Recast + CFBundleIconFile + Icon.icns CFBundleIdentifier com.yourcompany.Recast CFBundleInfoDictionaryVersion diff --git a/RecastDemo/Bin/Recast.app/Contents/MacOS/Recast b/RecastDemo/Bin/Recast.app/Contents/MacOS/Recast index 80cfcfe..a94787b 100755 Binary files a/RecastDemo/Bin/Recast.app/Contents/MacOS/Recast and b/RecastDemo/Bin/Recast.app/Contents/MacOS/Recast differ diff --git a/RecastDemo/Bin/Recast.app/Contents/Resources/English.lproj/MainMenu.nib b/RecastDemo/Bin/Recast.app/Contents/Resources/English.lproj/MainMenu.nib index bc2fdd8..7518524 100644 Binary files a/RecastDemo/Bin/Recast.app/Contents/Resources/English.lproj/MainMenu.nib and b/RecastDemo/Bin/Recast.app/Contents/Resources/English.lproj/MainMenu.nib differ diff --git a/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.pbxuser b/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.pbxuser index 8633c87..ec757e2 100644 --- a/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.pbxuser +++ b/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.pbxuser @@ -16,7 +16,7 @@ 8D1107260486CEB800E47090 /* Recast */, ); breakpoints = ( - 6B0249B11003783F00CF7107 /* Sample_TileMesh.cpp:48 */, + 6B0249B11003783F00CF7107 /* Sample_TileMesh.cpp:27 */, 6B0249ED10037C0A00CF7107 /* DetourTileNavMesh.cpp:1 */, 6B0249EF10037C0C00CF7107 /* DetourTileNavMesh.cpp:1 */, 6B024AC01004AB3900CF7107 /* DetourTileNavMesh.cpp:1 */, @@ -118,8 +118,8 @@ PBXFileDataSource_Target_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 281522779; - PBXWorkspaceStateSaveDate = 281522779; + PBXPerProjectTemplateStateSaveDate = 281602357; + PBXWorkspaceStateSaveDate = 281602357; }; perUserProjectItems = { 6B3BFADF107A80E1006284CD = 6B3BFADF107A80E1006284CD /* PBXTextBookmark */; @@ -212,300 +212,307 @@ 6BA1E66A10C50A35008007F6 = 6BA1E66A10C50A35008007F6 /* PBXTextBookmark */; 6BA1E66B10C50A35008007F6 = 6BA1E66B10C50A35008007F6 /* PBXTextBookmark */; 6BA1E66C10C50A35008007F6 = 6BA1E66C10C50A35008007F6 /* PBXTextBookmark */; - 6BA1E7F210C7B3FF008007F6 /* PBXTextBookmark */ = 6BA1E7F210C7B3FF008007F6 /* PBXTextBookmark */; - 6BA1E7F310C7B3FF008007F6 /* PBXTextBookmark */ = 6BA1E7F310C7B3FF008007F6 /* PBXTextBookmark */; - 6BA1E7F410C7B3FF008007F6 /* PBXTextBookmark */ = 6BA1E7F410C7B3FF008007F6 /* PBXTextBookmark */; - 6BA1E7F510C7B3FF008007F6 /* PBXTextBookmark */ = 6BA1E7F510C7B3FF008007F6 /* PBXTextBookmark */; - 6BA1E7F610C7B3FF008007F6 /* PBXTextBookmark */ = 6BA1E7F610C7B3FF008007F6 /* PBXTextBookmark */; - 6BA1E7F710C7B3FF008007F6 /* PBXTextBookmark */ = 6BA1E7F710C7B3FF008007F6 /* PBXTextBookmark */; - 6BA1E7F810C7B3FF008007F6 /* PBXTextBookmark */ = 6BA1E7F810C7B3FF008007F6 /* PBXTextBookmark */; - 6BA1E7F910C7B3FF008007F6 /* PBXTextBookmark */ = 6BA1E7F910C7B3FF008007F6 /* PBXTextBookmark */; - 6BA1E7FA10C7B3FF008007F6 /* PBXTextBookmark */ = 6BA1E7FA10C7B3FF008007F6 /* PBXTextBookmark */; - 6BA1E7FB10C7B3FF008007F6 /* PBXTextBookmark */ = 6BA1E7FB10C7B3FF008007F6 /* PBXTextBookmark */; - 6BA1E7FC10C7B3FF008007F6 /* PBXTextBookmark */ = 6BA1E7FC10C7B3FF008007F6 /* PBXTextBookmark */; - 6BA1E7FD10C7B3FF008007F6 /* PBXTextBookmark */ = 6BA1E7FD10C7B3FF008007F6 /* PBXTextBookmark */; - 6BA1E7FE10C7B3FF008007F6 /* PBXTextBookmark */ = 6BA1E7FE10C7B3FF008007F6 /* PBXTextBookmark */; - 6BA1E7FF10C7B3FF008007F6 /* PBXTextBookmark */ = 6BA1E7FF10C7B3FF008007F6 /* PBXTextBookmark */; - 6BA1E80010C7B3FF008007F6 /* PBXTextBookmark */ = 6BA1E80010C7B3FF008007F6 /* PBXTextBookmark */; - 6BA1E80110C7B3FF008007F6 /* PBXTextBookmark */ = 6BA1E80110C7B3FF008007F6 /* PBXTextBookmark */; - 6BA1E80210C7B3FF008007F6 /* PBXTextBookmark */ = 6BA1E80210C7B3FF008007F6 /* PBXTextBookmark */; - 6BA1E80310C7B3FF008007F6 /* PBXTextBookmark */ = 6BA1E80310C7B3FF008007F6 /* PBXTextBookmark */; - 6BA1E81D10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E81D10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E81E10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E81E10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E81F10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E81F10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E82010C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E82010C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E82110C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E82110C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E82210C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E82210C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E82310C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E82310C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E82410C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E82410C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E82510C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E82510C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E82610C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E82610C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E82710C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E82710C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E82810C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E82810C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E82910C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E82910C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E82A10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E82A10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E82B10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E82B10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E82C10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E82C10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E82D10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E82D10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E82E10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E82E10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E82F10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E82F10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E83010C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E83010C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E83110C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E83110C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E83210C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E83210C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E83310C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E83310C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E83410C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E83410C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E83510C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E83510C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E83610C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E83610C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E83710C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E83710C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E83810C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E83810C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E83910C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E83910C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E83A10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E83A10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E83B10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E83B10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E83C10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E83C10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E83D10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E83D10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E83E10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E83E10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E83F10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E83F10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E84010C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E84010C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E84110C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E84110C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E84210C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E84210C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E84310C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E84310C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E84410C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E84410C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E84510C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E84510C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E84610C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E84610C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E84710C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E84710C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E84810C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E84810C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E84910C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E84910C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E84A10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E84A10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E84B10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E84B10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E84C10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E84C10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E84D10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E84D10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E84E10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E84E10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E84F10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E84F10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E85010C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E85010C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E85110C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E85110C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E85210C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E85210C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E85310C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E85310C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E85410C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E85410C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E85510C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E85510C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E85610C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E85610C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E85710C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E85710C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E85810C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E85810C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E85910C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E85910C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E85A10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E85A10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E85B10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E85B10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E85C10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E85C10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E85D10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E85D10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E85E10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E85E10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E85F10C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E85F10C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E86010C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E86010C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E86110C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E86110C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E86210C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E86210C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E86310C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E86310C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E86410C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E86410C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E86510C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E86510C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E86610C7BB85008007F6 /* PBXTextBookmark */ = 6BA1E86610C7BB85008007F6 /* PBXTextBookmark */; - 6BA1E86C10C7BCB8008007F6 /* PBXTextBookmark */ = 6BA1E86C10C7BCB8008007F6 /* PBXTextBookmark */; - 6BA1E86D10C7BCB8008007F6 /* PBXTextBookmark */ = 6BA1E86D10C7BCB8008007F6 /* PBXTextBookmark */; - 6BA1E86E10C7BCB8008007F6 /* PBXTextBookmark */ = 6BA1E86E10C7BCB8008007F6 /* PBXTextBookmark */; - 6BA1E86F10C7BCB8008007F6 /* PBXTextBookmark */ = 6BA1E86F10C7BCB8008007F6 /* PBXTextBookmark */; - 6BA1E87B10C7BD87008007F6 /* PBXTextBookmark */ = 6BA1E87B10C7BD87008007F6 /* PBXTextBookmark */; - 6BA1E87C10C7BD87008007F6 /* PBXTextBookmark */ = 6BA1E87C10C7BD87008007F6 /* PBXTextBookmark */; - 6BA1E87D10C7BD87008007F6 /* PBXTextBookmark */ = 6BA1E87D10C7BD87008007F6 /* PBXTextBookmark */; - 6BA1E87E10C7BD87008007F6 /* PBXTextBookmark */ = 6BA1E87E10C7BD87008007F6 /* PBXTextBookmark */; - 6BA1E87F10C7BD87008007F6 /* PBXTextBookmark */ = 6BA1E87F10C7BD87008007F6 /* PBXTextBookmark */; - 6BA1E88010C7BD87008007F6 /* PBXTextBookmark */ = 6BA1E88010C7BD87008007F6 /* PBXTextBookmark */; - 6BA1E88110C7BD87008007F6 /* PBXTextBookmark */ = 6BA1E88110C7BD87008007F6 /* PBXTextBookmark */; - 6BA1E88210C7BD87008007F6 /* PBXTextBookmark */ = 6BA1E88210C7BD87008007F6 /* PBXTextBookmark */; - 6BA1E88310C7BD87008007F6 /* PBXTextBookmark */ = 6BA1E88310C7BD87008007F6 /* PBXTextBookmark */; - 6BA1E89310C7C227008007F6 /* PBXTextBookmark */ = 6BA1E89310C7C227008007F6 /* PBXTextBookmark */; - 6BA1E89410C7C227008007F6 /* PBXTextBookmark */ = 6BA1E89410C7C227008007F6 /* PBXTextBookmark */; - 6BA1E89510C7C227008007F6 /* PBXTextBookmark */ = 6BA1E89510C7C227008007F6 /* PBXTextBookmark */; - 6BA1E89610C7C227008007F6 /* PBXTextBookmark */ = 6BA1E89610C7C227008007F6 /* PBXTextBookmark */; - 6BA1E89710C7C227008007F6 /* PBXTextBookmark */ = 6BA1E89710C7C227008007F6 /* PBXTextBookmark */; - 6BA1E89810C7C227008007F6 /* PBXTextBookmark */ = 6BA1E89810C7C227008007F6 /* PBXTextBookmark */; - 6BA1E89910C7C227008007F6 /* PBXTextBookmark */ = 6BA1E89910C7C227008007F6 /* PBXTextBookmark */; - 6BA1E89A10C7C227008007F6 /* PBXTextBookmark */ = 6BA1E89A10C7C227008007F6 /* PBXTextBookmark */; - 6BA1E89B10C7C227008007F6 /* PBXTextBookmark */ = 6BA1E89B10C7C227008007F6 /* PBXTextBookmark */; - 6BA1E89C10C7C227008007F6 /* PBXTextBookmark */ = 6BA1E89C10C7C227008007F6 /* PBXTextBookmark */; - 6BA1E89D10C7C227008007F6 /* PBXTextBookmark */ = 6BA1E89D10C7C227008007F6 /* PBXTextBookmark */; - 6BA1E89E10C7C227008007F6 /* PBXTextBookmark */ = 6BA1E89E10C7C227008007F6 /* PBXTextBookmark */; - 6BA1E89F10C7C227008007F6 /* PBXTextBookmark */ = 6BA1E89F10C7C227008007F6 /* PBXTextBookmark */; - 6BA1E8A010C7C227008007F6 /* PBXTextBookmark */ = 6BA1E8A010C7C227008007F6 /* PBXTextBookmark */; - 6BA1E8A110C7C227008007F6 /* PBXTextBookmark */ = 6BA1E8A110C7C227008007F6 /* PBXTextBookmark */; - 6BA1E8A210C7C227008007F6 /* PBXTextBookmark */ = 6BA1E8A210C7C227008007F6 /* PBXTextBookmark */; - 6BA1E8A310C7C227008007F6 /* PBXTextBookmark */ = 6BA1E8A310C7C227008007F6 /* PBXTextBookmark */; - 6BA1E8A410C7C227008007F6 /* PBXTextBookmark */ = 6BA1E8A410C7C227008007F6 /* PBXTextBookmark */; - 6BA1E8A510C7C227008007F6 /* PBXTextBookmark */ = 6BA1E8A510C7C227008007F6 /* PBXTextBookmark */; - 6BA1E8A610C7C227008007F6 /* PBXTextBookmark */ = 6BA1E8A610C7C227008007F6 /* PBXTextBookmark */; - 6BA1E8A710C7C227008007F6 /* PBXTextBookmark */ = 6BA1E8A710C7C227008007F6 /* PBXTextBookmark */; - 6BA1E8A810C7C227008007F6 /* PBXTextBookmark */ = 6BA1E8A810C7C227008007F6 /* PBXTextBookmark */; - 6BA1E8A910C7C227008007F6 /* PBXTextBookmark */ = 6BA1E8A910C7C227008007F6 /* PBXTextBookmark */; - 6BA1E8AA10C7C227008007F6 /* PBXTextBookmark */ = 6BA1E8AA10C7C227008007F6 /* PBXTextBookmark */; - 6BA1E8AB10C7C227008007F6 /* PBXTextBookmark */ = 6BA1E8AB10C7C227008007F6 /* PBXTextBookmark */; - 6BA1E8AC10C7C227008007F6 /* PBXTextBookmark */ = 6BA1E8AC10C7C227008007F6 /* PBXTextBookmark */; - 6BA1E8AD10C7C227008007F6 /* PBXTextBookmark */ = 6BA1E8AD10C7C227008007F6 /* PBXTextBookmark */; - 6BA1E8AE10C7C227008007F6 /* PBXTextBookmark */ = 6BA1E8AE10C7C227008007F6 /* PBXTextBookmark */; - 6BA1E8AF10C7C227008007F6 /* PBXTextBookmark */ = 6BA1E8AF10C7C227008007F6 /* PBXTextBookmark */; - 6BA1E8B010C7C5D1008007F6 /* PBXTextBookmark */ = 6BA1E8B010C7C5D1008007F6 /* PBXTextBookmark */; - 6BA1E8B110C7C5D1008007F6 /* PBXTextBookmark */ = 6BA1E8B110C7C5D1008007F6 /* PBXTextBookmark */; - 6BA1E8B210C7C5D1008007F6 /* PBXTextBookmark */ = 6BA1E8B210C7C5D1008007F6 /* PBXTextBookmark */; - 6BA1E8B310C7C5D1008007F6 /* PBXTextBookmark */ = 6BA1E8B310C7C5D1008007F6 /* PBXTextBookmark */; - 6BA1E8B410C7C5D1008007F6 /* PBXTextBookmark */ = 6BA1E8B410C7C5D1008007F6 /* PBXTextBookmark */; - 6BA1E8B510C7C5D1008007F6 /* PBXTextBookmark */ = 6BA1E8B510C7C5D1008007F6 /* PBXTextBookmark */; - 6BA1E8B610C7C5D1008007F6 /* PBXTextBookmark */ = 6BA1E8B610C7C5D1008007F6 /* PBXTextBookmark */; - 6BA1E8B710C7C5D1008007F6 /* PBXTextBookmark */ = 6BA1E8B710C7C5D1008007F6 /* PBXTextBookmark */; - 6BA1E8B810C7C5D1008007F6 /* PBXTextBookmark */ = 6BA1E8B810C7C5D1008007F6 /* PBXTextBookmark */; - 6BA1E8B910C7C5D1008007F6 /* PBXTextBookmark */ = 6BA1E8B910C7C5D1008007F6 /* PBXTextBookmark */; - 6BA1E8BA10C7C5D1008007F6 /* PBXTextBookmark */ = 6BA1E8BA10C7C5D1008007F6 /* PBXTextBookmark */; - 6BA1E8BB10C7C5D1008007F6 /* PBXTextBookmark */ = 6BA1E8BB10C7C5D1008007F6 /* PBXTextBookmark */; - 6BA1E8BC10C7C5D1008007F6 /* PBXTextBookmark */ = 6BA1E8BC10C7C5D1008007F6 /* PBXTextBookmark */; - 6BA1E8BD10C7C5D1008007F6 /* PBXTextBookmark */ = 6BA1E8BD10C7C5D1008007F6 /* PBXTextBookmark */; - 6BA1E8BE10C7C5D1008007F6 /* PBXTextBookmark */ = 6BA1E8BE10C7C5D1008007F6 /* PBXTextBookmark */; - 6BA1E8BF10C7C700008007F6 /* PBXTextBookmark */ = 6BA1E8BF10C7C700008007F6 /* PBXTextBookmark */; - 6BA1E8C010C7C700008007F6 /* PBXTextBookmark */ = 6BA1E8C010C7C700008007F6 /* PBXTextBookmark */; - 6BA1E8C110C7C700008007F6 /* PBXTextBookmark */ = 6BA1E8C110C7C700008007F6 /* PBXTextBookmark */; - 6BA1E8C210C7C700008007F6 /* PBXTextBookmark */ = 6BA1E8C210C7C700008007F6 /* PBXTextBookmark */; - 6BA1E8C310C7C700008007F6 /* PBXTextBookmark */ = 6BA1E8C310C7C700008007F6 /* PBXTextBookmark */; - 6BA1E8C410C7C700008007F6 /* PBXTextBookmark */ = 6BA1E8C410C7C700008007F6 /* PBXTextBookmark */; - 6BA1E8C510C7C700008007F6 /* PBXTextBookmark */ = 6BA1E8C510C7C700008007F6 /* PBXTextBookmark */; - 6BA1E8C610C7C700008007F6 /* PBXTextBookmark */ = 6BA1E8C610C7C700008007F6 /* PBXTextBookmark */; - 6BA1E8C710C7C700008007F6 /* PBXTextBookmark */ = 6BA1E8C710C7C700008007F6 /* PBXTextBookmark */; - 6BA1E8C810C7C700008007F6 /* PBXTextBookmark */ = 6BA1E8C810C7C700008007F6 /* PBXTextBookmark */; - 6BA1E8C910C7C700008007F6 /* PBXTextBookmark */ = 6BA1E8C910C7C700008007F6 /* PBXTextBookmark */; - 6BA1E8CA10C7C700008007F6 /* PBXTextBookmark */ = 6BA1E8CA10C7C700008007F6 /* PBXTextBookmark */; - 6BA1E8CB10C7C700008007F6 /* PBXTextBookmark */ = 6BA1E8CB10C7C700008007F6 /* PBXTextBookmark */; - 6BA1E8CC10C7C700008007F6 /* PBXTextBookmark */ = 6BA1E8CC10C7C700008007F6 /* PBXTextBookmark */; - 6BA1E8CD10C7C700008007F6 /* PBXTextBookmark */ = 6BA1E8CD10C7C700008007F6 /* PBXTextBookmark */; - 6BA1E8CE10C7C700008007F6 /* PBXTextBookmark */ = 6BA1E8CE10C7C700008007F6 /* PBXTextBookmark */; - 6BA1E8CF10C7C9A8008007F6 /* PBXTextBookmark */ = 6BA1E8CF10C7C9A8008007F6 /* PBXTextBookmark */; - 6BA1E8D010C7C9A8008007F6 /* PBXTextBookmark */ = 6BA1E8D010C7C9A8008007F6 /* PBXTextBookmark */; - 6BA1E8D110C7C9A8008007F6 /* PBXTextBookmark */ = 6BA1E8D110C7C9A8008007F6 /* PBXTextBookmark */; - 6BA1E8D210C7C9A8008007F6 /* PBXTextBookmark */ = 6BA1E8D210C7C9A8008007F6 /* PBXTextBookmark */; - 6BA1E8D310C7CB2E008007F6 /* PBXTextBookmark */ = 6BA1E8D310C7CB2E008007F6 /* PBXTextBookmark */; - 6BA1E8D410C7CB2E008007F6 /* PBXTextBookmark */ = 6BA1E8D410C7CB2E008007F6 /* PBXTextBookmark */; - 6BA1E8D510C7CB2E008007F6 /* PBXTextBookmark */ = 6BA1E8D510C7CB2E008007F6 /* PBXTextBookmark */; - 6BA1E8D610C7CB2E008007F6 /* PBXTextBookmark */ = 6BA1E8D610C7CB2E008007F6 /* PBXTextBookmark */; - 6BA1E8D710C7CB2E008007F6 /* PBXTextBookmark */ = 6BA1E8D710C7CB2E008007F6 /* PBXTextBookmark */; - 6BA1E8D810C7CB2E008007F6 /* PBXTextBookmark */ = 6BA1E8D810C7CB2E008007F6 /* PBXTextBookmark */; - 6BA1E8D910C7CB2E008007F6 /* PBXTextBookmark */ = 6BA1E8D910C7CB2E008007F6 /* PBXTextBookmark */; - 6BA1E8DA10C7CB2E008007F6 /* PBXTextBookmark */ = 6BA1E8DA10C7CB2E008007F6 /* PBXTextBookmark */; - 6BA1E8DB10C7CB62008007F6 /* PBXTextBookmark */ = 6BA1E8DB10C7CB62008007F6 /* PBXTextBookmark */; - 6BA1E8DC10C7CB62008007F6 /* PBXTextBookmark */ = 6BA1E8DC10C7CB62008007F6 /* PBXTextBookmark */; - 6BA1E8DD10C7CB62008007F6 /* PBXTextBookmark */ = 6BA1E8DD10C7CB62008007F6 /* PBXTextBookmark */; - 6BA1E8DE10C7CB62008007F6 /* PBXTextBookmark */ = 6BA1E8DE10C7CB62008007F6 /* PBXTextBookmark */; - 6BA1E8E310C7D2FA008007F6 /* PBXTextBookmark */ = 6BA1E8E310C7D2FA008007F6 /* PBXTextBookmark */; - 6BA1E8E410C7D2FA008007F6 /* PBXTextBookmark */ = 6BA1E8E410C7D2FA008007F6 /* PBXTextBookmark */; - 6BA1E8E510C7D2FA008007F6 /* PBXTextBookmark */ = 6BA1E8E510C7D2FA008007F6 /* PBXTextBookmark */; - 6BA1E8E610C7D2FA008007F6 /* PBXTextBookmark */ = 6BA1E8E610C7D2FA008007F6 /* PBXTextBookmark */; - 6BA1E8E710C7D2FA008007F6 /* PBXTextBookmark */ = 6BA1E8E710C7D2FA008007F6 /* PBXTextBookmark */; - 6BA1E8E810C7D2FA008007F6 /* PBXTextBookmark */ = 6BA1E8E810C7D2FA008007F6 /* PBXTextBookmark */; - 6BA1E8E910C7D2FA008007F6 /* PBXTextBookmark */ = 6BA1E8E910C7D2FA008007F6 /* PBXTextBookmark */; - 6BA1E8EA10C7D2FA008007F6 /* PBXTextBookmark */ = 6BA1E8EA10C7D2FA008007F6 /* PBXTextBookmark */; - 6BA1E8EB10C7D2FA008007F6 /* PBXTextBookmark */ = 6BA1E8EB10C7D2FA008007F6 /* PBXTextBookmark */; - 6BA1E8EC10C7D2FA008007F6 /* PBXTextBookmark */ = 6BA1E8EC10C7D2FA008007F6 /* PBXTextBookmark */; - 6BA1E8ED10C7D2FA008007F6 /* PBXTextBookmark */ = 6BA1E8ED10C7D2FA008007F6 /* PBXTextBookmark */; - 6BA1E8EE10C7D2FA008007F6 /* PBXTextBookmark */ = 6BA1E8EE10C7D2FA008007F6 /* PBXTextBookmark */; - 6BA1E8EF10C7D2FA008007F6 /* PBXTextBookmark */ = 6BA1E8EF10C7D2FA008007F6 /* PBXTextBookmark */; - 6BA1E8F010C7D4D9008007F6 /* PBXTextBookmark */ = 6BA1E8F010C7D4D9008007F6 /* PBXTextBookmark */; - 6BA1E8F110C7D4D9008007F6 /* PBXTextBookmark */ = 6BA1E8F110C7D4D9008007F6 /* PBXTextBookmark */; - 6BA1E8F210C7D4D9008007F6 /* PBXTextBookmark */ = 6BA1E8F210C7D4D9008007F6 /* PBXTextBookmark */; - 6BA1E8F310C7D4D9008007F6 /* PBXTextBookmark */ = 6BA1E8F310C7D4D9008007F6 /* PBXTextBookmark */; - 6BA1E8F410C7D4D9008007F6 /* PBXTextBookmark */ = 6BA1E8F410C7D4D9008007F6 /* PBXTextBookmark */; - 6BA1E8F510C7D4D9008007F6 /* PBXTextBookmark */ = 6BA1E8F510C7D4D9008007F6 /* PBXTextBookmark */; - 6BA1E8F610C7D4D9008007F6 /* PBXTextBookmark */ = 6BA1E8F610C7D4D9008007F6 /* PBXTextBookmark */; - 6BA1E8F710C7D4D9008007F6 /* PBXTextBookmark */ = 6BA1E8F710C7D4D9008007F6 /* PBXTextBookmark */; - 6BA1E8F810C7D4D9008007F6 /* PBXTextBookmark */ = 6BA1E8F810C7D4D9008007F6 /* PBXTextBookmark */; - 6BA1E8F910C7D4D9008007F6 /* PBXTextBookmark */ = 6BA1E8F910C7D4D9008007F6 /* PBXTextBookmark */; - 6BA1E8FA10C7D4D9008007F6 /* PBXTextBookmark */ = 6BA1E8FA10C7D4D9008007F6 /* PBXTextBookmark */; - 6BA1E8FB10C7D4D9008007F6 /* PBXTextBookmark */ = 6BA1E8FB10C7D4D9008007F6 /* PBXTextBookmark */; - 6BA1E90210C7D850008007F6 /* PBXTextBookmark */ = 6BA1E90210C7D850008007F6 /* PBXTextBookmark */; - 6BA1E90310C7D850008007F6 /* PBXTextBookmark */ = 6BA1E90310C7D850008007F6 /* PBXTextBookmark */; - 6BA1E90410C7D850008007F6 /* PBXTextBookmark */ = 6BA1E90410C7D850008007F6 /* PBXTextBookmark */; - 6BA1E90510C7D850008007F6 /* PBXTextBookmark */ = 6BA1E90510C7D850008007F6 /* PBXTextBookmark */; - 6BA1E90610C7D850008007F6 /* PBXTextBookmark */ = 6BA1E90610C7D850008007F6 /* PBXTextBookmark */; - 6BA1E90710C7D850008007F6 /* PBXTextBookmark */ = 6BA1E90710C7D850008007F6 /* PBXTextBookmark */; - 6BA1E90810C7D850008007F6 /* PBXTextBookmark */ = 6BA1E90810C7D850008007F6 /* PBXTextBookmark */; - 6BA1E90910C7D850008007F6 /* PBXTextBookmark */ = 6BA1E90910C7D850008007F6 /* PBXTextBookmark */; - 6BA1E90A10C7D850008007F6 /* PBXTextBookmark */ = 6BA1E90A10C7D850008007F6 /* PBXTextBookmark */; - 6BA1E90B10C7D850008007F6 /* PBXTextBookmark */ = 6BA1E90B10C7D850008007F6 /* PBXTextBookmark */; - 6BA1E90C10C7D850008007F6 /* PBXTextBookmark */ = 6BA1E90C10C7D850008007F6 /* PBXTextBookmark */; - 6BA1E90D10C7D850008007F6 /* PBXTextBookmark */ = 6BA1E90D10C7D850008007F6 /* PBXTextBookmark */; - 6BA1E90E10C7D850008007F6 /* PBXTextBookmark */ = 6BA1E90E10C7D850008007F6 /* PBXTextBookmark */; - 6BA1E90F10C7D850008007F6 /* PBXTextBookmark */ = 6BA1E90F10C7D850008007F6 /* PBXTextBookmark */; - 6BA1E91210C7D8A9008007F6 /* PBXTextBookmark */ = 6BA1E91210C7D8A9008007F6 /* PBXTextBookmark */; - 6BA1E91310C7D8A9008007F6 /* PBXTextBookmark */ = 6BA1E91310C7D8A9008007F6 /* PBXTextBookmark */; - 6BA1E91410C7D8A9008007F6 /* PBXTextBookmark */ = 6BA1E91410C7D8A9008007F6 /* PBXTextBookmark */; - 6BA1E91510C7D8A9008007F6 /* PBXTextBookmark */ = 6BA1E91510C7D8A9008007F6 /* PBXTextBookmark */; - 6BA1E91610C7D8A9008007F6 /* PBXTextBookmark */ = 6BA1E91610C7D8A9008007F6 /* PBXTextBookmark */; - 6BA1E91710C7D8A9008007F6 /* PBXTextBookmark */ = 6BA1E91710C7D8A9008007F6 /* PBXTextBookmark */; - 6BA1E91C10C7D966008007F6 /* PBXTextBookmark */ = 6BA1E91C10C7D966008007F6 /* PBXTextBookmark */; - 6BA1E91F10C7D999008007F6 /* PBXTextBookmark */ = 6BA1E91F10C7D999008007F6 /* PBXTextBookmark */; - 6BA1E92510C7D9E8008007F6 /* PBXTextBookmark */ = 6BA1E92510C7D9E8008007F6 /* PBXTextBookmark */; - 6BA1E92B10C7DAA1008007F6 /* PBXTextBookmark */ = 6BA1E92B10C7DAA1008007F6 /* PBXTextBookmark */; - 6BA1E92C10C7DAA1008007F6 /* PBXTextBookmark */ = 6BA1E92C10C7DAA1008007F6 /* PBXTextBookmark */; - 6BA1E92D10C7DAA1008007F6 /* PBXTextBookmark */ = 6BA1E92D10C7DAA1008007F6 /* PBXTextBookmark */; - 6BA1E92E10C7DAA1008007F6 /* PBXTextBookmark */ = 6BA1E92E10C7DAA1008007F6 /* PBXTextBookmark */; - 6BA1E92F10C7DAA1008007F6 /* PBXTextBookmark */ = 6BA1E92F10C7DAA1008007F6 /* PBXTextBookmark */; - 6BA1E93010C7DAA1008007F6 /* PBXTextBookmark */ = 6BA1E93010C7DAA1008007F6 /* PBXTextBookmark */; - 6BA1E93110C7DAA1008007F6 /* PBXTextBookmark */ = 6BA1E93110C7DAA1008007F6 /* PBXTextBookmark */; - 6BA1E93710C7DB10008007F6 /* PBXTextBookmark */ = 6BA1E93710C7DB10008007F6 /* PBXTextBookmark */; - 6BA1E93810C7DB10008007F6 /* PBXTextBookmark */ = 6BA1E93810C7DB10008007F6 /* PBXTextBookmark */; - 6BA1E93910C7DB10008007F6 /* PBXTextBookmark */ = 6BA1E93910C7DB10008007F6 /* PBXTextBookmark */; - 6BA1E93A10C7DB10008007F6 /* PBXTextBookmark */ = 6BA1E93A10C7DB10008007F6 /* PBXTextBookmark */; - 6BA1E93B10C7DB10008007F6 /* PBXTextBookmark */ = 6BA1E93B10C7DB10008007F6 /* PBXTextBookmark */; - 6BA1E93F10C7DB2F008007F6 /* PBXTextBookmark */ = 6BA1E93F10C7DB2F008007F6 /* PBXTextBookmark */; - 6BA1E94010C7DB2F008007F6 /* PBXTextBookmark */ = 6BA1E94010C7DB2F008007F6 /* PBXTextBookmark */; - 6BA1E94110C7DB2F008007F6 /* PBXTextBookmark */ = 6BA1E94110C7DB2F008007F6 /* PBXTextBookmark */; - 6BA1E94210C7DB2F008007F6 /* PBXTextBookmark */ = 6BA1E94210C7DB2F008007F6 /* PBXTextBookmark */; - 6BA1E94410C7DB45008007F6 /* PBXTextBookmark */ = 6BA1E94410C7DB45008007F6 /* PBXTextBookmark */; - 6BA1E94510C7DB45008007F6 /* PBXTextBookmark */ = 6BA1E94510C7DB45008007F6 /* PBXTextBookmark */; - 6BA1E94610C7DB45008007F6 /* PBXTextBookmark */ = 6BA1E94610C7DB45008007F6 /* PBXTextBookmark */; - 6BA1E94710C7DB45008007F6 /* PBXTextBookmark */ = 6BA1E94710C7DB45008007F6 /* PBXTextBookmark */; - 6BA1E94910C7DB51008007F6 /* PBXTextBookmark */ = 6BA1E94910C7DB51008007F6 /* PBXTextBookmark */; - 6BA1E94A10C7DB51008007F6 /* PBXTextBookmark */ = 6BA1E94A10C7DB51008007F6 /* PBXTextBookmark */; - 6BA1E94B10C7DB51008007F6 /* PBXTextBookmark */ = 6BA1E94B10C7DB51008007F6 /* PBXTextBookmark */; - 6BA1E94C10C7DB51008007F6 /* PBXTextBookmark */ = 6BA1E94C10C7DB51008007F6 /* PBXTextBookmark */; - 6BA1E94E10C7DB5C008007F6 /* PBXTextBookmark */ = 6BA1E94E10C7DB5C008007F6 /* PBXTextBookmark */; - 6BA1E95110C7DBC6008007F6 /* PBXTextBookmark */ = 6BA1E95110C7DBC6008007F6 /* PBXTextBookmark */; - 6BA1E95C10C7DBF9008007F6 /* PBXTextBookmark */ = 6BA1E95C10C7DBF9008007F6 /* PBXTextBookmark */; - 6BA1E96310C7DC15008007F6 /* PBXTextBookmark */ = 6BA1E96310C7DC15008007F6 /* PBXTextBookmark */; - 6BA1E96910C7DCD1008007F6 /* PBXTextBookmark */ = 6BA1E96910C7DCD1008007F6 /* PBXTextBookmark */; - 6BA1E96D10C7DDD6008007F6 /* PBXTextBookmark */ = 6BA1E96D10C7DDD6008007F6 /* PBXTextBookmark */; - 6BA1E96E10C7DDD6008007F6 /* PBXTextBookmark */ = 6BA1E96E10C7DDD6008007F6 /* PBXTextBookmark */; - 6BA1E96F10C7DDD6008007F6 /* PBXTextBookmark */ = 6BA1E96F10C7DDD6008007F6 /* PBXTextBookmark */; - 6BA1E97010C7DDD6008007F6 /* PBXTextBookmark */ = 6BA1E97010C7DDD6008007F6 /* PBXTextBookmark */; - 6BA1E97110C7DDD6008007F6 /* PBXTextBookmark */ = 6BA1E97110C7DDD6008007F6 /* PBXTextBookmark */; - 6BA1E97410C7DF1F008007F6 /* PBXTextBookmark */ = 6BA1E97410C7DF1F008007F6 /* PBXTextBookmark */; - 6BA1E97510C7DF1F008007F6 /* PBXTextBookmark */ = 6BA1E97510C7DF1F008007F6 /* PBXTextBookmark */; - 6BA1E97610C7DF1F008007F6 /* PBXTextBookmark */ = 6BA1E97610C7DF1F008007F6 /* PBXTextBookmark */; - 6BA1E97710C7DF1F008007F6 /* PBXTextBookmark */ = 6BA1E97710C7DF1F008007F6 /* PBXTextBookmark */; - 6BA1E97810C7DF1F008007F6 /* PBXTextBookmark */ = 6BA1E97810C7DF1F008007F6 /* PBXTextBookmark */; - 6BA1E97910C7DF1F008007F6 /* PBXTextBookmark */ = 6BA1E97910C7DF1F008007F6 /* PBXTextBookmark */; - 6BA1E97A10C7DF1F008007F6 /* PBXTextBookmark */ = 6BA1E97A10C7DF1F008007F6 /* PBXTextBookmark */; - 6BA1E97B10C7DF1F008007F6 /* PBXTextBookmark */ = 6BA1E97B10C7DF1F008007F6 /* PBXTextBookmark */; - 6BA1E97E10C7DF98008007F6 /* PBXTextBookmark */ = 6BA1E97E10C7DF98008007F6 /* PBXTextBookmark */; - 6BA1E98010C7DFEF008007F6 /* PBXTextBookmark */ = 6BA1E98010C7DFEF008007F6 /* PBXTextBookmark */; - 6BA1E98310C7E0B7008007F6 /* PBXTextBookmark */ = 6BA1E98310C7E0B7008007F6 /* PBXTextBookmark */; - 6BA1E98410C7E0BF008007F6 /* PBXTextBookmark */ = 6BA1E98410C7E0BF008007F6 /* PBXTextBookmark */; - 6BA1E98610C7E0E8008007F6 /* PBXTextBookmark */ = 6BA1E98610C7E0E8008007F6 /* PBXTextBookmark */; - 6BA1E98810C7E178008007F6 /* PBXTextBookmark */ = 6BA1E98810C7E178008007F6 /* PBXTextBookmark */; - 6BA1E98D10C7EAC3008007F6 /* PBXTextBookmark */ = 6BA1E98D10C7EAC3008007F6 /* PBXTextBookmark */; - 6BA1E98E10C7EAC3008007F6 /* PBXTextBookmark */ = 6BA1E98E10C7EAC3008007F6 /* PBXTextBookmark */; - 6BA1E98F10C7EAC3008007F6 /* PBXTextBookmark */ = 6BA1E98F10C7EAC3008007F6 /* PBXTextBookmark */; - 6BA1E99010C7EAC3008007F6 /* PBXTextBookmark */ = 6BA1E99010C7EAC3008007F6 /* PBXTextBookmark */; - 6BA1E99110C7EAC3008007F6 /* PBXTextBookmark */ = 6BA1E99110C7EAC3008007F6 /* PBXTextBookmark */; - 6BA1E99310C7EAEF008007F6 /* PBXTextBookmark */ = 6BA1E99310C7EAEF008007F6 /* PBXTextBookmark */; - 6BA1E99510C7EB05008007F6 /* PBXTextBookmark */ = 6BA1E99510C7EB05008007F6 /* PBXTextBookmark */; - 6BA1E99810C7EB71008007F6 /* PBXTextBookmark */ = 6BA1E99810C7EB71008007F6 /* PBXTextBookmark */; - 6BA1E99B10C7EBB0008007F6 /* PBXTextBookmark */ = 6BA1E99B10C7EBB0008007F6 /* PBXTextBookmark */; - 6BA1E99D10C7EC0F008007F6 /* PBXTextBookmark */ = 6BA1E99D10C7EC0F008007F6 /* PBXTextBookmark */; - 6BA1E99F10C7EC3F008007F6 /* PBXTextBookmark */ = 6BA1E99F10C7EC3F008007F6 /* PBXTextBookmark */; - 6BA1E9A110C7EC47008007F6 /* PBXTextBookmark */ = 6BA1E9A110C7EC47008007F6 /* PBXTextBookmark */; - 6BA1E9A310C7EC77008007F6 /* PBXTextBookmark */ = 6BA1E9A310C7EC77008007F6 /* PBXTextBookmark */; - 6BA1E9A510C7EC93008007F6 /* PBXTextBookmark */ = 6BA1E9A510C7EC93008007F6 /* PBXTextBookmark */; - 6BA1E9A710C7ECFF008007F6 /* PBXTextBookmark */ = 6BA1E9A710C7ECFF008007F6 /* PBXTextBookmark */; - 6BA1E9A910C7ED0B008007F6 /* PBXTextBookmark */ = 6BA1E9A910C7ED0B008007F6 /* PBXTextBookmark */; - 6BA1E9AB10C7F12E008007F6 /* PBXTextBookmark */ = 6BA1E9AB10C7F12E008007F6 /* PBXTextBookmark */; + 6BA1E7F210C7B3FF008007F6 = 6BA1E7F210C7B3FF008007F6 /* PBXTextBookmark */; + 6BA1E7F310C7B3FF008007F6 = 6BA1E7F310C7B3FF008007F6 /* PBXTextBookmark */; + 6BA1E7F410C7B3FF008007F6 = 6BA1E7F410C7B3FF008007F6 /* PBXTextBookmark */; + 6BA1E7F510C7B3FF008007F6 = 6BA1E7F510C7B3FF008007F6 /* PBXTextBookmark */; + 6BA1E7F610C7B3FF008007F6 = 6BA1E7F610C7B3FF008007F6 /* PBXTextBookmark */; + 6BA1E7F710C7B3FF008007F6 = 6BA1E7F710C7B3FF008007F6 /* PBXTextBookmark */; + 6BA1E7F810C7B3FF008007F6 = 6BA1E7F810C7B3FF008007F6 /* PBXTextBookmark */; + 6BA1E7F910C7B3FF008007F6 = 6BA1E7F910C7B3FF008007F6 /* PBXTextBookmark */; + 6BA1E7FA10C7B3FF008007F6 = 6BA1E7FA10C7B3FF008007F6 /* PBXTextBookmark */; + 6BA1E7FB10C7B3FF008007F6 = 6BA1E7FB10C7B3FF008007F6 /* PBXTextBookmark */; + 6BA1E7FC10C7B3FF008007F6 = 6BA1E7FC10C7B3FF008007F6 /* PBXTextBookmark */; + 6BA1E7FD10C7B3FF008007F6 = 6BA1E7FD10C7B3FF008007F6 /* PBXTextBookmark */; + 6BA1E7FE10C7B3FF008007F6 = 6BA1E7FE10C7B3FF008007F6 /* PBXTextBookmark */; + 6BA1E7FF10C7B3FF008007F6 = 6BA1E7FF10C7B3FF008007F6 /* PBXTextBookmark */; + 6BA1E80010C7B3FF008007F6 = 6BA1E80010C7B3FF008007F6 /* PBXTextBookmark */; + 6BA1E80110C7B3FF008007F6 = 6BA1E80110C7B3FF008007F6 /* PBXTextBookmark */; + 6BA1E80210C7B3FF008007F6 = 6BA1E80210C7B3FF008007F6 /* PBXTextBookmark */; + 6BA1E80310C7B3FF008007F6 = 6BA1E80310C7B3FF008007F6 /* PBXTextBookmark */; + 6BA1E81D10C7BB85008007F6 = 6BA1E81D10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E81E10C7BB85008007F6 = 6BA1E81E10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E81F10C7BB85008007F6 = 6BA1E81F10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E82010C7BB85008007F6 = 6BA1E82010C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E82110C7BB85008007F6 = 6BA1E82110C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E82210C7BB85008007F6 = 6BA1E82210C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E82310C7BB85008007F6 = 6BA1E82310C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E82410C7BB85008007F6 = 6BA1E82410C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E82510C7BB85008007F6 = 6BA1E82510C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E82610C7BB85008007F6 = 6BA1E82610C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E82710C7BB85008007F6 = 6BA1E82710C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E82810C7BB85008007F6 = 6BA1E82810C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E82910C7BB85008007F6 = 6BA1E82910C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E82A10C7BB85008007F6 = 6BA1E82A10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E82B10C7BB85008007F6 = 6BA1E82B10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E82C10C7BB85008007F6 = 6BA1E82C10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E82D10C7BB85008007F6 = 6BA1E82D10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E82E10C7BB85008007F6 = 6BA1E82E10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E82F10C7BB85008007F6 = 6BA1E82F10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E83010C7BB85008007F6 = 6BA1E83010C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E83110C7BB85008007F6 = 6BA1E83110C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E83210C7BB85008007F6 = 6BA1E83210C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E83310C7BB85008007F6 = 6BA1E83310C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E83410C7BB85008007F6 = 6BA1E83410C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E83510C7BB85008007F6 = 6BA1E83510C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E83610C7BB85008007F6 = 6BA1E83610C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E83710C7BB85008007F6 = 6BA1E83710C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E83810C7BB85008007F6 = 6BA1E83810C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E83910C7BB85008007F6 = 6BA1E83910C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E83A10C7BB85008007F6 = 6BA1E83A10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E83B10C7BB85008007F6 = 6BA1E83B10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E83C10C7BB85008007F6 = 6BA1E83C10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E83D10C7BB85008007F6 = 6BA1E83D10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E83E10C7BB85008007F6 = 6BA1E83E10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E83F10C7BB85008007F6 = 6BA1E83F10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E84010C7BB85008007F6 = 6BA1E84010C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E84110C7BB85008007F6 = 6BA1E84110C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E84210C7BB85008007F6 = 6BA1E84210C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E84310C7BB85008007F6 = 6BA1E84310C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E84410C7BB85008007F6 = 6BA1E84410C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E84510C7BB85008007F6 = 6BA1E84510C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E84610C7BB85008007F6 = 6BA1E84610C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E84710C7BB85008007F6 = 6BA1E84710C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E84810C7BB85008007F6 = 6BA1E84810C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E84910C7BB85008007F6 = 6BA1E84910C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E84A10C7BB85008007F6 = 6BA1E84A10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E84B10C7BB85008007F6 = 6BA1E84B10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E84C10C7BB85008007F6 = 6BA1E84C10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E84D10C7BB85008007F6 = 6BA1E84D10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E84E10C7BB85008007F6 = 6BA1E84E10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E84F10C7BB85008007F6 = 6BA1E84F10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E85010C7BB85008007F6 = 6BA1E85010C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E85110C7BB85008007F6 = 6BA1E85110C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E85210C7BB85008007F6 = 6BA1E85210C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E85310C7BB85008007F6 = 6BA1E85310C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E85410C7BB85008007F6 = 6BA1E85410C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E85510C7BB85008007F6 = 6BA1E85510C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E85610C7BB85008007F6 = 6BA1E85610C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E85710C7BB85008007F6 = 6BA1E85710C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E85810C7BB85008007F6 = 6BA1E85810C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E85910C7BB85008007F6 = 6BA1E85910C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E85A10C7BB85008007F6 = 6BA1E85A10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E85B10C7BB85008007F6 = 6BA1E85B10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E85C10C7BB85008007F6 = 6BA1E85C10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E85D10C7BB85008007F6 = 6BA1E85D10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E85E10C7BB85008007F6 = 6BA1E85E10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E85F10C7BB85008007F6 = 6BA1E85F10C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E86010C7BB85008007F6 = 6BA1E86010C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E86110C7BB85008007F6 = 6BA1E86110C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E86210C7BB85008007F6 = 6BA1E86210C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E86310C7BB85008007F6 = 6BA1E86310C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E86410C7BB85008007F6 = 6BA1E86410C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E86510C7BB85008007F6 = 6BA1E86510C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E86610C7BB85008007F6 = 6BA1E86610C7BB85008007F6 /* PBXTextBookmark */; + 6BA1E86C10C7BCB8008007F6 = 6BA1E86C10C7BCB8008007F6 /* PBXTextBookmark */; + 6BA1E86D10C7BCB8008007F6 = 6BA1E86D10C7BCB8008007F6 /* PBXTextBookmark */; + 6BA1E86E10C7BCB8008007F6 = 6BA1E86E10C7BCB8008007F6 /* PBXTextBookmark */; + 6BA1E86F10C7BCB8008007F6 = 6BA1E86F10C7BCB8008007F6 /* PBXTextBookmark */; + 6BA1E87B10C7BD87008007F6 = 6BA1E87B10C7BD87008007F6 /* PBXTextBookmark */; + 6BA1E87C10C7BD87008007F6 = 6BA1E87C10C7BD87008007F6 /* PBXTextBookmark */; + 6BA1E87D10C7BD87008007F6 = 6BA1E87D10C7BD87008007F6 /* PBXTextBookmark */; + 6BA1E87E10C7BD87008007F6 = 6BA1E87E10C7BD87008007F6 /* PBXTextBookmark */; + 6BA1E87F10C7BD87008007F6 = 6BA1E87F10C7BD87008007F6 /* PBXTextBookmark */; + 6BA1E88010C7BD87008007F6 = 6BA1E88010C7BD87008007F6 /* PBXTextBookmark */; + 6BA1E88110C7BD87008007F6 = 6BA1E88110C7BD87008007F6 /* PBXTextBookmark */; + 6BA1E88210C7BD87008007F6 = 6BA1E88210C7BD87008007F6 /* PBXTextBookmark */; + 6BA1E88310C7BD87008007F6 = 6BA1E88310C7BD87008007F6 /* PBXTextBookmark */; + 6BA1E89310C7C227008007F6 = 6BA1E89310C7C227008007F6 /* PBXTextBookmark */; + 6BA1E89410C7C227008007F6 = 6BA1E89410C7C227008007F6 /* PBXTextBookmark */; + 6BA1E89510C7C227008007F6 = 6BA1E89510C7C227008007F6 /* PBXTextBookmark */; + 6BA1E89610C7C227008007F6 = 6BA1E89610C7C227008007F6 /* PBXTextBookmark */; + 6BA1E89710C7C227008007F6 = 6BA1E89710C7C227008007F6 /* PBXTextBookmark */; + 6BA1E89810C7C227008007F6 = 6BA1E89810C7C227008007F6 /* PBXTextBookmark */; + 6BA1E89910C7C227008007F6 = 6BA1E89910C7C227008007F6 /* PBXTextBookmark */; + 6BA1E89A10C7C227008007F6 = 6BA1E89A10C7C227008007F6 /* PBXTextBookmark */; + 6BA1E89B10C7C227008007F6 = 6BA1E89B10C7C227008007F6 /* PBXTextBookmark */; + 6BA1E89C10C7C227008007F6 = 6BA1E89C10C7C227008007F6 /* PBXTextBookmark */; + 6BA1E89D10C7C227008007F6 = 6BA1E89D10C7C227008007F6 /* PBXTextBookmark */; + 6BA1E89E10C7C227008007F6 = 6BA1E89E10C7C227008007F6 /* PBXTextBookmark */; + 6BA1E89F10C7C227008007F6 = 6BA1E89F10C7C227008007F6 /* PBXTextBookmark */; + 6BA1E8A010C7C227008007F6 = 6BA1E8A010C7C227008007F6 /* PBXTextBookmark */; + 6BA1E8A110C7C227008007F6 = 6BA1E8A110C7C227008007F6 /* PBXTextBookmark */; + 6BA1E8A210C7C227008007F6 = 6BA1E8A210C7C227008007F6 /* PBXTextBookmark */; + 6BA1E8A310C7C227008007F6 = 6BA1E8A310C7C227008007F6 /* PBXTextBookmark */; + 6BA1E8A410C7C227008007F6 = 6BA1E8A410C7C227008007F6 /* PBXTextBookmark */; + 6BA1E8A510C7C227008007F6 = 6BA1E8A510C7C227008007F6 /* PBXTextBookmark */; + 6BA1E8A610C7C227008007F6 = 6BA1E8A610C7C227008007F6 /* PBXTextBookmark */; + 6BA1E8A710C7C227008007F6 = 6BA1E8A710C7C227008007F6 /* PBXTextBookmark */; + 6BA1E8A810C7C227008007F6 = 6BA1E8A810C7C227008007F6 /* PBXTextBookmark */; + 6BA1E8A910C7C227008007F6 = 6BA1E8A910C7C227008007F6 /* PBXTextBookmark */; + 6BA1E8AA10C7C227008007F6 = 6BA1E8AA10C7C227008007F6 /* PBXTextBookmark */; + 6BA1E8AB10C7C227008007F6 = 6BA1E8AB10C7C227008007F6 /* PBXTextBookmark */; + 6BA1E8AC10C7C227008007F6 = 6BA1E8AC10C7C227008007F6 /* PBXTextBookmark */; + 6BA1E8AD10C7C227008007F6 = 6BA1E8AD10C7C227008007F6 /* PBXTextBookmark */; + 6BA1E8AE10C7C227008007F6 = 6BA1E8AE10C7C227008007F6 /* PBXTextBookmark */; + 6BA1E8AF10C7C227008007F6 = 6BA1E8AF10C7C227008007F6 /* PBXTextBookmark */; + 6BA1E8B010C7C5D1008007F6 = 6BA1E8B010C7C5D1008007F6 /* PBXTextBookmark */; + 6BA1E8B110C7C5D1008007F6 = 6BA1E8B110C7C5D1008007F6 /* PBXTextBookmark */; + 6BA1E8B210C7C5D1008007F6 = 6BA1E8B210C7C5D1008007F6 /* PBXTextBookmark */; + 6BA1E8B310C7C5D1008007F6 = 6BA1E8B310C7C5D1008007F6 /* PBXTextBookmark */; + 6BA1E8B410C7C5D1008007F6 = 6BA1E8B410C7C5D1008007F6 /* PBXTextBookmark */; + 6BA1E8B510C7C5D1008007F6 = 6BA1E8B510C7C5D1008007F6 /* PBXTextBookmark */; + 6BA1E8B610C7C5D1008007F6 = 6BA1E8B610C7C5D1008007F6 /* PBXTextBookmark */; + 6BA1E8B710C7C5D1008007F6 = 6BA1E8B710C7C5D1008007F6 /* PBXTextBookmark */; + 6BA1E8B810C7C5D1008007F6 = 6BA1E8B810C7C5D1008007F6 /* PBXTextBookmark */; + 6BA1E8B910C7C5D1008007F6 = 6BA1E8B910C7C5D1008007F6 /* PBXTextBookmark */; + 6BA1E8BA10C7C5D1008007F6 = 6BA1E8BA10C7C5D1008007F6 /* PBXTextBookmark */; + 6BA1E8BB10C7C5D1008007F6 = 6BA1E8BB10C7C5D1008007F6 /* PBXTextBookmark */; + 6BA1E8BC10C7C5D1008007F6 = 6BA1E8BC10C7C5D1008007F6 /* PBXTextBookmark */; + 6BA1E8BD10C7C5D1008007F6 = 6BA1E8BD10C7C5D1008007F6 /* PBXTextBookmark */; + 6BA1E8BE10C7C5D1008007F6 = 6BA1E8BE10C7C5D1008007F6 /* PBXTextBookmark */; + 6BA1E8BF10C7C700008007F6 = 6BA1E8BF10C7C700008007F6 /* PBXTextBookmark */; + 6BA1E8C010C7C700008007F6 = 6BA1E8C010C7C700008007F6 /* PBXTextBookmark */; + 6BA1E8C110C7C700008007F6 = 6BA1E8C110C7C700008007F6 /* PBXTextBookmark */; + 6BA1E8C210C7C700008007F6 = 6BA1E8C210C7C700008007F6 /* PBXTextBookmark */; + 6BA1E8C310C7C700008007F6 = 6BA1E8C310C7C700008007F6 /* PBXTextBookmark */; + 6BA1E8C410C7C700008007F6 = 6BA1E8C410C7C700008007F6 /* PBXTextBookmark */; + 6BA1E8C510C7C700008007F6 = 6BA1E8C510C7C700008007F6 /* PBXTextBookmark */; + 6BA1E8C610C7C700008007F6 = 6BA1E8C610C7C700008007F6 /* PBXTextBookmark */; + 6BA1E8C710C7C700008007F6 = 6BA1E8C710C7C700008007F6 /* PBXTextBookmark */; + 6BA1E8C810C7C700008007F6 = 6BA1E8C810C7C700008007F6 /* PBXTextBookmark */; + 6BA1E8C910C7C700008007F6 = 6BA1E8C910C7C700008007F6 /* PBXTextBookmark */; + 6BA1E8CA10C7C700008007F6 = 6BA1E8CA10C7C700008007F6 /* PBXTextBookmark */; + 6BA1E8CB10C7C700008007F6 = 6BA1E8CB10C7C700008007F6 /* PBXTextBookmark */; + 6BA1E8CC10C7C700008007F6 = 6BA1E8CC10C7C700008007F6 /* PBXTextBookmark */; + 6BA1E8CD10C7C700008007F6 = 6BA1E8CD10C7C700008007F6 /* PBXTextBookmark */; + 6BA1E8CE10C7C700008007F6 = 6BA1E8CE10C7C700008007F6 /* PBXTextBookmark */; + 6BA1E8CF10C7C9A8008007F6 = 6BA1E8CF10C7C9A8008007F6 /* PBXTextBookmark */; + 6BA1E8D010C7C9A8008007F6 = 6BA1E8D010C7C9A8008007F6 /* PBXTextBookmark */; + 6BA1E8D110C7C9A8008007F6 = 6BA1E8D110C7C9A8008007F6 /* PBXTextBookmark */; + 6BA1E8D210C7C9A8008007F6 = 6BA1E8D210C7C9A8008007F6 /* PBXTextBookmark */; + 6BA1E8D310C7CB2E008007F6 = 6BA1E8D310C7CB2E008007F6 /* PBXTextBookmark */; + 6BA1E8D410C7CB2E008007F6 = 6BA1E8D410C7CB2E008007F6 /* PBXTextBookmark */; + 6BA1E8D510C7CB2E008007F6 = 6BA1E8D510C7CB2E008007F6 /* PBXTextBookmark */; + 6BA1E8D610C7CB2E008007F6 = 6BA1E8D610C7CB2E008007F6 /* PBXTextBookmark */; + 6BA1E8D710C7CB2E008007F6 = 6BA1E8D710C7CB2E008007F6 /* PBXTextBookmark */; + 6BA1E8D810C7CB2E008007F6 = 6BA1E8D810C7CB2E008007F6 /* PBXTextBookmark */; + 6BA1E8D910C7CB2E008007F6 = 6BA1E8D910C7CB2E008007F6 /* PBXTextBookmark */; + 6BA1E8DA10C7CB2E008007F6 = 6BA1E8DA10C7CB2E008007F6 /* PBXTextBookmark */; + 6BA1E8DB10C7CB62008007F6 = 6BA1E8DB10C7CB62008007F6 /* PBXTextBookmark */; + 6BA1E8DC10C7CB62008007F6 = 6BA1E8DC10C7CB62008007F6 /* PBXTextBookmark */; + 6BA1E8DD10C7CB62008007F6 = 6BA1E8DD10C7CB62008007F6 /* PBXTextBookmark */; + 6BA1E8DE10C7CB62008007F6 = 6BA1E8DE10C7CB62008007F6 /* PBXTextBookmark */; + 6BA1E8E310C7D2FA008007F6 = 6BA1E8E310C7D2FA008007F6 /* PBXTextBookmark */; + 6BA1E8E410C7D2FA008007F6 = 6BA1E8E410C7D2FA008007F6 /* PBXTextBookmark */; + 6BA1E8E510C7D2FA008007F6 = 6BA1E8E510C7D2FA008007F6 /* PBXTextBookmark */; + 6BA1E8E610C7D2FA008007F6 = 6BA1E8E610C7D2FA008007F6 /* PBXTextBookmark */; + 6BA1E8E710C7D2FA008007F6 = 6BA1E8E710C7D2FA008007F6 /* PBXTextBookmark */; + 6BA1E8E810C7D2FA008007F6 = 6BA1E8E810C7D2FA008007F6 /* PBXTextBookmark */; + 6BA1E8E910C7D2FA008007F6 = 6BA1E8E910C7D2FA008007F6 /* PBXTextBookmark */; + 6BA1E8EA10C7D2FA008007F6 = 6BA1E8EA10C7D2FA008007F6 /* PBXTextBookmark */; + 6BA1E8EB10C7D2FA008007F6 = 6BA1E8EB10C7D2FA008007F6 /* PBXTextBookmark */; + 6BA1E8EC10C7D2FA008007F6 = 6BA1E8EC10C7D2FA008007F6 /* PBXTextBookmark */; + 6BA1E8ED10C7D2FA008007F6 = 6BA1E8ED10C7D2FA008007F6 /* PBXTextBookmark */; + 6BA1E8EE10C7D2FA008007F6 = 6BA1E8EE10C7D2FA008007F6 /* PBXTextBookmark */; + 6BA1E8EF10C7D2FA008007F6 = 6BA1E8EF10C7D2FA008007F6 /* PBXTextBookmark */; + 6BA1E8F010C7D4D9008007F6 = 6BA1E8F010C7D4D9008007F6 /* PBXTextBookmark */; + 6BA1E8F110C7D4D9008007F6 = 6BA1E8F110C7D4D9008007F6 /* PBXTextBookmark */; + 6BA1E8F210C7D4D9008007F6 = 6BA1E8F210C7D4D9008007F6 /* PBXTextBookmark */; + 6BA1E8F310C7D4D9008007F6 = 6BA1E8F310C7D4D9008007F6 /* PBXTextBookmark */; + 6BA1E8F410C7D4D9008007F6 = 6BA1E8F410C7D4D9008007F6 /* PBXTextBookmark */; + 6BA1E8F510C7D4D9008007F6 = 6BA1E8F510C7D4D9008007F6 /* PBXTextBookmark */; + 6BA1E8F610C7D4D9008007F6 = 6BA1E8F610C7D4D9008007F6 /* PBXTextBookmark */; + 6BA1E8F710C7D4D9008007F6 = 6BA1E8F710C7D4D9008007F6 /* PBXTextBookmark */; + 6BA1E8F810C7D4D9008007F6 = 6BA1E8F810C7D4D9008007F6 /* PBXTextBookmark */; + 6BA1E8F910C7D4D9008007F6 = 6BA1E8F910C7D4D9008007F6 /* PBXTextBookmark */; + 6BA1E8FA10C7D4D9008007F6 = 6BA1E8FA10C7D4D9008007F6 /* PBXTextBookmark */; + 6BA1E8FB10C7D4D9008007F6 = 6BA1E8FB10C7D4D9008007F6 /* PBXTextBookmark */; + 6BA1E90210C7D850008007F6 = 6BA1E90210C7D850008007F6 /* PBXTextBookmark */; + 6BA1E90310C7D850008007F6 = 6BA1E90310C7D850008007F6 /* PBXTextBookmark */; + 6BA1E90410C7D850008007F6 = 6BA1E90410C7D850008007F6 /* PBXTextBookmark */; + 6BA1E90510C7D850008007F6 = 6BA1E90510C7D850008007F6 /* PBXTextBookmark */; + 6BA1E90610C7D850008007F6 = 6BA1E90610C7D850008007F6 /* PBXTextBookmark */; + 6BA1E90710C7D850008007F6 = 6BA1E90710C7D850008007F6 /* PBXTextBookmark */; + 6BA1E90810C7D850008007F6 = 6BA1E90810C7D850008007F6 /* PBXTextBookmark */; + 6BA1E90910C7D850008007F6 = 6BA1E90910C7D850008007F6 /* PBXTextBookmark */; + 6BA1E90A10C7D850008007F6 = 6BA1E90A10C7D850008007F6 /* PBXTextBookmark */; + 6BA1E90B10C7D850008007F6 = 6BA1E90B10C7D850008007F6 /* PBXTextBookmark */; + 6BA1E90C10C7D850008007F6 = 6BA1E90C10C7D850008007F6 /* PBXTextBookmark */; + 6BA1E90D10C7D850008007F6 = 6BA1E90D10C7D850008007F6 /* PBXTextBookmark */; + 6BA1E90E10C7D850008007F6 = 6BA1E90E10C7D850008007F6 /* PBXTextBookmark */; + 6BA1E90F10C7D850008007F6 = 6BA1E90F10C7D850008007F6 /* PBXTextBookmark */; + 6BA1E91210C7D8A9008007F6 = 6BA1E91210C7D8A9008007F6 /* PBXTextBookmark */; + 6BA1E91310C7D8A9008007F6 = 6BA1E91310C7D8A9008007F6 /* PBXTextBookmark */; + 6BA1E91410C7D8A9008007F6 = 6BA1E91410C7D8A9008007F6 /* PBXTextBookmark */; + 6BA1E91510C7D8A9008007F6 = 6BA1E91510C7D8A9008007F6 /* PBXTextBookmark */; + 6BA1E91610C7D8A9008007F6 = 6BA1E91610C7D8A9008007F6 /* PBXTextBookmark */; + 6BA1E91710C7D8A9008007F6 = 6BA1E91710C7D8A9008007F6 /* PBXTextBookmark */; + 6BA1E91C10C7D966008007F6 = 6BA1E91C10C7D966008007F6 /* PBXTextBookmark */; + 6BA1E91F10C7D999008007F6 = 6BA1E91F10C7D999008007F6 /* PBXTextBookmark */; + 6BA1E92510C7D9E8008007F6 = 6BA1E92510C7D9E8008007F6 /* PBXTextBookmark */; + 6BA1E92B10C7DAA1008007F6 = 6BA1E92B10C7DAA1008007F6 /* PBXTextBookmark */; + 6BA1E92C10C7DAA1008007F6 = 6BA1E92C10C7DAA1008007F6 /* PBXTextBookmark */; + 6BA1E92D10C7DAA1008007F6 = 6BA1E92D10C7DAA1008007F6 /* PBXTextBookmark */; + 6BA1E92E10C7DAA1008007F6 = 6BA1E92E10C7DAA1008007F6 /* PBXTextBookmark */; + 6BA1E92F10C7DAA1008007F6 = 6BA1E92F10C7DAA1008007F6 /* PBXTextBookmark */; + 6BA1E93010C7DAA1008007F6 = 6BA1E93010C7DAA1008007F6 /* PBXTextBookmark */; + 6BA1E93110C7DAA1008007F6 = 6BA1E93110C7DAA1008007F6 /* PBXTextBookmark */; + 6BA1E93710C7DB10008007F6 = 6BA1E93710C7DB10008007F6 /* PBXTextBookmark */; + 6BA1E93810C7DB10008007F6 = 6BA1E93810C7DB10008007F6 /* PBXTextBookmark */; + 6BA1E93910C7DB10008007F6 = 6BA1E93910C7DB10008007F6 /* PBXTextBookmark */; + 6BA1E93A10C7DB10008007F6 = 6BA1E93A10C7DB10008007F6 /* PBXTextBookmark */; + 6BA1E93B10C7DB10008007F6 = 6BA1E93B10C7DB10008007F6 /* PBXTextBookmark */; + 6BA1E93F10C7DB2F008007F6 = 6BA1E93F10C7DB2F008007F6 /* PBXTextBookmark */; + 6BA1E94010C7DB2F008007F6 = 6BA1E94010C7DB2F008007F6 /* PBXTextBookmark */; + 6BA1E94110C7DB2F008007F6 = 6BA1E94110C7DB2F008007F6 /* PBXTextBookmark */; + 6BA1E94210C7DB2F008007F6 = 6BA1E94210C7DB2F008007F6 /* PBXTextBookmark */; + 6BA1E94410C7DB45008007F6 = 6BA1E94410C7DB45008007F6 /* PBXTextBookmark */; + 6BA1E94510C7DB45008007F6 = 6BA1E94510C7DB45008007F6 /* PBXTextBookmark */; + 6BA1E94610C7DB45008007F6 = 6BA1E94610C7DB45008007F6 /* PBXTextBookmark */; + 6BA1E94710C7DB45008007F6 = 6BA1E94710C7DB45008007F6 /* PBXTextBookmark */; + 6BA1E94910C7DB51008007F6 = 6BA1E94910C7DB51008007F6 /* PBXTextBookmark */; + 6BA1E94A10C7DB51008007F6 = 6BA1E94A10C7DB51008007F6 /* PBXTextBookmark */; + 6BA1E94B10C7DB51008007F6 = 6BA1E94B10C7DB51008007F6 /* PBXTextBookmark */; + 6BA1E94C10C7DB51008007F6 = 6BA1E94C10C7DB51008007F6 /* PBXTextBookmark */; + 6BA1E94E10C7DB5C008007F6 = 6BA1E94E10C7DB5C008007F6 /* PBXTextBookmark */; + 6BA1E95110C7DBC6008007F6 = 6BA1E95110C7DBC6008007F6 /* PBXTextBookmark */; + 6BA1E95C10C7DBF9008007F6 = 6BA1E95C10C7DBF9008007F6 /* PBXTextBookmark */; + 6BA1E96310C7DC15008007F6 = 6BA1E96310C7DC15008007F6 /* PBXTextBookmark */; + 6BA1E96910C7DCD1008007F6 = 6BA1E96910C7DCD1008007F6 /* PBXTextBookmark */; + 6BA1E96D10C7DDD6008007F6 = 6BA1E96D10C7DDD6008007F6 /* PBXTextBookmark */; + 6BA1E96E10C7DDD6008007F6 = 6BA1E96E10C7DDD6008007F6 /* PBXTextBookmark */; + 6BA1E96F10C7DDD6008007F6 = 6BA1E96F10C7DDD6008007F6 /* PBXTextBookmark */; + 6BA1E97010C7DDD6008007F6 = 6BA1E97010C7DDD6008007F6 /* PBXTextBookmark */; + 6BA1E97110C7DDD6008007F6 = 6BA1E97110C7DDD6008007F6 /* PBXTextBookmark */; + 6BA1E97410C7DF1F008007F6 = 6BA1E97410C7DF1F008007F6 /* PBXTextBookmark */; + 6BA1E97510C7DF1F008007F6 = 6BA1E97510C7DF1F008007F6 /* PBXTextBookmark */; + 6BA1E97610C7DF1F008007F6 = 6BA1E97610C7DF1F008007F6 /* PBXTextBookmark */; + 6BA1E97710C7DF1F008007F6 = 6BA1E97710C7DF1F008007F6 /* PBXTextBookmark */; + 6BA1E97810C7DF1F008007F6 = 6BA1E97810C7DF1F008007F6 /* PBXTextBookmark */; + 6BA1E97910C7DF1F008007F6 = 6BA1E97910C7DF1F008007F6 /* PBXTextBookmark */; + 6BA1E97A10C7DF1F008007F6 = 6BA1E97A10C7DF1F008007F6 /* PBXTextBookmark */; + 6BA1E97B10C7DF1F008007F6 = 6BA1E97B10C7DF1F008007F6 /* PBXTextBookmark */; + 6BA1E97E10C7DF98008007F6 = 6BA1E97E10C7DF98008007F6 /* PBXTextBookmark */; + 6BA1E98010C7DFEF008007F6 = 6BA1E98010C7DFEF008007F6 /* PBXTextBookmark */; + 6BA1E98310C7E0B7008007F6 = 6BA1E98310C7E0B7008007F6 /* PBXTextBookmark */; + 6BA1E98410C7E0BF008007F6 = 6BA1E98410C7E0BF008007F6 /* PBXTextBookmark */; + 6BA1E98610C7E0E8008007F6 = 6BA1E98610C7E0E8008007F6 /* PBXTextBookmark */; + 6BA1E98810C7E178008007F6 = 6BA1E98810C7E178008007F6 /* PBXTextBookmark */; + 6BA1E98D10C7EAC3008007F6 = 6BA1E98D10C7EAC3008007F6 /* PBXTextBookmark */; + 6BA1E98E10C7EAC3008007F6 = 6BA1E98E10C7EAC3008007F6 /* PBXTextBookmark */; + 6BA1E98F10C7EAC3008007F6 = 6BA1E98F10C7EAC3008007F6 /* PBXTextBookmark */; + 6BA1E99010C7EAC3008007F6 = 6BA1E99010C7EAC3008007F6 /* PBXTextBookmark */; + 6BA1E99110C7EAC3008007F6 = 6BA1E99110C7EAC3008007F6 /* PBXTextBookmark */; + 6BA1E99310C7EAEF008007F6 = 6BA1E99310C7EAEF008007F6 /* PBXTextBookmark */; + 6BA1E99510C7EB05008007F6 = 6BA1E99510C7EB05008007F6 /* PBXTextBookmark */; + 6BA1E99810C7EB71008007F6 = 6BA1E99810C7EB71008007F6 /* PBXTextBookmark */; + 6BA1E99B10C7EBB0008007F6 = 6BA1E99B10C7EBB0008007F6 /* PBXTextBookmark */; + 6BA1E99D10C7EC0F008007F6 = 6BA1E99D10C7EC0F008007F6 /* PBXTextBookmark */; + 6BA1E99F10C7EC3F008007F6 = 6BA1E99F10C7EC3F008007F6 /* PBXTextBookmark */; + 6BA1E9A110C7EC47008007F6 = 6BA1E9A110C7EC47008007F6 /* PBXTextBookmark */; + 6BA1E9A310C7EC77008007F6 = 6BA1E9A310C7EC77008007F6 /* PBXTextBookmark */; + 6BA1E9A510C7EC93008007F6 = 6BA1E9A510C7EC93008007F6 /* PBXTextBookmark */; + 6BA1E9A710C7ECFF008007F6 = 6BA1E9A710C7ECFF008007F6 /* PBXTextBookmark */; + 6BA1E9A910C7ED0B008007F6 = 6BA1E9A910C7ED0B008007F6 /* PBXTextBookmark */; + 6BA1E9AB10C7F12E008007F6 = 6BA1E9AB10C7F12E008007F6 /* PBXTextBookmark */; + 6BB4964410C8ECF300BC0805 /* PBXTextBookmark */ = 6BB4964410C8ECF300BC0805 /* PBXTextBookmark */; + 6BB4964510C8ECF300BC0805 /* PBXTextBookmark */ = 6BB4964510C8ECF300BC0805 /* PBXTextBookmark */; + 6BB4964610C8ECF300BC0805 /* PBXTextBookmark */ = 6BB4964610C8ECF300BC0805 /* PBXTextBookmark */; + 6BB4964710C8ECF300BC0805 /* PBXTextBookmark */ = 6BB4964710C8ECF300BC0805 /* PBXTextBookmark */; + 6BB4964810C8ECF300BC0805 /* PBXTextBookmark */ = 6BB4964810C8ECF300BC0805 /* PBXTextBookmark */; + 6BB4964910C8ECF300BC0805 /* PBXTextBookmark */ = 6BB4964910C8ECF300BC0805 /* PBXTextBookmark */; + 6BB4964A10C8ECF300BC0805 /* PBXTextBookmark */ = 6BB4964A10C8ECF300BC0805 /* PBXTextBookmark */; 6BF2589310BE6F220061DCC9 = 6BF2589310BE6F220061DCC9 /* PBXTextBookmark */; 6BF2589B10BEADD20061DCC9 = 6BF2589B10BEADD20061DCC9 /* PBXTextBookmark */; 6BF2589C10BEADD20061DCC9 = 6BF2589C10BEADD20061DCC9 /* PBXTextBookmark */; @@ -525,7 +532,7 @@ sepNavWindowFrame = "{{38, 57}, {1011, 695}}"; }; }; - 6B0249B11003783F00CF7107 /* Sample_TileMesh.cpp:48 */ = { + 6B0249B11003783F00CF7107 /* Sample_TileMesh.cpp:27 */ = { isa = PBXFileBreakpoint; actions = ( ); @@ -537,9 +544,10 @@ functionName = "BuilderTiledMesh::toolRecalc()"; hitCount = 0; ignoreCount = 0; - lineNumber = 48; + lineNumber = 27; location = Recast; modificationTime = 281534653.905802; + originalNumberOfMultipleMatches = 0; state = 1; }; 6B0249ED10037C0A00CF7107 /* DetourTileNavMesh.cpp:1 */ = { @@ -557,6 +565,7 @@ lineNumber = 1; location = Recast; modificationTime = 281534653.906114; + originalNumberOfMultipleMatches = 0; state = 1; }; 6B0249EF10037C0C00CF7107 /* DetourTileNavMesh.cpp:1 */ = { @@ -574,6 +583,7 @@ lineNumber = 1; location = Recast; modificationTime = 281534653.906272; + originalNumberOfMultipleMatches = 0; state = 1; }; 6B024AC01004AB3900CF7107 /* DetourTileNavMesh.cpp:1 */ = { @@ -590,10 +600,17 @@ ignoreCount = 0; lineNumber = 1; location = Recast; - modificationTime = 281534653.906436; + modificationTime = 281534653.9064361; + originalNumberOfMultipleMatches = 0; state = 1; }; 6B092B920FFCC2AC0088D3A5 /* DetourTileNavMeshBuilder.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = DetourTileNavMeshBuilder.h; + path = /Users/memon/Code/recastnavigation/Detour/Include/DetourTileNavMeshBuilder.h; + sourceTree = ""; uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {915, 489}}"; sepNavSelRange = "{1461, 0}"; @@ -601,10 +618,16 @@ }; }; 6B092B930FFCC2BD0088D3A5 /* DetourTileNavMeshBuilder.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = DetourTileNavMeshBuilder.cpp; + path = /Users/memon/Code/recastnavigation/Detour/Source/DetourTileNavMeshBuilder.cpp; + sourceTree = ""; uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {915, 3424}}"; + sepNavIntBoundsRect = "{{0, 0}, {915, 3408}}"; sepNavSelRange = "{4890, 0}"; - sepNavVisRange = "{4647, 1090}"; + sepNavVisRange = "{4647, 399}"; }; }; 6B1185F41006895B0018F96F /* DetourNode.cpp */ = { @@ -623,9 +646,9 @@ }; 6B1185FC10068B040018F96F /* DetourCommon.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {915, 3056}}"; - sepNavSelRange = "{4646, 0}"; - sepNavVisRange = "{1058, 1125}"; + sepNavIntBoundsRect = "{{0, 0}, {915, 3328}}"; + sepNavSelRange = "{3544, 0}"; + sepNavVisRange = "{2658, 420}"; }; }; 6B1185FD10068B150018F96F /* DetourCommon.cpp */ = { @@ -679,9 +702,9 @@ }; 6B137C7E0F7FCBFE00459200 /* Recast.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {915, 9440}}"; - sepNavSelRange = "{11412, 172}"; - sepNavVisRange = "{11371, 742}"; + sepNavIntBoundsRect = "{{0, 0}, {915, 9520}}"; + sepNavSelRange = "{11550, 0}"; + sepNavVisRange = "{11371, 409}"; }; }; 6B137C7F0F7FCBFE00459200 /* RecastDebugDraw.h */ = { @@ -784,11 +807,6 @@ name = Sample_StatMesh.h; path = /Users/memon/Code/recastnavigation/RecastDemo/Include/Sample_StatMesh.h; sourceTree = ""; - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {915, 1136}}"; - sepNavSelRange = "{1023, 0}"; - sepNavVisRange = "{539, 748}"; - }; }; 6B25B6120FFA62AD004F1BC4 /* Sample_StatMeshSimple.h */ = { isa = PBXFileReference; @@ -797,11 +815,6 @@ name = Sample_StatMeshSimple.h; path = /Users/memon/Code/recastnavigation/RecastDemo/Include/Sample_StatMeshSimple.h; sourceTree = ""; - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {915, 1072}}"; - sepNavSelRange = "{960, 0}"; - sepNavVisRange = "{632, 741}"; - }; }; 6B25B6140FFA62BE004F1BC4 /* Sample.cpp */ = { uiCtxt = { @@ -817,11 +830,6 @@ name = Sample_StatMesh.cpp; path = /Users/memon/Code/recastnavigation/RecastDemo/Source/Sample_StatMesh.cpp; sourceTree = ""; - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {915, 5600}}"; - sepNavSelRange = "{4243, 0}"; - sepNavVisRange = "{4135, 598}"; - }; }; 6B25B6160FFA62BE004F1BC4 /* Sample_StatMeshSimple.cpp */ = { isa = PBXFileReference; @@ -830,32 +838,27 @@ name = Sample_StatMeshSimple.cpp; path = /Users/memon/Code/recastnavigation/RecastDemo/Source/Sample_StatMeshSimple.cpp; sourceTree = ""; - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1048, 9648}}"; - sepNavSelRange = "{15541, 0}"; - sepNavVisRange = "{15204, 584}"; - }; }; 6B25B6180FFA62BE004F1BC4 /* main.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {915, 11888}}"; - sepNavSelRange = "{4154, 0}"; - sepNavVisRange = "{3912, 830}"; + sepNavIntBoundsRect = "{{0, 0}, {915, 11824}}"; + sepNavSelRange = "{390, 0}"; + sepNavVisRange = "{0, 440}"; }; }; 6B2AEC510FFB8946005BE9CC /* Sample_TileMesh.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {915, 1840}}"; - sepNavSelRange = "{2447, 0}"; - sepNavVisRange = "{2084, 872}"; + sepNavIntBoundsRect = "{{0, 0}, {915, 1872}}"; + sepNavSelRange = "{1441, 41}"; + sepNavVisRange = "{1072, 548}"; sepNavWindowFrame = "{{15, 78}, {1011, 695}}"; }; }; 6B2AEC520FFB8958005BE9CC /* Sample_TileMesh.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1223, 15696}}"; - sepNavSelRange = "{5993, 0}"; - sepNavVisRange = "{5716, 593}"; + sepNavIntBoundsRect = "{{0, 0}, {915, 15728}}"; + sepNavSelRange = "{3081, 0}"; + sepNavVisRange = "{2889, 731}"; }; }; 6B2AEC550FFB89E7005BE9CC /* Sample_StatMeshTiled.cpp */ = { @@ -865,11 +868,6 @@ name = Sample_StatMeshTiled.cpp; path = /Users/memon/Code/recastnavigation/RecastDemo/Source/Sample_StatMeshTiled.cpp; sourceTree = ""; - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1328, 15904}}"; - sepNavSelRange = "{26709, 0}"; - sepNavVisRange = "{26491, 1084}"; - }; }; 6B2AEC570FFB89F4005BE9CC /* Sample_StatMeshTiled.h */ = { isa = PBXFileReference; @@ -878,13 +876,14 @@ name = Sample_StatMeshTiled.h; path = /Users/memon/Code/recastnavigation/RecastDemo/Include/Sample_StatMeshTiled.h; sourceTree = ""; - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {915, 1520}}"; - sepNavSelRange = "{777, 0}"; - sepNavVisRange = "{270, 844}"; - }; }; 6B2AEC580FFB8A68005BE9CC /* DetourTileNavMesh.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = DetourTileNavMesh.h; + path = /Users/memon/Code/recastnavigation/Detour/Include/DetourTileNavMesh.h; + sourceTree = ""; uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {915, 4976}}"; sepNavSelRange = "{12743, 0}"; @@ -892,6 +891,12 @@ }; }; 6B2AEC590FFB8A7A005BE9CC /* DetourTileNavMesh.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = DetourTileNavMesh.cpp; + path = /Users/memon/Code/recastnavigation/Detour/Source/DetourTileNavMesh.cpp; + sourceTree = ""; uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {915, 22304}}"; sepNavSelRange = "{9271, 0}"; @@ -953,6 +958,7 @@ lineNumber = 281; location = Recast; modificationTime = 281534653.90745; + originalNumberOfMultipleMatches = 0; state = 1; }; 6B555DAE100B211D00247EA3 /* imguiRenderGL.h */ = { @@ -971,9 +977,9 @@ }; 6B555DF6100B273500247EA3 /* stb_truetype.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1216, 27456}}"; - sepNavSelRange = "{8102, 0}"; - sepNavVisRange = "{7326, 1107}"; + sepNavIntBoundsRect = "{{0, 0}, {915, 27152}}"; + sepNavSelRange = "{27352, 0}"; + sepNavVisRange = "{26962, 857}"; }; }; 6B57D313108C609500DDD053 /* RecastMeshDetail.cpp:622 */ = { @@ -991,6 +997,7 @@ lineNumber = 622; location = Recast; modificationTime = 281534653.907625; + originalNumberOfMultipleMatches = 0; state = 1; }; 6B57D358108C66B200DDD053 /* PBXTextBookmark */ = { @@ -1037,7 +1044,8 @@ ignoreCount = 0; lineNumber = 252; location = Recast; - modificationTime = 281534653.907814; + modificationTime = 281534653.9078139; + originalNumberOfMultipleMatches = 0; state = 1; }; 6B57D38F108C69E400DDD053 /* PBXTextBookmark */ = { @@ -1087,7 +1095,7 @@ fRef = 6B25B6180FFA62BE004F1BC4 /* main.cpp */; name = "main.cpp: 578"; rLen = 0; - rLoc = 13052; + rLoc = 12947; rType = 0; vrLen = 649; vrLoc = 12515; @@ -1163,6 +1171,9 @@ configStateDict = { }; customDataFormattersEnabled = 1; + dataTipCustomDataFormattersEnabled = 1; + dataTipShowTypeColumn = 1; + dataTipSortType = 0; debuggerPlugin = GDBDebugging; disassemblyDisplayState = 0; dylibVariantSuffix = ""; @@ -1175,6 +1186,7 @@ name = Recast; savedGlobals = { }; + showTypeColumn = 0; sourceDirectories = ( ); variableFormatDictionary = { @@ -1185,6 +1197,9 @@ fallbackIsa = XCSourceControlManager; isSCMEnabled = 0; scmConfiguration = { + repositoryNamesForRoots = { + "" = ""; + }; }; }; 6B8632AA0F78115100E2684A /* Code sense */ = { @@ -1370,8 +1385,8 @@ isa = PBXTextBookmark; fRef = 6B2AEC520FFB8958005BE9CC /* Sample_TileMesh.cpp */; name = "Sample_TileMesh.cpp: 609"; - rLen = 7; - rLoc = 15843; + rLen = 0; + rLoc = 1099; rType = 0; vrLen = 1297; vrLoc = 15422; @@ -1470,8 +1485,8 @@ isa = PBXTextBookmark; fRef = 6BDD9E070F91113800904EEF /* DetourDebugDraw.cpp */; name = "DetourDebugDraw.cpp: 330"; - rLen = 28; - rLoc = 8370; + rLen = 0; + rLoc = 2957; rType = 0; vrLen = 566; vrLoc = 8078; @@ -1548,9 +1563,9 @@ }; 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {915, 27056}}"; - sepNavSelRange = "{25230, 0}"; - sepNavVisRange = "{28068, 692}"; + sepNavIntBoundsRect = "{{0, 0}, {915, 26896}}"; + sepNavSelRange = "{2907, 0}"; + sepNavVisRange = "{2859, 348}"; }; }; 6B8DE88810B69E3E00DF20FB /* DetourNavMeshBuilder.cpp */ = { @@ -1562,9 +1577,9 @@ }; 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {915, 5872}}"; - sepNavSelRange = "{9354, 21}"; - sepNavVisRange = "{9068, 1645}"; + sepNavIntBoundsRect = "{{0, 0}, {915, 6192}}"; + sepNavSelRange = "{14682, 456}"; + sepNavVisRange = "{14774, 394}"; }; }; 6B8DE88C10B69E4C00DF20FB /* DetourNavMeshBuilder.h */ = { @@ -1608,7 +1623,7 @@ isa = PBXTextBookmark; fRef = 6BDD9E040F91112200904EEF /* DetourDebugDraw.h */; name = "DetourDebugDraw.h: 22"; - rLen = 89; + rLen = 27; rLoc = 972; rType = 0; vrLen = 1110; @@ -1629,7 +1644,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 109"; rLen = 0; - rLoc = 2903; + rLoc = 3055; rType = 0; vrLen = 685; vrLoc = 2783; @@ -1669,7 +1684,7 @@ fRef = 6B2AEC510FFB8946005BE9CC /* Sample_TileMesh.h */; name = "Sample_TileMesh.h: 98"; rLen = 0; - rLoc = 2447; + rLoc = 939; rType = 0; vrLen = 872; vrLoc = 2084; @@ -1709,23 +1724,35 @@ fRef = 6B2AEC510FFB8946005BE9CC /* Sample_TileMesh.h */; name = "Sample_TileMesh.h: 98"; rLen = 0; - rLoc = 2447; + rLoc = 939; rType = 0; vrLen = 872; vrLoc = 2084; }; 6B8DE8F610B6B70100DF20FB /* Sample_DynMesh.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = Sample_DynMesh.h; + path = /Users/memon/Code/recastnavigation/RecastDemo/Include/Sample_DynMesh.h; + sourceTree = ""; uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {915, 1872}}"; - sepNavSelRange = "{2247, 0}"; - sepNavVisRange = "{1496, 631}"; + sepNavSelRange = "{0, 2946}"; + sepNavVisRange = "{1478, 651}"; }; }; 6B8DE8F710B6B70E00DF20FB /* Sample_DynMesh.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = Sample_DynMesh.cpp; + path = /Users/memon/Code/recastnavigation/RecastDemo/Source/Sample_DynMesh.cpp; + sourceTree = ""; uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1223, 15056}}"; - sepNavSelRange = "{23786, 310}"; - sepNavVisRange = "{23187, 1142}"; + sepNavIntBoundsRect = "{{0, 0}, {1223, 14912}}"; + sepNavSelRange = "{0, 27828}"; + sepNavVisRange = "{23079, 1267}"; }; }; 6B8DE90210B6B76800DF20FB /* PBXTextBookmark */ = { @@ -1735,7 +1762,7 @@ rLen = 0; rLoc = 2945; rType = 0; - vrLen = 795; + vrLen = 792; vrLoc = 2154; }; 6B8DE90310B6B76800DF20FB /* PBXTextBookmark */ = { @@ -1843,7 +1870,7 @@ fRef = 6B25B6180FFA62BE004F1BC4 /* main.cpp */; name = "main.cpp: 566"; rLen = 36; - rLoc = 12735; + rLoc = 12630; rType = 0; vrLen = 681; vrLoc = 12381; @@ -1873,7 +1900,7 @@ fRef = 6BDD9E070F91113800904EEF /* DetourDebugDraw.cpp */; name = "DetourDebugDraw.cpp: 33"; rLen = 0; - rLoc = 1316; + rLoc = 1017; rType = 0; vrLen = 812; vrLoc = 948; @@ -1963,6 +1990,7 @@ lineNumber = 281; location = Recast; modificationTime = 281534653.907283; + originalNumberOfMultipleMatches = 0; state = 1; }; 6B93FEFF1030443300F0C0DA /* Recast.cpp:281 */ = { @@ -1980,6 +2008,7 @@ lineNumber = 281; location = Recast; modificationTime = 281534653.90712; + originalNumberOfMultipleMatches = 0; state = 2; }; 6B9BE374107BC6A40036CC81 /* PBXTextBookmark */ = { @@ -2014,6 +2043,7 @@ ignoreCount = 0; lineNumber = 301; modificationTime = 281534654.306096; + originalNumberOfMultipleMatches = 0; state = 0; }; 6B9D09921028542A009B1A6C /* RecastDebugDraw.cpp:29 */ = { @@ -2031,6 +2061,7 @@ lineNumber = 29; location = Recast; modificationTime = 281534653.906959; + originalNumberOfMultipleMatches = 0; state = 2; }; 6BA1E63A10C1DB5B008007F6 /* PBXTextBookmark */ = { @@ -2118,7 +2149,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 761"; rLen = 0; - rLoc = 21671; + rLoc = 21823; rType = 0; vrLen = 592; vrLoc = 19593; @@ -2158,7 +2189,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 742"; rLen = 0; - rLoc = 21148; + rLoc = 21300; rType = 0; vrLen = 1054; vrLoc = 18832; @@ -2178,7 +2209,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 89"; rLen = 0; - rLoc = 2850; + rLoc = 2955; rType = 0; vrLen = 855; vrLoc = 2570; @@ -2198,7 +2229,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 89"; rLen = 0; - rLoc = 2850; + rLoc = 2955; rType = 0; vrLen = 855; vrLoc = 2570; @@ -2218,7 +2249,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 748"; rLen = 0; - rLoc = 21410; + rLoc = 21562; rType = 0; vrLen = 1050; vrLoc = 18781; @@ -2238,7 +2269,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 755"; rLen = 0; - rLoc = 21541; + rLoc = 21693; rType = 0; vrLen = 767; vrLoc = 18904; @@ -2258,7 +2289,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 761"; rLen = 0; - rLoc = 21671; + rLoc = 21823; rType = 0; vrLen = 592; vrLoc = 19593; @@ -2288,7 +2319,7 @@ fRef = 6BDD9E040F91112200904EEF /* DetourDebugDraw.h */; name = "DetourDebugDraw.h: 33"; rLen = 0; - rLoc = 1465; + rLoc = 1000; rType = 0; vrLen = 1652; vrLoc = 3; @@ -2318,7 +2349,7 @@ fRef = 6BDD9E070F91113800904EEF /* DetourDebugDraw.cpp */; name = "DetourDebugDraw.cpp: 576"; rLen = 0; - rLoc = 14721; + rLoc = 4679; rType = 0; vrLen = 610; vrLoc = 14492; @@ -2328,7 +2359,7 @@ fRef = 6B2AEC520FFB8958005BE9CC /* Sample_TileMesh.cpp */; name = "Sample_TileMesh.cpp: 241"; rLen = 0; - rLoc = 5993; + rLoc = 1099; rType = 0; vrLen = 593; vrLoc = 5716; @@ -2417,7 +2448,7 @@ isa = PBXTextBookmark; fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; rLen = 1; - rLoc = 337; + rLoc = 348; rType = 1; }; 6BA1E82C10C7BB85008007F6 /* PBXTextBookmark */ = { @@ -2455,7 +2486,7 @@ fRef = 6BDD9E040F91112200904EEF /* DetourDebugDraw.h */; name = "DetourDebugDraw.h: 33"; rLen = 0; - rLoc = 1465; + rLoc = 1000; rType = 0; vrLen = 1652; vrLoc = 3; @@ -2465,7 +2496,7 @@ fRef = 6BDD9E070F91113800904EEF /* DetourDebugDraw.cpp */; name = "DetourDebugDraw.cpp: 577"; rLen = 0; - rLoc = 14769; + rLoc = 4727; rType = 0; vrLen = 826; vrLoc = 14158; @@ -2475,7 +2506,7 @@ fRef = 6BDD9E070F91113800904EEF /* DetourDebugDraw.cpp */; name = "DetourDebugDraw.cpp: 577"; rLen = 0; - rLoc = 14728; + rLoc = 4686; rType = 0; vrLen = 862; vrLoc = 14277; @@ -2515,7 +2546,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 688"; rLen = 26; - rLoc = 19999; + rLoc = 20151; rType = 0; vrLen = 940; vrLoc = 17412; @@ -2525,7 +2556,7 @@ fRef = 6BDD9E070F91113800904EEF /* DetourDebugDraw.cpp */; name = "DetourDebugDraw.cpp: 579"; rLen = 0; - rLoc = 14769; + rLoc = 4727; rType = 0; vrLen = 827; vrLoc = 14277; @@ -2535,7 +2566,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 678"; rLen = 36; - rLoc = 19740; + rLoc = 19892; rType = 0; vrLen = 940; vrLoc = 17412; @@ -2545,7 +2576,7 @@ fRef = 6BDD9E070F91113800904EEF /* DetourDebugDraw.cpp */; name = "DetourDebugDraw.cpp: 577"; rLen = 0; - rLoc = 14768; + rLoc = 4726; rType = 0; vrLen = 706; vrLoc = 14492; @@ -2565,7 +2596,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 643"; rLen = 0; - rLoc = 18409; + rLoc = 18561; rType = 0; vrLen = 844; vrLoc = 16159; @@ -2585,7 +2616,7 @@ fRef = 6BDD9E070F91113800904EEF /* DetourDebugDraw.cpp */; name = "DetourDebugDraw.cpp: 577"; rLen = 41; - rLoc = 14728; + rLoc = 4686; rType = 0; vrLen = 540; vrLoc = 14492; @@ -2595,7 +2626,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 643"; rLen = 0; - rLoc = 18409; + rLoc = 18561; rType = 0; vrLen = 641; vrLoc = 16159; @@ -2615,7 +2646,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 643"; rLen = 0; - rLoc = 18409; + rLoc = 18561; rType = 0; vrLen = 641; vrLoc = 16159; @@ -2625,7 +2656,7 @@ fRef = 6BDD9E070F91113800904EEF /* DetourDebugDraw.cpp */; name = "DetourDebugDraw.cpp: 576"; rLen = 0; - rLoc = 14721; + rLoc = 4679; rType = 0; vrLen = 610; vrLoc = 14492; @@ -2645,7 +2676,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 641"; rLen = 0; - rLoc = 18407; + rLoc = 18559; rType = 0; vrLen = 574; vrLoc = 25228; @@ -2665,7 +2696,7 @@ fRef = 6B2AEC520FFB8958005BE9CC /* Sample_TileMesh.cpp */; name = "Sample_TileMesh.cpp: 241"; rLen = 0; - rLoc = 5993; + rLoc = 1099; rType = 0; vrLen = 593; vrLoc = 5716; @@ -2885,7 +2916,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 176"; rLen = 0; - rLoc = 4880; + rLoc = 5032; rType = 0; vrLen = 670; vrLoc = 4467; @@ -2905,7 +2936,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 177"; rLen = 0; - rLoc = 4959; + rLoc = 5111; rType = 0; vrLen = 798; vrLoc = 4481; @@ -2925,7 +2956,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 177"; rLen = 0; - rLoc = 4959; + rLoc = 5111; rType = 0; vrLen = 798; vrLoc = 4481; @@ -2955,7 +2986,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 177"; rLen = 0; - rLoc = 4959; + rLoc = 5111; rType = 0; vrLen = 798; vrLoc = 4481; @@ -2975,7 +3006,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 175"; rLen = 0; - rLoc = 4867; + rLoc = 5019; rType = 0; vrLen = 868; vrLoc = 4481; @@ -3005,7 +3036,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 432"; rLen = 0; - rLoc = 12069; + rLoc = 12221; rType = 0; vrLen = 679; vrLoc = 11641; @@ -3025,6 +3056,7 @@ lineNumber = 516; location = Recast; modificationTime = 281534653.90798; + originalNumberOfMultipleMatches = 0; state = 1; }; 6BA1E86C10C7BCB8008007F6 /* PBXTextBookmark */ = { @@ -3032,7 +3064,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 429"; rLen = 0; - rLoc = 12012; + rLoc = 12164; rType = 0; vrLen = 679; vrLoc = 11641; @@ -3052,7 +3084,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 429"; rLen = 0; - rLoc = 12012; + rLoc = 12164; rType = 0; vrLen = 679; vrLoc = 11641; @@ -3092,7 +3124,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 376"; rLen = 0; - rLoc = 10222; + rLoc = 10374; rType = 0; vrLen = 669; vrLoc = 10118; @@ -3122,7 +3154,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 168"; rLen = 0; - rLoc = 4614; + rLoc = 4766; rType = 0; vrLen = 575; vrLoc = 3908; @@ -3142,7 +3174,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 376"; rLen = 0; - rLoc = 10222; + rLoc = 10374; rType = 0; vrLen = 669; vrLoc = 10118; @@ -3159,23 +3191,23 @@ }; 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {915, 7408}}"; - sepNavSelRange = "{8158, 0}"; - sepNavVisRange = "{7547, 969}"; + sepNavIntBoundsRect = "{{0, 0}, {915, 7120}}"; + sepNavSelRange = "{7058, 0}"; + sepNavVisRange = "{6604, 715}"; }; }; 6BA1E88810C7BFC9008007F6 /* Sample_SoloMeshSimple.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {915, 9568}}"; - sepNavSelRange = "{242, 0}"; - sepNavVisRange = "{0, 655}"; + sepNavIntBoundsRect = "{{0, 0}, {1048, 9360}}"; + sepNavSelRange = "{14842, 0}"; + sepNavVisRange = "{14224, 975}"; }; }; 6BA1E88910C7BFC9008007F6 /* Sample_SoloMeshTiled.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {915, 16000}}"; - sepNavSelRange = "{360, 0}"; - sepNavVisRange = "{0, 737}"; + sepNavIntBoundsRect = "{{0, 0}, {943, 16016}}"; + sepNavSelRange = "{25907, 20}"; + sepNavVisRange = "{25533, 785}"; }; }; 6BA1E88D10C7BFD3008007F6 /* Sample_SoloMesh.h */ = { @@ -3187,16 +3219,16 @@ }; 6BA1E88E10C7BFD3008007F6 /* Sample_SoloMeshSimple.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {915, 1072}}"; - sepNavSelRange = "{1053, 0}"; - sepNavVisRange = "{632, 814}"; + sepNavIntBoundsRect = "{{0, 0}, {915, 1120}}"; + sepNavSelRange = "{129, 0}"; + sepNavVisRange = "{0, 539}"; }; }; 6BA1E88F10C7BFD3008007F6 /* Sample_SoloMeshTiled.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {915, 1536}}"; - sepNavSelRange = "{2174, 0}"; - sepNavVisRange = "{1376, 810}"; + sepNavIntBoundsRect = "{{0, 0}, {915, 1504}}"; + sepNavSelRange = "{198, 0}"; + sepNavVisRange = "{0, 711}"; }; }; 6BA1E89310C7C227008007F6 /* PBXTextBookmark */ = { @@ -3234,7 +3266,7 @@ fRef = 6BA1E88E10C7BFD3008007F6 /* Sample_SoloMeshSimple.h */; name = "Sample_SoloMeshSimple.h: 54"; rLen = 0; - rLoc = 1053; + rLoc = 1049; rType = 0; vrLen = 814; vrLoc = 632; @@ -3254,7 +3286,7 @@ fRef = 6BA1E88F10C7BFD3008007F6 /* Sample_SoloMeshTiled.h */; name = "Sample_SoloMeshTiled.h: 95"; rLen = 0; - rLoc = 2174; + rLoc = 2170; rType = 0; vrLen = 810; vrLoc = 1376; @@ -3274,7 +3306,7 @@ fRef = 6B25B6180FFA62BE004F1BC4 /* main.cpp */; name = "main.cpp: 201"; rLen = 0; - rLoc = 4154; + rLoc = 4116; rType = 0; vrLen = 830; vrLoc = 3912; @@ -3294,7 +3326,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 560"; rLen = 0; - rLoc = 14678; + rLoc = 14830; rType = 0; vrLen = 957; vrLoc = 14351; @@ -3314,7 +3346,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 387"; rLen = 0; - rLoc = 10534; + rLoc = 10686; rType = 0; vrLen = 668; vrLoc = 10118; @@ -3334,7 +3366,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 439"; rLen = 0; - rLoc = 12218; + rLoc = 12370; rType = 0; vrLen = 850; vrLoc = 11596; @@ -3374,7 +3406,7 @@ fRef = 6BA1E88E10C7BFD3008007F6 /* Sample_SoloMeshSimple.h */; name = "Sample_SoloMeshSimple.h: 54"; rLen = 0; - rLoc = 1053; + rLoc = 1049; rType = 0; vrLen = 814; vrLoc = 632; @@ -3394,7 +3426,7 @@ fRef = 6BA1E88F10C7BFD3008007F6 /* Sample_SoloMeshTiled.h */; name = "Sample_SoloMeshTiled.h: 95"; rLen = 0; - rLoc = 2174; + rLoc = 2170; rType = 0; vrLen = 810; vrLoc = 1376; @@ -3414,7 +3446,7 @@ fRef = 6B25B6180FFA62BE004F1BC4 /* main.cpp */; name = "main.cpp: 201"; rLen = 0; - rLoc = 4154; + rLoc = 4116; rType = 0; vrLen = 830; vrLoc = 3912; @@ -3424,7 +3456,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 431"; rLen = 0; - rLoc = 12068; + rLoc = 12220; rType = 0; vrLen = 649; vrLoc = 11797; @@ -3444,7 +3476,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 431"; rLen = 0; - rLoc = 12068; + rLoc = 12220; rType = 0; vrLen = 649; vrLoc = 11797; @@ -3464,7 +3496,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 560"; rLen = 0; - rLoc = 14678; + rLoc = 14830; rType = 0; vrLen = 957; vrLoc = 14351; @@ -3484,7 +3516,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 607"; rLen = 0; - rLoc = 16092; + rLoc = 16244; rType = 0; vrLen = 867; vrLoc = 15069; @@ -3524,7 +3556,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 615"; rLen = 0; - rLoc = 15671; + rLoc = 15823; rType = 0; vrLen = 1020; vrLoc = 15652; @@ -3534,7 +3566,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 563"; rLen = 0; - rLoc = 14585; + rLoc = 14737; rType = 0; vrLen = 944; vrLoc = 14182; @@ -3554,7 +3586,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 1554"; rLen = 9; - rLoc = 42378; + rLoc = 42530; rType = 0; vrLen = 864; vrLoc = 39825; @@ -3574,7 +3606,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 622"; rLen = 0; - rLoc = 15798; + rLoc = 15950; rType = 0; vrLen = 966; vrLoc = 15645; @@ -3594,7 +3626,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 605"; rLen = 0; - rLoc = 15671; + rLoc = 15823; rType = 0; vrLen = 1005; vrLoc = 15652; @@ -3614,7 +3646,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 615"; rLen = 0; - rLoc = 15671; + rLoc = 15823; rType = 0; vrLen = 1020; vrLoc = 15652; @@ -3634,7 +3666,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 604"; rLen = 0; - rLoc = 15671; + rLoc = 15823; rType = 0; vrLen = 956; vrLoc = 15652; @@ -3664,7 +3696,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 604"; rLen = 0; - rLoc = 15671; + rLoc = 15823; rType = 0; vrLen = 964; vrLoc = 15652; @@ -3674,7 +3706,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 604"; rLen = 0; - rLoc = 15671; + rLoc = 15823; rType = 0; vrLen = 964; vrLoc = 15652; @@ -3794,7 +3826,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 638"; rLen = 0; - rLoc = 16583; + rLoc = 16735; rType = 0; vrLen = 843; vrLoc = 16276; @@ -3804,7 +3836,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 622"; rLen = 0; - rLoc = 16336; + rLoc = 16488; rType = 0; vrLen = 895; vrLoc = 15670; @@ -3821,7 +3853,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 622"; rLen = 0; - rLoc = 16336; + rLoc = 16488; rType = 0; vrLen = 895; vrLoc = 15670; @@ -3841,7 +3873,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 625"; rLen = 0; - rLoc = 16351; + rLoc = 16503; rType = 0; vrLen = 809; vrLoc = 15799; @@ -3881,7 +3913,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 625"; rLen = 0; - rLoc = 16351; + rLoc = 16503; rType = 0; vrLen = 809; vrLoc = 15799; @@ -3931,7 +3963,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 625"; rLen = 0; - rLoc = 16351; + rLoc = 16503; rType = 0; vrLen = 809; vrLoc = 15799; @@ -3951,7 +3983,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 635"; rLen = 0; - rLoc = 16582; + rLoc = 16734; rType = 0; vrLen = 725; vrLoc = 16332; @@ -3991,7 +4023,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 1188"; rLen = 0; - rLoc = 30462; + rLoc = 30614; rType = 0; vrLen = 567; vrLoc = 29809; @@ -4001,7 +4033,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 630"; rLen = 0; - rLoc = 16511; + rLoc = 16663; rType = 0; vrLen = 616; vrLoc = 16222; @@ -4041,7 +4073,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 1188"; rLen = 0; - rLoc = 30462; + rLoc = 30614; rType = 0; vrLen = 567; vrLoc = 29809; @@ -4081,7 +4113,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 1194"; rLen = 0; - rLoc = 30462; + rLoc = 30614; rType = 0; vrLen = 558; vrLoc = 29894; @@ -4091,7 +4123,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 1141"; rLen = 0; - rLoc = 28972; + rLoc = 29124; rType = 0; vrLen = 1015; vrLoc = 28576; @@ -4121,7 +4153,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 129"; rLen = 0; - rLoc = 3256; + rLoc = 3252; rType = 0; vrLen = 962; vrLoc = 2045; @@ -4131,7 +4163,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 1141"; rLen = 0; - rLoc = 28972; + rLoc = 29124; rType = 0; vrLen = 1015; vrLoc = 28576; @@ -4161,7 +4193,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 28"; rLen = 0; - rLoc = 820; + rLoc = 816; rType = 0; vrLen = 657; vrLoc = 63; @@ -4181,7 +4213,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 129"; rLen = 0; - rLoc = 3256; + rLoc = 3252; rType = 0; vrLen = 962; vrLoc = 2045; @@ -4201,7 +4233,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 128"; rLen = 0; - rLoc = 2874; + rLoc = 2870; rType = 0; vrLen = 991; vrLoc = 2045; @@ -4241,7 +4273,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 320"; rLen = 0; - rLoc = 8182; + rLoc = 8174; rType = 0; vrLen = 975; vrLoc = 7173; @@ -4251,7 +4283,7 @@ comments = "error: 'curRef' was not declared in this scope"; fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; rLen = 1; - rLoc = 1144; + rLoc = 1155; rType = 1; }; 6BA1E90710C7D850008007F6 /* PBXTextBookmark */ = { @@ -4259,7 +4291,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 155"; rLen = 0; - rLoc = 4452; + rLoc = 4448; rType = 0; vrLen = 808; vrLoc = 2731; @@ -4279,7 +4311,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 160"; rLen = 0; - rLoc = 3984; + rLoc = 3980; rType = 0; vrLen = 949; vrLoc = 2843; @@ -4309,7 +4341,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 168"; rLen = 0; - rLoc = 4452; + rLoc = 4448; rType = 0; vrLen = 953; vrLoc = 2976; @@ -4329,7 +4361,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 320"; rLen = 0; - rLoc = 8182; + rLoc = 8174; rType = 0; vrLen = 975; vrLoc = 7173; @@ -4339,7 +4371,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 1145"; rLen = 0; - rLoc = 29089; + rLoc = 29241; rType = 0; vrLen = 830; vrLoc = 28675; @@ -4349,7 +4381,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 1165"; rLen = 0; - rLoc = 29702; + rLoc = 29854; rType = 0; vrLen = 806; vrLoc = 29138; @@ -4369,7 +4401,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 320"; rLen = 0; - rLoc = 8182; + rLoc = 8174; rType = 0; vrLen = 993; vrLoc = 7160; @@ -4379,7 +4411,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 1165"; rLen = 0; - rLoc = 29702; + rLoc = 29854; rType = 0; vrLen = 806; vrLoc = 29138; @@ -4399,7 +4431,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 187"; rLen = 0; - rLoc = 4666; + rLoc = 4662; rType = 0; vrLen = 665; vrLoc = 3810; @@ -4409,7 +4441,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 150"; rLen = 0; - rLoc = 3639; + rLoc = 3635; rType = 0; vrLen = 905; vrLoc = 2866; @@ -4419,7 +4451,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 141"; rLen = 0; - rLoc = 3310; + rLoc = 3306; rType = 0; vrLen = 907; vrLoc = 2866; @@ -4429,7 +4461,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 141"; rLen = 0; - rLoc = 3310; + rLoc = 3306; rType = 0; vrLen = 588; vrLoc = 4002; @@ -4439,7 +4471,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 180"; rLen = 0; - rLoc = 4481; + rLoc = 4477; rType = 0; vrLen = 790; vrLoc = 3750; @@ -4459,7 +4491,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 644"; rLen = 0; - rLoc = 16730; + rLoc = 16882; rType = 0; vrLen = 796; vrLoc = 16350; @@ -4469,7 +4501,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 180"; rLen = 0; - rLoc = 4481; + rLoc = 4477; rType = 0; vrLen = 790; vrLoc = 3750; @@ -4479,7 +4511,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 644"; rLen = 0; - rLoc = 16730; + rLoc = 16882; rType = 0; vrLen = 796; vrLoc = 16350; @@ -4499,7 +4531,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 1182"; rLen = 0; - rLoc = 30065; + rLoc = 30217; rType = 0; vrLen = 838; vrLoc = 29661; @@ -4509,7 +4541,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 140"; rLen = 0; - rLoc = 3256; + rLoc = 3252; rType = 0; vrLen = 1036; vrLoc = 2484; @@ -4518,7 +4550,7 @@ isa = PBXTextBookmark; fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; rLen = 0; - rLoc = 1184; + rLoc = 1195; rType = 1; }; 6BA1E93910C7DB10008007F6 /* PBXTextBookmark */ = { @@ -4526,7 +4558,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 1182"; rLen = 0; - rLoc = 30065; + rLoc = 30217; rType = 0; vrLen = 838; vrLoc = 29661; @@ -4536,7 +4568,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 140"; rLen = 0; - rLoc = 3256; + rLoc = 3252; rType = 0; vrLen = 1036; vrLoc = 2484; @@ -4546,7 +4578,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 1189"; rLen = 0; - rLoc = 30275; + rLoc = 30427; rType = 0; vrLen = 759; vrLoc = 29759; @@ -4556,7 +4588,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 1189"; rLen = 0; - rLoc = 30275; + rLoc = 30427; rType = 0; vrLen = 901; vrLoc = 29759; @@ -4566,7 +4598,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 140"; rLen = 0; - rLoc = 3256; + rLoc = 3252; rType = 0; vrLen = 1054; vrLoc = 2479; @@ -4576,7 +4608,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 1189"; rLen = 0; - rLoc = 30275; + rLoc = 30427; rType = 0; vrLen = 901; vrLoc = 29759; @@ -4586,7 +4618,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 160"; rLen = 0; - rLoc = 3962; + rLoc = 3958; rType = 0; vrLen = 914; vrLoc = 2936; @@ -4596,7 +4628,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 160"; rLen = 0; - rLoc = 3962; + rLoc = 3958; rType = 0; vrLen = 1113; vrLoc = 2361; @@ -4605,7 +4637,7 @@ isa = PBXTextBookmark; fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; rLen = 0; - rLoc = 1195; + rLoc = 1206; rType = 1; }; 6BA1E94610C7DB45008007F6 /* PBXTextBookmark */ = { @@ -4613,7 +4645,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 160"; rLen = 0; - rLoc = 3962; + rLoc = 3958; rType = 0; vrLen = 1113; vrLoc = 2361; @@ -4623,7 +4655,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 1196"; rLen = 0; - rLoc = 30492; + rLoc = 30644; rType = 0; vrLen = 841; vrLoc = 29819; @@ -4633,7 +4665,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 1196"; rLen = 0; - rLoc = 30492; + rLoc = 30644; rType = 0; vrLen = 841; vrLoc = 29819; @@ -4650,7 +4682,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 1196"; rLen = 0; - rLoc = 30492; + rLoc = 30644; rType = 0; vrLen = 841; vrLoc = 29819; @@ -4660,7 +4692,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 137"; rLen = 0; - rLoc = 3182; + rLoc = 3178; rType = 0; vrLen = 1113; vrLoc = 2361; @@ -4670,7 +4702,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 132"; rLen = 0; - rLoc = 3108; + rLoc = 3104; rType = 0; vrLen = 1112; vrLoc = 2361; @@ -4680,7 +4712,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 132"; rLen = 0; - rLoc = 3108; + rLoc = 3104; rType = 0; vrLen = 971; vrLoc = 2561; @@ -4690,7 +4722,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 147"; rLen = 0; - rLoc = 3537; + rLoc = 3533; rType = 0; vrLen = 854; vrLoc = 2902; @@ -4700,7 +4732,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 162"; rLen = 0; - rLoc = 3769; + rLoc = 3765; rType = 0; vrLen = 728; vrLoc = 3915; @@ -4710,7 +4742,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 201"; rLen = 0; - rLoc = 4452; + rLoc = 4448; rType = 0; vrLen = 640; vrLoc = 4046; @@ -4720,7 +4752,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 1097"; rLen = 0; - rLoc = 28015; + rLoc = 28167; rType = 0; vrLen = 776; vrLoc = 25780; @@ -4730,7 +4762,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 203"; rLen = 0; - rLoc = 4452; + rLoc = 4448; rType = 0; vrLen = 677; vrLoc = 4046; @@ -4740,7 +4772,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 203"; rLen = 0; - rLoc = 4452; + rLoc = 4448; rType = 0; vrLen = 677; vrLoc = 4046; @@ -4750,7 +4782,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 1097"; rLen = 0; - rLoc = 28015; + rLoc = 28167; rType = 0; vrLen = 776; vrLoc = 25780; @@ -4760,7 +4792,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 205"; rLen = 0; - rLoc = 4470; + rLoc = 4466; rType = 0; vrLen = 640; vrLoc = 4046; @@ -4770,7 +4802,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 977"; rLen = 0; - rLoc = 25230; + rLoc = 25382; rType = 0; vrLen = 692; vrLoc = 28068; @@ -4790,7 +4822,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 156"; rLen = 0; - rLoc = 3639; + rLoc = 3635; rType = 0; vrLen = 769; vrLoc = 3008; @@ -4800,7 +4832,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 205"; rLen = 0; - rLoc = 4470; + rLoc = 4466; rType = 0; vrLen = 923; vrLoc = 2600; @@ -4810,7 +4842,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 977"; rLen = 0; - rLoc = 25230; + rLoc = 25382; rType = 0; vrLen = 692; vrLoc = 28068; @@ -4820,7 +4852,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 156"; rLen = 0; - rLoc = 3639; + rLoc = 3635; rType = 0; vrLen = 769; vrLoc = 3008; @@ -4840,7 +4872,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 162"; rLen = 0; - rLoc = 3734; + rLoc = 3730; rType = 0; vrLen = 775; vrLoc = 3008; @@ -4850,7 +4882,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 178"; rLen = 0; - rLoc = 4095; + rLoc = 4091; rType = 0; vrLen = 733; vrLoc = 3625; @@ -4860,7 +4892,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 175"; rLen = 0; - rLoc = 4066; + rLoc = 4062; rType = 0; vrLen = 740; vrLoc = 3625; @@ -4870,7 +4902,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 171"; rLen = 0; - rLoc = 4066; + rLoc = 4062; rType = 0; vrLen = 941; vrLoc = 3288; @@ -4880,7 +4912,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 171"; rLen = 0; - rLoc = 4066; + rLoc = 4062; rType = 0; vrLen = 566; vrLoc = 4247; @@ -4890,7 +4922,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 199"; rLen = 0; - rLoc = 4725; + rLoc = 4721; rType = 0; vrLen = 699; vrLoc = 4049; @@ -4900,7 +4932,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 139"; rLen = 0; - rLoc = 3255; + rLoc = 3251; rType = 0; vrLen = 1022; vrLoc = 2930; @@ -4948,7 +4980,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 343"; rLen = 0; - rLoc = 8067; + rLoc = 8059; rType = 0; vrLen = 874; vrLoc = 7781; @@ -4958,7 +4990,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 321"; rLen = 0; - rLoc = 7422; + rLoc = 7414; rType = 0; vrLen = 872; vrLoc = 7461; @@ -4968,7 +5000,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 322"; rLen = 0; - rLoc = 7422; + rLoc = 7414; rType = 0; vrLen = 874; vrLoc = 7461; @@ -4988,7 +5020,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 161"; rLen = 0; - rLoc = 3658; + rLoc = 3654; rType = 0; vrLen = 765; vrLoc = 3537; @@ -4998,7 +5030,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 320"; rLen = 0; - rLoc = 7719; + rLoc = 7711; rType = 0; vrLen = 1073; vrLoc = 7393; @@ -5008,7 +5040,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 333"; rLen = 0; - rLoc = 8122; + rLoc = 8114; rType = 0; vrLen = 1132; vrLoc = 7286; @@ -5018,7 +5050,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 323"; rLen = 0; - rLoc = 7856; + rLoc = 7848; rType = 0; vrLen = 1132; vrLoc = 7286; @@ -5028,7 +5060,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 331"; rLen = 0; - rLoc = 8021; + rLoc = 8013; rType = 0; vrLen = 1099; vrLoc = 7327; @@ -5038,7 +5070,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 329"; rLen = 0; - rLoc = 7969; + rLoc = 7961; rType = 0; vrLen = 1099; vrLoc = 7327; @@ -5048,7 +5080,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 320"; rLen = 0; - rLoc = 7698; + rLoc = 7690; rType = 0; vrLen = 1114; vrLoc = 7327; @@ -5058,7 +5090,7 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 319"; rLen = 0; - rLoc = 7671; + rLoc = 7663; rType = 0; vrLen = 1152; vrLoc = 7327; @@ -5068,11 +5100,81 @@ fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; name = "Sample_SoloMesh.cpp: 335"; rLen = 0; - rLoc = 8158; + rLoc = 8150; rType = 0; vrLen = 969; vrLoc = 7547; }; + 6BB4964410C8ECF300BC0805 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; + name = "Sample_SoloMesh.cpp: 335"; + rLen = 0; + rLoc = 8150; + rType = 0; + vrLen = 969; + vrLoc = 7547; + }; + 6BB4964510C8ECF300BC0805 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B2AEC510FFB8946005BE9CC /* Sample_TileMesh.h */; + name = "Sample_TileMesh.h: 45"; + rLen = 41; + rLoc = 1441; + rType = 0; + vrLen = 548; + vrLoc = 1072; + }; + 6BB4964610C8ECF300BC0805 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BA1E88910C7BFC9008007F6 /* Sample_SoloMeshTiled.cpp */; + name = "Sample_SoloMeshTiled.cpp: 20"; + rLen = 0; + rLoc = 410; + rType = 0; + vrLen = 668; + vrLoc = 83; + }; + 6BB4964710C8ECF300BC0805 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B1185FC10068B040018F96F /* DetourCommon.h */; + name = "DetourCommon.h: 135"; + rLen = 295; + rLoc = 3546; + rType = 0; + vrLen = 594; + vrLoc = 3382; + }; + 6BB4964810C8ECF300BC0805 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B2AEC520FFB8958005BE9CC /* Sample_TileMesh.cpp */; + name = "Sample_TileMesh.cpp: 28"; + rLen = 0; + rLoc = 1130; + rType = 0; + vrLen = 1123; + vrLoc = 202; + }; + 6BB4964910C8ECF300BC0805 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B25B6180FFA62BE004F1BC4 /* main.cpp */; + name = "main.cpp: 201"; + rLen = 0; + rLoc = 4116; + rType = 0; + vrLen = 876; + vrLoc = 3910; + }; + 6BB4964A10C8ECF300BC0805 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B25B6180FFA62BE004F1BC4 /* main.cpp */; + name = "main.cpp: 21"; + rLen = 0; + rLoc = 390; + rType = 0; + vrLen = 627; + vrLoc = 0; + }; 6BB788160FC0472B003C24DB /* ChunkyTriMesh.cpp */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {915, 3680}}"; @@ -5089,12 +5191,18 @@ }; 6BDD9E040F91112200904EEF /* DetourDebugDraw.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {915, 576}}"; - sepNavSelRange = "{1465, 0}"; - sepNavVisRange = "{3, 1652}"; + sepNavIntBoundsRect = "{{0, 0}, {915, 489}}"; + sepNavSelRange = "{1077, 54}"; + sepNavVisRange = "{0, 1244}"; }; }; 6BDD9E050F91112200904EEF /* DetourStatNavMesh.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = DetourStatNavMesh.h; + path = /Users/memon/Code/recastnavigation/Detour/Include/DetourStatNavMesh.h; + sourceTree = ""; uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {915, 3440}}"; sepNavSelRange = "{8514, 47}"; @@ -5102,6 +5210,12 @@ }; }; 6BDD9E060F91112200904EEF /* DetourStatNavMeshBuilder.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = DetourStatNavMeshBuilder.h; + path = /Users/memon/Code/recastnavigation/Detour/Include/DetourStatNavMeshBuilder.h; + sourceTree = ""; uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {915, 559}}"; sepNavSelRange = "{822, 0}"; @@ -5110,12 +5224,18 @@ }; 6BDD9E070F91113800904EEF /* DetourDebugDraw.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {915, 12192}}"; - sepNavSelRange = "{14721, 0}"; - sepNavVisRange = "{14492, 610}"; + sepNavIntBoundsRect = "{{0, 0}, {915, 7744}}"; + sepNavSelRange = "{5797, 0}"; + sepNavVisRange = "{8947, 837}"; }; }; 6BDD9E080F91113800904EEF /* DetourStatNavMesh.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = DetourStatNavMesh.cpp; + path = /Users/memon/Code/recastnavigation/Detour/Source/DetourStatNavMesh.cpp; + sourceTree = ""; uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {915, 14928}}"; sepNavSelRange = "{23286, 0}"; @@ -5123,6 +5243,12 @@ }; }; 6BDD9E090F91113800904EEF /* DetourStatNavMeshBuilder.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = DetourStatNavMeshBuilder.cpp; + path = /Users/memon/Code/recastnavigation/Detour/Source/DetourStatNavMeshBuilder.cpp; + sourceTree = ""; uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {915, 5200}}"; sepNavSelRange = "{8381, 101}"; @@ -5145,7 +5271,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 541"; rLen = 90; - rLoc = 14678; + rLoc = 14830; rType = 0; vrLen = 838; vrLoc = 13296; @@ -5175,7 +5301,7 @@ fRef = 6B2AEC520FFB8958005BE9CC /* Sample_TileMesh.cpp */; name = "Sample_TileMesh.cpp: 558"; rLen = 0; - rLoc = 14408; + rLoc = 1099; rType = 0; vrLen = 1067; vrLoc = 13902; diff --git a/RecastDemo/Build/Xcode/Recast.xcodeproj/project.pbxproj b/RecastDemo/Build/Xcode/Recast.xcodeproj/project.pbxproj index 8b905cb..0820b62 100644 --- a/RecastDemo/Build/Xcode/Recast.xcodeproj/project.pbxproj +++ b/RecastDemo/Build/Xcode/Recast.xcodeproj/project.pbxproj @@ -9,7 +9,6 @@ /* Begin PBXBuildFile section */ 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; }; 6B024C0D10060AC600CF7107 /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 6B024C0C10060AC600CF7107 /* Icon.icns */; }; - 6B092B940FFCC2BD0088D3A5 /* DetourTileNavMeshBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B092B930FFCC2BD0088D3A5 /* DetourTileNavMeshBuilder.cpp */; }; 6B1185F51006895B0018F96F /* DetourNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B1185F41006895B0018F96F /* DetourNode.cpp */; }; 6B1185FE10068B150018F96F /* DetourCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B1185FD10068B150018F96F /* DetourCommon.cpp */; }; 6B137C710F7FCBBB00459200 /* imgui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B137C6C0F7FCBBB00459200 /* imgui.cpp */; }; @@ -27,21 +26,17 @@ 6B25B6190FFA62BE004F1BC4 /* Sample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B25B6140FFA62BE004F1BC4 /* Sample.cpp */; }; 6B25B61D0FFA62BE004F1BC4 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B25B6180FFA62BE004F1BC4 /* main.cpp */; }; 6B2AEC530FFB8958005BE9CC /* Sample_TileMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B2AEC520FFB8958005BE9CC /* Sample_TileMesh.cpp */; }; - 6B2AEC5A0FFB8A7A005BE9CC /* DetourTileNavMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B2AEC590FFB8A7A005BE9CC /* DetourTileNavMesh.cpp */; }; 6B555DB1100B212E00247EA3 /* imguiRenderGL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B555DB0100B212E00247EA3 /* imguiRenderGL.cpp */; }; 6B62416A103434880002E346 /* RecastMeshDetail.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B624169103434880002E346 /* RecastMeshDetail.cpp */; }; 6B8632DA0F78122C00E2684A /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B8632D90F78122C00E2684A /* SDL.framework */; }; 6B8632DC0F78123E00E2684A /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B8632DB0F78123E00E2684A /* OpenGL.framework */; }; 6B8DE88910B69E3E00DF20FB /* DetourNavMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; }; 6B8DE88A10B69E3E00DF20FB /* DetourNavMeshBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B8DE88810B69E3E00DF20FB /* DetourNavMeshBuilder.cpp */; }; - 6B8DE8F810B6B70E00DF20FB /* Sample_DynMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B8DE8F710B6B70E00DF20FB /* Sample_DynMesh.cpp */; }; 6BA1E88A10C7BFC9008007F6 /* Sample_SoloMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */; }; 6BA1E88B10C7BFC9008007F6 /* Sample_SoloMeshSimple.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BA1E88810C7BFC9008007F6 /* Sample_SoloMeshSimple.cpp */; }; 6BA1E88C10C7BFC9008007F6 /* Sample_SoloMeshTiled.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BA1E88910C7BFC9008007F6 /* Sample_SoloMeshTiled.cpp */; }; 6BB788170FC0472B003C24DB /* ChunkyTriMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BB788160FC0472B003C24DB /* ChunkyTriMesh.cpp */; }; 6BDD9E0A0F91113800904EEF /* DetourDebugDraw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BDD9E070F91113800904EEF /* DetourDebugDraw.cpp */; }; - 6BDD9E0B0F91113800904EEF /* DetourStatNavMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BDD9E080F91113800904EEF /* DetourStatNavMesh.cpp */; }; - 6BDD9E0C0F91113800904EEF /* DetourStatNavMeshBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BDD9E090F91113800904EEF /* DetourStatNavMeshBuilder.cpp */; }; 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; /* End PBXBuildFile section */ @@ -55,8 +50,6 @@ 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 32CA4F630368D1EE00C91783 /* Recast_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Recast_Prefix.pch; sourceTree = ""; }; 6B024C0C10060AC600CF7107 /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = ""; }; - 6B092B920FFCC2AC0088D3A5 /* DetourTileNavMeshBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetourTileNavMeshBuilder.h; path = ../../../Detour/Include/DetourTileNavMeshBuilder.h; sourceTree = SOURCE_ROOT; }; - 6B092B930FFCC2BD0088D3A5 /* DetourTileNavMeshBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DetourTileNavMeshBuilder.cpp; path = ../../../Detour/Source/DetourTileNavMeshBuilder.cpp; sourceTree = SOURCE_ROOT; }; 6B1185F41006895B0018F96F /* DetourNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DetourNode.cpp; path = ../../../Detour/Source/DetourNode.cpp; sourceTree = SOURCE_ROOT; }; 6B1185F61006896B0018F96F /* DetourNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetourNode.h; path = ../../../Detour/Include/DetourNode.h; sourceTree = SOURCE_ROOT; }; 6B1185FC10068B040018F96F /* DetourCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetourCommon.h; path = ../../../Detour/Include/DetourCommon.h; sourceTree = SOURCE_ROOT; }; @@ -85,8 +78,6 @@ 6B25B6180FFA62BE004F1BC4 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = ../../Source/main.cpp; sourceTree = SOURCE_ROOT; }; 6B2AEC510FFB8946005BE9CC /* Sample_TileMesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Sample_TileMesh.h; path = ../../Include/Sample_TileMesh.h; sourceTree = SOURCE_ROOT; }; 6B2AEC520FFB8958005BE9CC /* Sample_TileMesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Sample_TileMesh.cpp; path = ../../Source/Sample_TileMesh.cpp; sourceTree = SOURCE_ROOT; }; - 6B2AEC580FFB8A68005BE9CC /* DetourTileNavMesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetourTileNavMesh.h; path = ../../../Detour/Include/DetourTileNavMesh.h; sourceTree = SOURCE_ROOT; }; - 6B2AEC590FFB8A7A005BE9CC /* DetourTileNavMesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DetourTileNavMesh.cpp; path = ../../../Detour/Source/DetourTileNavMesh.cpp; sourceTree = SOURCE_ROOT; }; 6B555DAE100B211D00247EA3 /* imguiRenderGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imguiRenderGL.h; path = ../../Include/imguiRenderGL.h; sourceTree = SOURCE_ROOT; }; 6B555DB0100B212E00247EA3 /* imguiRenderGL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = imguiRenderGL.cpp; path = ../../Source/imguiRenderGL.cpp; sourceTree = SOURCE_ROOT; }; 6B555DF6100B273500247EA3 /* stb_truetype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stb_truetype.h; path = ../../Contrib/stb_truetype.h; sourceTree = SOURCE_ROOT; }; @@ -97,8 +88,6 @@ 6B8DE88810B69E3E00DF20FB /* DetourNavMeshBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DetourNavMeshBuilder.cpp; path = ../../../Detour/Source/DetourNavMeshBuilder.cpp; sourceTree = SOURCE_ROOT; }; 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetourNavMesh.h; path = ../../../Detour/Include/DetourNavMesh.h; sourceTree = SOURCE_ROOT; }; 6B8DE88C10B69E4C00DF20FB /* DetourNavMeshBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetourNavMeshBuilder.h; path = ../../../Detour/Include/DetourNavMeshBuilder.h; sourceTree = SOURCE_ROOT; }; - 6B8DE8F610B6B70100DF20FB /* Sample_DynMesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Sample_DynMesh.h; path = ../../Include/Sample_DynMesh.h; sourceTree = SOURCE_ROOT; }; - 6B8DE8F710B6B70E00DF20FB /* Sample_DynMesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Sample_DynMesh.cpp; path = ../../Source/Sample_DynMesh.cpp; sourceTree = SOURCE_ROOT; }; 6BA1E88710C7BFC9008007F6 /* Sample_SoloMesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Sample_SoloMesh.cpp; path = ../../Source/Sample_SoloMesh.cpp; sourceTree = SOURCE_ROOT; }; 6BA1E88810C7BFC9008007F6 /* Sample_SoloMeshSimple.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Sample_SoloMeshSimple.cpp; path = ../../Source/Sample_SoloMeshSimple.cpp; sourceTree = SOURCE_ROOT; }; 6BA1E88910C7BFC9008007F6 /* Sample_SoloMeshTiled.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Sample_SoloMeshTiled.cpp; path = ../../Source/Sample_SoloMeshTiled.cpp; sourceTree = SOURCE_ROOT; }; @@ -108,11 +97,7 @@ 6BB788160FC0472B003C24DB /* ChunkyTriMesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ChunkyTriMesh.cpp; path = ../../Source/ChunkyTriMesh.cpp; sourceTree = SOURCE_ROOT; }; 6BB788180FC04753003C24DB /* ChunkyTriMesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ChunkyTriMesh.h; path = ../../Include/ChunkyTriMesh.h; sourceTree = SOURCE_ROOT; }; 6BDD9E040F91112200904EEF /* DetourDebugDraw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetourDebugDraw.h; path = ../../../Detour/Include/DetourDebugDraw.h; sourceTree = SOURCE_ROOT; }; - 6BDD9E050F91112200904EEF /* DetourStatNavMesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetourStatNavMesh.h; path = ../../../Detour/Include/DetourStatNavMesh.h; sourceTree = SOURCE_ROOT; }; - 6BDD9E060F91112200904EEF /* DetourStatNavMeshBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetourStatNavMeshBuilder.h; path = ../../../Detour/Include/DetourStatNavMeshBuilder.h; sourceTree = SOURCE_ROOT; }; 6BDD9E070F91113800904EEF /* DetourDebugDraw.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DetourDebugDraw.cpp; path = ../../../Detour/Source/DetourDebugDraw.cpp; sourceTree = SOURCE_ROOT; }; - 6BDD9E080F91113800904EEF /* DetourStatNavMesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DetourStatNavMesh.cpp; path = ../../../Detour/Source/DetourStatNavMesh.cpp; sourceTree = SOURCE_ROOT; }; - 6BDD9E090F91113800904EEF /* DetourStatNavMeshBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DetourStatNavMeshBuilder.cpp; path = ../../../Detour/Source/DetourStatNavMeshBuilder.cpp; sourceTree = SOURCE_ROOT; }; 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8D1107320486CEB800E47090 /* Recast.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Recast.app; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -253,8 +238,6 @@ 6BA1E88910C7BFC9008007F6 /* Sample_SoloMeshTiled.cpp */, 6B25B6100FFA62AD004F1BC4 /* Sample.h */, 6B25B6140FFA62BE004F1BC4 /* Sample.cpp */, - 6B8DE8F610B6B70100DF20FB /* Sample_DynMesh.h */, - 6B8DE8F710B6B70E00DF20FB /* Sample_DynMesh.cpp */, 6B2AEC510FFB8946005BE9CC /* Sample_TileMesh.h */, 6B2AEC520FFB8958005BE9CC /* Sample_TileMesh.cpp */, ); @@ -270,14 +253,6 @@ 6B8DE88810B69E3E00DF20FB /* DetourNavMeshBuilder.cpp */, 6BDD9E040F91112200904EEF /* DetourDebugDraw.h */, 6BDD9E070F91113800904EEF /* DetourDebugDraw.cpp */, - 6BDD9E050F91112200904EEF /* DetourStatNavMesh.h */, - 6BDD9E080F91113800904EEF /* DetourStatNavMesh.cpp */, - 6BDD9E060F91112200904EEF /* DetourStatNavMeshBuilder.h */, - 6BDD9E090F91113800904EEF /* DetourStatNavMeshBuilder.cpp */, - 6B2AEC580FFB8A68005BE9CC /* DetourTileNavMesh.h */, - 6B2AEC590FFB8A7A005BE9CC /* DetourTileNavMesh.cpp */, - 6B092B920FFCC2AC0088D3A5 /* DetourTileNavMeshBuilder.h */, - 6B092B930FFCC2BD0088D3A5 /* DetourTileNavMeshBuilder.cpp */, 6B1185F61006896B0018F96F /* DetourNode.h */, 6B1185F41006895B0018F96F /* DetourNode.cpp */, 6B1185FC10068B040018F96F /* DetourCommon.h */, @@ -355,21 +330,16 @@ 6B137C920F7FCC1100459200 /* RecastRegion.cpp in Sources */, 6B137C930F7FCC1100459200 /* RecastTimer.cpp in Sources */, 6BDD9E0A0F91113800904EEF /* DetourDebugDraw.cpp in Sources */, - 6BDD9E0B0F91113800904EEF /* DetourStatNavMesh.cpp in Sources */, - 6BDD9E0C0F91113800904EEF /* DetourStatNavMeshBuilder.cpp in Sources */, 6BB788170FC0472B003C24DB /* ChunkyTriMesh.cpp in Sources */, 6B25B6190FFA62BE004F1BC4 /* Sample.cpp in Sources */, 6B25B61D0FFA62BE004F1BC4 /* main.cpp in Sources */, 6B2AEC530FFB8958005BE9CC /* Sample_TileMesh.cpp in Sources */, - 6B2AEC5A0FFB8A7A005BE9CC /* DetourTileNavMesh.cpp in Sources */, - 6B092B940FFCC2BD0088D3A5 /* DetourTileNavMeshBuilder.cpp in Sources */, 6B1185F51006895B0018F96F /* DetourNode.cpp in Sources */, 6B1185FE10068B150018F96F /* DetourCommon.cpp in Sources */, 6B555DB1100B212E00247EA3 /* imguiRenderGL.cpp in Sources */, 6B62416A103434880002E346 /* RecastMeshDetail.cpp in Sources */, 6B8DE88910B69E3E00DF20FB /* DetourNavMesh.cpp in Sources */, 6B8DE88A10B69E3E00DF20FB /* DetourNavMeshBuilder.cpp in Sources */, - 6B8DE8F810B6B70E00DF20FB /* Sample_DynMesh.cpp in Sources */, 6BA1E88A10C7BFC9008007F6 /* Sample_SoloMesh.cpp in Sources */, 6BA1E88B10C7BFC9008007F6 /* Sample_SoloMeshSimple.cpp in Sources */, 6BA1E88C10C7BFC9008007F6 /* Sample_SoloMeshTiled.cpp in Sources */, diff --git a/RecastDemo/Include/Sample_DynMesh.h b/RecastDemo/Include/Sample_DynMesh.h deleted file mode 100644 index b49f619..0000000 --- a/RecastDemo/Include/Sample_DynMesh.h +++ /dev/null @@ -1,114 +0,0 @@ -// -// Copyright (c) 2009 Mikko Mononen memon@inside.org -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. -// - -#ifndef RECASTSAMPLEDYNMESH_H -#define RECASTSAMPLEDYNMESH_H - -#include "Sample.h" -#include "DetourNavMesh.h" -#include "Recast.h" -#include "RecastLog.h" -#include "ChunkyTriMesh.h" - -class Sample_DynMesh : public Sample -{ -protected: - - bool m_keepInterResults; - rcBuildTimes m_buildTimes; - - dtNavMesh* m_navMesh; - rcChunkyTriMesh* m_chunkyMesh; - unsigned char* m_triflags; - rcHeightfield* m_solid; - rcCompactHeightfield* m_chf; - rcContourSet* m_cset; - rcPolyMesh* m_pmesh; - rcPolyMeshDetail* m_dmesh; - rcConfig m_cfg; - - float m_tileSize; - - float m_spos[3]; - float m_epos[3]; - bool m_sposSet; - bool m_eposSet; - - float m_tileCol[4]; - float m_tileBmin[3]; - float m_tileBmax[3]; - float m_tileBuildTime; - float m_tileMemUsage; - int m_tileTriCount; - - enum ToolMode - { - TOOLMODE_CREATE_TILES, - TOOLMODE_PATHFIND, - TOOLMODE_RAYCAST, - TOOLMODE_DISTANCE_TO_WALL, - TOOLMODE_FIND_POLYS_AROUND, - }; - - dtPolyRef m_startRef; - dtPolyRef m_endRef; - float m_polyPickExt[3]; - - static const int MAX_POLYS = 256; - - dtPolyRef m_polys[MAX_POLYS]; - dtPolyRef m_parent[MAX_POLYS]; - int m_npolys; - float m_straightPath[MAX_POLYS*3]; - int m_nstraightPath; - float m_hitPos[3]; - float m_hitNormal[3]; - float m_distanceToWall; - - ToolMode m_toolMode; - - void toolRecalc(); - - void buildTile(const float* pos); - void removeTile(const float* pos); - - unsigned char* buildTileMesh(const float* bmin, const float* bmax, int& dataSize); - - void cleanup(); - -public: - Sample_DynMesh(); - virtual ~Sample_DynMesh(); - - virtual void handleSettings(); - virtual void handleTools(); - virtual void handleDebugMode(); - - virtual void setToolStartPos(const float* p); - virtual void setToolEndPos(const float* p); - - virtual void handleRender(); - virtual void handleRenderOverlay(double* proj, double* model, int* view); - virtual void handleMeshChanged(const float* verts, int nverts, - const int* tris, const float* trinorms, int ntris, - const float* bmin, const float* bmax); - virtual bool handleBuild(); -}; - - -#endif // RECASTSAMPLEDYNMESH_H diff --git a/RecastDemo/Include/Sample_SoloMeshSimple.h b/RecastDemo/Include/Sample_SoloMeshSimple.h index 466526b..4dbf7bc 100644 --- a/RecastDemo/Include/Sample_SoloMeshSimple.h +++ b/RecastDemo/Include/Sample_SoloMeshSimple.h @@ -2,7 +2,7 @@ #define RECASTSAMPLESOLOMESHSIMPLE_H #include "Sample_SoloMesh.h" -#include "DetourStatNavMesh.h" +#include "DetourNavMesh.h" #include "Recast.h" #include "RecastLog.h" diff --git a/RecastDemo/Include/Sample_SoloMeshTiled.h b/RecastDemo/Include/Sample_SoloMeshTiled.h index 255c396..331a1b9 100644 --- a/RecastDemo/Include/Sample_SoloMeshTiled.h +++ b/RecastDemo/Include/Sample_SoloMeshTiled.h @@ -2,7 +2,7 @@ #define RECASTSAMPLESOLOMESHTILED_H #include "Sample_SoloMesh.h" -#include "DetourStatNavMesh.h" +#include "DetourNavMesh.h" #include "Recast.h" #include "RecastLog.h" #include "ChunkyTriMesh.h" diff --git a/RecastDemo/Include/Sample_TileMesh.h b/RecastDemo/Include/Sample_TileMesh.h index 2cb8fcd..9c46295 100644 --- a/RecastDemo/Include/Sample_TileMesh.h +++ b/RecastDemo/Include/Sample_TileMesh.h @@ -16,11 +16,11 @@ // 3. This notice may not be removed or altered from any source distribution. // -#ifndef RECASTSAMPLETILEDMESH_H -#define RECASTSAMPLETILEDMESH_H +#ifndef RECASTSAMPLETILEMESH_H +#define RECASTSAMPLETILEMESH_H #include "Sample.h" -#include "DetourTileNavMesh.h" +#include "DetourNavMesh.h" #include "Recast.h" #include "RecastLog.h" #include "ChunkyTriMesh.h" @@ -31,8 +31,8 @@ protected: bool m_keepInterResults; rcBuildTimes m_buildTimes; - - dtTiledNavMesh* m_navMesh; + + dtNavMesh* m_navMesh; rcChunkyTriMesh* m_chunkyMesh; unsigned char* m_triflags; rcHeightfield* m_solid; @@ -42,8 +42,11 @@ protected: rcPolyMeshDetail* m_dmesh; rcConfig m_cfg; + int m_maxTiles; + int m_maxPolysPerTile; + float m_tileSize; - + float m_spos[3]; float m_epos[3]; bool m_sposSet; @@ -65,14 +68,14 @@ protected: TOOLMODE_FIND_POLYS_AROUND, }; - dtTilePolyRef m_startRef; - dtTilePolyRef m_endRef; + dtPolyRef m_startRef; + dtPolyRef m_endRef; float m_polyPickExt[3]; - + static const int MAX_POLYS = 256; - dtTilePolyRef m_polys[MAX_POLYS]; - dtTilePolyRef m_parent[MAX_POLYS]; + dtPolyRef m_polys[MAX_POLYS]; + dtPolyRef m_parent[MAX_POLYS]; int m_npolys; float m_straightPath[MAX_POLYS*3]; int m_nstraightPath; @@ -88,7 +91,7 @@ protected: void removeTile(const float* pos); unsigned char* buildTileMesh(const float* bmin, const float* bmax, int& dataSize); - + void cleanup(); public: @@ -111,4 +114,4 @@ public: }; -#endif // RECASTBUILDERTILEDMESH_H +#endif // RECASTSAMPLETILEMESH_H diff --git a/RecastDemo/Source/Sample_DynMesh.cpp b/RecastDemo/Source/Sample_DynMesh.cpp deleted file mode 100644 index 7a605bb..0000000 --- a/RecastDemo/Source/Sample_DynMesh.cpp +++ /dev/null @@ -1,931 +0,0 @@ -// -// Copyright (c) 2009 Mikko Mononen memon@inside.org -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. -// - -#define _USE_MATH_DEFINES -#include -#include -#include -#include "SDL.h" -#include "SDL_opengl.h" -#include "imgui.h" -#include "Sample.h" -#include "Sample_DynMesh.h" -#include "Recast.h" -#include "RecastTimer.h" -#include "RecastDebugDraw.h" -#include "DetourNavMesh.h" -#include "DetourNavMeshBuilder.h" -#include "DetourDebugDraw.h" - -#ifdef WIN32 -# define snprintf _snprintf -#endif - - -Sample_DynMesh::Sample_DynMesh() : - m_keepInterResults(false), - m_navMesh(0), - m_chunkyMesh(0), - m_triflags(0), - m_solid(0), - m_chf(0), - m_cset(0), - m_pmesh(0), - m_dmesh(0), - m_tileSize(32), - m_sposSet(false), - m_eposSet(false), - m_tileBuildTime(0), - m_tileMemUsage(0), - m_tileTriCount(0), - m_startRef(0), - m_endRef(0), - m_npolys(0), - m_nstraightPath(0), - m_distanceToWall(0), - m_toolMode(TOOLMODE_CREATE_TILES) -{ - resetCommonSettings(); - memset(m_tileBmin, 0, sizeof(m_tileBmin)); - memset(m_tileBmax, 0, sizeof(m_tileBmax)); - m_polyPickExt[0] = 2; - m_polyPickExt[1] = 4; - m_polyPickExt[2] = 2; -} - -Sample_DynMesh::~Sample_DynMesh() -{ - cleanup(); - delete m_navMesh; - delete m_chunkyMesh; -} - -void Sample_DynMesh::cleanup() -{ - delete [] m_triflags; - m_triflags = 0; - delete m_solid; - m_solid = 0; - delete m_chf; - m_chf = 0; - delete m_cset; - m_cset = 0; - delete m_pmesh; - m_pmesh = 0; - delete m_dmesh; - m_dmesh = 0; -} - -void Sample_DynMesh::handleSettings() -{ - Sample::handleCommonSettings(); - - imguiLabel("Tiling"); - imguiSlider("TileSize", &m_tileSize, 16.0f, 1024.0f, 16.0f); - - char text[64]; - int gw = 0, gh = 0; - rcCalcGridSize(m_bmin, m_bmax, m_cellSize, &gw, &gh); - const int ts = (int)m_tileSize; - const int tw = (gw + ts-1) / ts; - const int th = (gh + ts-1) / ts; - snprintf(text, 64, "Tiles %d x %d", tw, th); - imguiValue(text); -} - -void Sample_DynMesh::toolRecalc() -{ - m_startRef = 0; - if (m_sposSet) - m_startRef = m_navMesh->findNearestPoly(m_spos, m_polyPickExt); - - m_endRef = 0; - if (m_eposSet) - m_endRef = m_navMesh->findNearestPoly(m_epos, m_polyPickExt); - - if (m_toolMode == TOOLMODE_PATHFIND) - { - if (m_sposSet && m_eposSet && m_startRef && m_endRef) - { - m_npolys = m_navMesh->findPath(m_startRef, m_endRef, m_spos, m_epos, m_polys, MAX_POLYS); - if (m_npolys) - m_nstraightPath = m_navMesh->findStraightPath(m_spos, m_epos, m_polys, m_npolys, m_straightPath, MAX_POLYS); - } - else - { - m_npolys = 0; - m_nstraightPath = 0; - } - } - else if (m_toolMode == TOOLMODE_RAYCAST) - { - m_nstraightPath = 0; - if (m_sposSet && m_eposSet && m_startRef) - { - float t = 0; - m_npolys = 0; - m_nstraightPath = 2; - m_straightPath[0] = m_spos[0]; - m_straightPath[1] = m_spos[1]; - m_straightPath[2] = m_spos[2]; - m_npolys = m_navMesh->raycast(m_startRef, m_spos, m_epos, t, m_polys, MAX_POLYS); - if (m_npolys && t < 1) - { - m_straightPath[3] = m_spos[0] + (m_epos[0] - m_spos[0]) * t; - m_straightPath[4] = m_spos[1] + (m_epos[1] - m_spos[1]) * t; - m_straightPath[5] = m_spos[2] + (m_epos[2] - m_spos[2]) * t; - } - else - { - m_straightPath[3] = m_epos[0]; - m_straightPath[4] = m_epos[1]; - m_straightPath[5] = m_epos[2]; - } - } - } - else if (m_toolMode == TOOLMODE_DISTANCE_TO_WALL) - { - m_distanceToWall = 0; - if (m_sposSet && m_startRef) - m_distanceToWall = m_navMesh->findDistanceToWall(m_startRef, m_spos, 100.0f, m_hitPos, m_hitNormal); - } - else if (m_toolMode == TOOLMODE_FIND_POLYS_AROUND) - { - if (m_sposSet && m_startRef && m_eposSet) - { - const float dx = m_epos[0] - m_spos[0]; - const float dz = m_epos[2] - m_spos[2]; - float dist = sqrtf(dx*dx + dz*dz); - m_npolys = m_navMesh->findPolysAround(m_startRef, m_spos, dist, m_polys, m_parent, 0, MAX_POLYS); - } - } - -} - -void Sample_DynMesh::handleTools() -{ - if (imguiCheck("Create Tiles", m_toolMode == TOOLMODE_CREATE_TILES)) - { - m_toolMode = TOOLMODE_CREATE_TILES; - toolRecalc(); - } - if (imguiCheck("Pathfind", m_toolMode == TOOLMODE_PATHFIND)) - { - m_toolMode = TOOLMODE_PATHFIND; - toolRecalc(); - } - if (imguiCheck("Distance to Wall", m_toolMode == TOOLMODE_DISTANCE_TO_WALL)) - { - m_toolMode = TOOLMODE_DISTANCE_TO_WALL; - toolRecalc(); - } - if (imguiCheck("Raycast", m_toolMode == TOOLMODE_RAYCAST)) - { - m_toolMode = TOOLMODE_RAYCAST; - toolRecalc(); - } - if (imguiCheck("Find Polys Around", m_toolMode == TOOLMODE_FIND_POLYS_AROUND)) - { - m_toolMode = TOOLMODE_FIND_POLYS_AROUND; - toolRecalc(); - } - if (imguiButton("Create All")) - { - int gw = 0, gh = 0; - rcCalcGridSize(m_bmin, m_bmax, m_cellSize, &gw, &gh); - const int ts = (int)m_tileSize; - const int tw = (gw + ts-1) / ts; - const int th = (gh + ts-1) / ts; - const float tcs = m_tileSize*m_cellSize; - - for (int y = 0; y < th; ++y) - { - for (int x = 0; x < tw; ++x) - { - m_tileBmin[0] = m_bmin[0] + x*tcs; - m_tileBmin[1] = m_bmin[1]; - m_tileBmin[2] = m_bmin[2] + y*tcs; - - m_tileBmax[0] = m_bmin[0] + (x+1)*tcs; - m_tileBmax[1] = m_bmax[1]; - m_tileBmax[2] = m_bmin[2] + (y+1)*tcs; - - int dataSize = 0; - unsigned char* data = buildTileMesh(m_tileBmin, m_tileBmax, dataSize); - if (data) - { - // Remove any previous data (navmesh owns and deletes the data). - m_navMesh->removeTileAt(x,y,0,0); - // Let the navmesh own the data. - if (!m_navMesh->addTileAt(x,y,data,dataSize,true)) - delete [] data; - } - } - } - - toolRecalc(); - } -} - -void Sample_DynMesh::handleDebugMode() -{ - if (m_navMesh) - { - imguiValue("Navmesh ready."); - imguiValue("Use 'Create Tiles' tool to experiment."); - imguiValue("LMB: (Re)Create tiles."); - imguiValue("LMB+SHIFT: Remove tiles."); - } - -} - -static void getPolyCenter(dtNavMesh* navMesh, dtPolyRef ref, float* center) -{ - const dtPoly* p = navMesh->getPolyByRef(ref); - if (!p) return; - const float* verts = navMesh->getPolyVertsByRef(ref); - center[0] = 0; - center[1] = 0; - center[2] = 0; - for (int i = 0; i < (int)p->nv; ++i) - { - const float* v = &verts[p->v[i]*3]; - center[0] += v[0]; - center[1] += v[1]; - center[2] += v[2]; - } - const float s = 1.0f / p->nv; - center[0] *= s; - center[1] *= s; - center[2] *= s; -} - -void Sample_DynMesh::handleRender() -{ - if (!m_verts || !m_tris || !m_trinorms) - return; - - DebugDrawGL dd; - - // Draw mesh - if (m_navMesh) - rcDebugDrawMesh(&dd, m_verts, m_nverts, m_tris, m_trinorms, m_ntris, 0); - else - rcDebugDrawMeshSlope(&dd, m_verts, m_nverts, m_tris, m_trinorms, m_ntris, m_agentMaxSlope); - - glDepthMask(GL_FALSE); - - // Draw bounds - float col[4] = {1,1,1,0.5f}; - rcDebugDrawBoxWire(&dd, m_bmin[0],m_bmin[1],m_bmin[2], m_bmax[0],m_bmax[1],m_bmax[2], col); - - // Tiling grid. - const int ts = (int)m_tileSize; - int gw = 0, gh = 0; - rcCalcGridSize(m_bmin, m_bmax, m_cellSize, &gw, &gh); - int tw = (gw + ts-1) / ts; - int th = (gh + ts-1) / ts; - const float s = ts*m_cellSize; - glBegin(GL_LINES); - glColor4ub(0,0,0,64); - for (int y = 0; y < th; ++y) - { - for (int x = 0; x < tw; ++x) - { - float fx, fy, fz; - fx = m_bmin[0] + x*s; - fy = m_bmin[1]; - fz = m_bmin[2] + y*s; - - glVertex3f(fx,fy,fz); - glVertex3f(fx+s,fy,fz); - glVertex3f(fx,fy,fz); - glVertex3f(fx,fy,fz+s); - - if (x+1 >= tw) - { - glVertex3f(fx+s,fy,fz); - glVertex3f(fx+s,fy,fz+s); - } - if (y+1 >= th) - { - glVertex3f(fx,fy,fz+s); - glVertex3f(fx+s,fy,fz+s); - } - } - } - glEnd(); - - // Draw active tile - rcDebugDrawBoxWire(&dd, m_tileBmin[0],m_tileBmin[1],m_tileBmin[2], m_tileBmax[0],m_tileBmax[1],m_tileBmax[2], m_tileCol); - - if (m_navMesh) - dtDebugDrawNavMesh(m_navMesh); - - if (m_sposSet) - { - const float s = 0.5f; - glColor4ub(64,16,0,255); - glLineWidth(3.0f); - glBegin(GL_LINES); - glVertex3f(m_spos[0]-s,m_spos[1]+m_cellHeight,m_spos[2]); - glVertex3f(m_spos[0]+s,m_spos[1]+m_cellHeight,m_spos[2]); - glVertex3f(m_spos[0],m_spos[1]-s+m_cellHeight,m_spos[2]); - glVertex3f(m_spos[0],m_spos[1]+s+m_cellHeight,m_spos[2]); - glVertex3f(m_spos[0],m_spos[1]+m_cellHeight,m_spos[2]-s); - glVertex3f(m_spos[0],m_spos[1]+m_cellHeight,m_spos[2]+s); - glEnd(); - glLineWidth(1.0f); - } - if (m_eposSet) - { - const float s = 0.5f; - glColor4ub(16,64,0,255); - glLineWidth(3.0f); - glBegin(GL_LINES); - glVertex3f(m_epos[0]-s,m_epos[1]+m_cellHeight,m_epos[2]); - glVertex3f(m_epos[0]+s,m_epos[1]+m_cellHeight,m_epos[2]); - glVertex3f(m_epos[0],m_epos[1]-s+m_cellHeight,m_epos[2]); - glVertex3f(m_epos[0],m_epos[1]+s+m_cellHeight,m_epos[2]); - glVertex3f(m_epos[0],m_epos[1]+m_cellHeight,m_epos[2]-s); - glVertex3f(m_epos[0],m_epos[1]+m_cellHeight,m_epos[2]+s); - glEnd(); - glLineWidth(1.0f); - } - - static const float startCol[4] = { 0.5f, 0.1f, 0.0f, 0.75f }; - static const float endCol[4] = { 0.2f, 0.4f, 0.0f, 0.75f }; - static const float pathCol[4] = {0,0,0,0.25f}; - - if (m_toolMode == TOOLMODE_PATHFIND) - { - dtDebugDrawNavMeshPoly(m_navMesh, m_startRef, startCol); - dtDebugDrawNavMeshPoly(m_navMesh, m_endRef, endCol); - - if (m_npolys) - { - for (int i = 1; i < m_npolys-1; ++i) - dtDebugDrawNavMeshPoly(m_navMesh, m_polys[i], pathCol); - } - if (m_nstraightPath) - { - glColor4ub(64,16,0,220); - glLineWidth(3.0f); - glBegin(GL_LINE_STRIP); - for (int i = 0; i < m_nstraightPath; ++i) - glVertex3f(m_straightPath[i*3], m_straightPath[i*3+1]+0.4f, m_straightPath[i*3+2]); - glEnd(); - glLineWidth(1.0f); - glPointSize(4.0f); - glBegin(GL_POINTS); - for (int i = 0; i < m_nstraightPath; ++i) - glVertex3f(m_straightPath[i*3], m_straightPath[i*3+1]+0.4f, m_straightPath[i*3+2]); - glEnd(); - glPointSize(1.0f); - } - } - else if (m_toolMode == TOOLMODE_RAYCAST) - { - dtDebugDrawNavMeshPoly(m_navMesh, m_startRef, startCol); - - if (m_nstraightPath) - { - for (int i = 1; i < m_npolys; ++i) - dtDebugDrawNavMeshPoly(m_navMesh, m_polys[i], pathCol); - - glColor4ub(64,16,0,220); - glLineWidth(3.0f); - glBegin(GL_LINE_STRIP); - for (int i = 0; i < m_nstraightPath; ++i) - glVertex3f(m_straightPath[i*3], m_straightPath[i*3+1]+0.4f, m_straightPath[i*3+2]); - glEnd(); - glLineWidth(1.0f); - glPointSize(4.0f); - glBegin(GL_POINTS); - for (int i = 0; i < m_nstraightPath; ++i) - glVertex3f(m_straightPath[i*3], m_straightPath[i*3+1]+0.4f, m_straightPath[i*3+2]); - glEnd(); - glPointSize(1.0f); - } - } - else if (m_toolMode == TOOLMODE_DISTANCE_TO_WALL) - { - dtDebugDrawNavMeshPoly(m_navMesh, m_startRef, startCol); - const float col[4] = {1,1,1,0.5f}; - rcDebugDrawCylinderWire(&dd, m_spos[0]-m_distanceToWall, m_spos[1]+0.02f, m_spos[2]-m_distanceToWall, - m_spos[0]+m_distanceToWall, m_spos[1]+m_agentHeight, m_spos[2]+m_distanceToWall, col); - glLineWidth(3.0f); - glColor4fv(col); - glBegin(GL_LINES); - glVertex3f(m_hitPos[0], m_hitPos[1] + 0.02f, m_hitPos[2]); - glVertex3f(m_hitPos[0], m_hitPos[1] + m_agentHeight, m_hitPos[2]); - glEnd(); - glLineWidth(1.0f); - } - else if (m_toolMode == TOOLMODE_FIND_POLYS_AROUND) - { - const float cola[4] = {0,0,0,0.5f}; - for (int i = 0; i < m_npolys; ++i) - { - dtDebugDrawNavMeshPoly(m_navMesh, m_polys[i], pathCol); - if (m_parent[i]) - { - float p0[3], p1[3]; - getPolyCenter(m_navMesh, m_polys[i], p0); - getPolyCenter(m_navMesh, m_parent[i], p1); - glColor4ub(0,0,0,128); - rcDrawArc(&dd, p0, p1, cola, 2.0f); - } - } - - const float dx = m_epos[0] - m_spos[0]; - const float dz = m_epos[2] - m_spos[2]; - float dist = sqrtf(dx*dx + dz*dz); - const float col[4] = {1,1,1,0.5f}; - rcDebugDrawCylinderWire(&dd, m_spos[0]-dist, m_spos[1]+0.02f, m_spos[2]-dist, - m_spos[0]+dist, m_spos[1]+m_agentHeight, m_spos[2]+dist, col); - } - - glDepthMask(GL_TRUE); - -} - -void Sample_DynMesh::handleRenderOverlay(double* proj, double* model, int* view) -{ - GLdouble x, y, z; - - // Draw start and end point labels - if (m_tileBuildTime > 0.0f && gluProject((GLdouble)(m_tileBmin[0]+m_tileBmax[0])/2, (GLdouble)(m_tileBmin[1]+m_tileBmax[1])/2, (GLdouble)(m_tileBmin[2]+m_tileBmax[2])/2, - model, proj, view, &x, &y, &z)) - { - char text[32]; - snprintf(text,32,"%.3fms / %dTris / %.1fkB", m_tileBuildTime, m_tileTriCount, m_tileMemUsage); - imguiDrawText((int)x, (int)y-25, IMGUI_ALIGN_CENTER, text, imguiRGBA(0,0,0,220)); - } -} - -void Sample_DynMesh::handleMeshChanged(const float* verts, int nverts, - const int* tris, const float* trinorms, int ntris, - const float* bmin, const float* bmax) -{ - m_verts = verts; - m_nverts = nverts; - m_tris = tris; - m_trinorms = trinorms; - m_ntris = ntris; - vcopy(m_bmin, bmin); - vcopy(m_bmax, bmax); - - delete m_chunkyMesh; - m_chunkyMesh = 0; - delete m_navMesh; - m_navMesh = 0; - cleanup(); -} - -void Sample_DynMesh::setToolStartPos(const float* p) -{ - m_sposSet = true; - vcopy(m_spos, p); - - if (m_toolMode == TOOLMODE_CREATE_TILES) - removeTile(m_spos); - else - toolRecalc(); -} - -void Sample_DynMesh::setToolEndPos(const float* p) -{ - if (!m_navMesh) - return; - - m_eposSet = true; - vcopy(m_epos, p); - - if (m_toolMode == TOOLMODE_CREATE_TILES) - buildTile(m_epos); - else - toolRecalc(); -} - -bool Sample_DynMesh::handleBuild() -{ - if (!m_verts || !m_tris) - { - printf("No verts or tris\n"); - return false; - } - - delete m_navMesh; - m_navMesh = new dtNavMesh; - if (!m_navMesh) - { - printf("Could not allocate navmehs\n"); - return false; - } - if (!m_navMesh->init(m_bmin, m_tileSize*m_cellSize, m_tileSize*m_cellSize, m_agentMaxClimb*m_cellHeight, 512, 512, 2048)) - { - printf("Could not init navmesh\n"); - return false; - } - - // Build chunky mesh. - delete m_chunkyMesh; - m_chunkyMesh = new rcChunkyTriMesh; - if (!m_chunkyMesh) - { - if (rcGetLog()) - rcGetLog()->log(RC_LOG_ERROR, "buildTiledNavigation: Out of memory 'm_chunkyMesh'."); - return false; - } - if (!rcCreateChunkyTriMesh(m_verts, m_tris, m_ntris, 256, m_chunkyMesh)) - { - if (rcGetLog()) - rcGetLog()->log(RC_LOG_ERROR, "buildTiledNavigation: Could not build chunky mesh."); - return false; - } - - return true; -} - -void Sample_DynMesh::buildTile(const float* pos) -{ - if (!m_navMesh) - return; - - const float ts = m_tileSize*m_cellSize; - const int tx = (int)floorf((pos[0]-m_bmin[0]) / ts); - const int ty = (int)floorf((pos[2]-m_bmin[2]) / ts); - if (tx < 0 || ty < 0) - return; - - m_tileBmin[0] = m_bmin[0] + tx*ts; - m_tileBmin[1] = m_bmin[1]; - m_tileBmin[2] = m_bmin[2] + ty*ts; - - m_tileBmax[0] = m_bmin[0] + (tx+1)*ts; - m_tileBmax[1] = m_bmax[1]; - m_tileBmax[2] = m_bmin[2] + (ty+1)*ts; - - m_tileCol[0] = 0.3f; m_tileCol[1] = 0.8f; m_tileCol[2] = 0; m_tileCol[3] = 1; - - int dataSize = 0; - unsigned char* data = buildTileMesh(m_tileBmin, m_tileBmax, dataSize); - - if (data) - { - // Remove any previous data (navmesh owns and deletes the data). - m_navMesh->removeTileAt(tx,ty,0,0); - - // Let the navmesh own the data. - if (!m_navMesh->addTileAt(tx,ty,data,dataSize,true)) - delete [] data; - } -} - -void Sample_DynMesh::removeTile(const float* pos) -{ - if (!m_navMesh) - return; - - const float ts = m_tileSize*m_cellSize; - const int tx = (int)floorf((pos[0]-m_bmin[0]) / ts); - const int ty = (int)floorf((pos[2]-m_bmin[2]) / ts); - - m_tileBmin[0] = m_bmin[0] + tx*ts; - m_tileBmin[1] = m_bmin[1]; - m_tileBmin[2] = m_bmin[2] + ty*ts; - - m_tileBmax[0] = m_bmin[0] + (tx+1)*ts; - m_tileBmax[1] = m_bmax[1]; - m_tileBmax[2] = m_bmin[2] + (ty+1)*ts; - - m_tileCol[0] = 0.8f; m_tileCol[1] = 0.1f; m_tileCol[2] = 0; m_tileCol[3] = 1; - - unsigned char* rdata = 0; - int rdataSize = 0; - if (m_navMesh->removeTileAt(tx,ty,&rdata,&rdataSize)) - delete [] rdata; -} - -unsigned char* Sample_DynMesh::buildTileMesh(const float* bmin, const float* bmax, int& dataSize) -{ - if (!m_verts || ! m_tris) - { - if (rcGetLog()) - rcGetLog()->log(RC_LOG_ERROR, "buildNavigation: Input mesh is not specified."); - return 0; - } - - cleanup(); - - // Init build configuration from GUI - memset(&m_cfg, 0, sizeof(m_cfg)); - m_cfg.cs = m_cellSize; - m_cfg.ch = m_cellHeight; - m_cfg.walkableSlopeAngle = m_agentMaxSlope; - m_cfg.walkableHeight = (int)ceilf(m_agentHeight / m_cfg.ch); - m_cfg.walkableClimb = (int)ceilf(m_agentMaxClimb / m_cfg.ch); - m_cfg.walkableRadius = (int)ceilf(m_agentRadius / m_cfg.cs); - m_cfg.maxEdgeLen = (int)(m_edgeMaxLen / m_cellSize); - m_cfg.maxSimplificationError = m_edgeMaxError; - m_cfg.minRegionSize = (int)rcSqr(m_regionMinSize); - m_cfg.mergeRegionSize = (int)rcSqr(m_regionMergeSize); - m_cfg.maxVertsPerPoly = (int)m_vertsPerPoly; - m_cfg.tileSize = (int)m_tileSize; - m_cfg.borderSize = m_cfg.walkableRadius + 3; // Reserve enough padding. - m_cfg.width = m_cfg.tileSize + m_cfg.borderSize*2; - m_cfg.height = m_cfg.tileSize + m_cfg.borderSize*2; - m_cfg.detailSampleDist = m_detailSampleDist < 0.9f ? 0 : m_cellSize * m_detailSampleDist; - m_cfg.detailSampleMaxError = m_cellHeight * m_detailSampleMaxError; - - vcopy(m_cfg.bmin, bmin); - vcopy(m_cfg.bmax, bmax); - m_cfg.bmin[0] -= m_cfg.borderSize*m_cfg.cs; - m_cfg.bmin[2] -= m_cfg.borderSize*m_cfg.cs; - m_cfg.bmax[0] += m_cfg.borderSize*m_cfg.cs; - m_cfg.bmax[2] += m_cfg.borderSize*m_cfg.cs; - - // Reset build times gathering. - memset(&m_buildTimes, 0, sizeof(m_buildTimes)); - rcSetBuildTimes(&m_buildTimes); - - // Start the build process. - rcTimeVal totStartTime = rcGetPerformanceTimer(); - - if (rcGetLog()) - { - rcGetLog()->log(RC_LOG_PROGRESS, "Building navigation:"); - rcGetLog()->log(RC_LOG_PROGRESS, " - %d x %d cells", m_cfg.width, m_cfg.height); - rcGetLog()->log(RC_LOG_PROGRESS, " - %.1fK verts, %.1fK tris", m_nverts/1000.0f, m_ntris/1000.0f); - } - - // Allocate voxel heighfield where we rasterize our input data to. - m_solid = new rcHeightfield; - if (!m_solid) - { - if (rcGetLog()) - rcGetLog()->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'solid'."); - return 0; - } - if (!rcCreateHeightfield(*m_solid, m_cfg.width, m_cfg.height, m_cfg.bmin, m_cfg.bmax, m_cfg.cs, m_cfg.ch)) - { - if (rcGetLog()) - rcGetLog()->log(RC_LOG_ERROR, "buildNavigation: Could not create solid heightfield."); - return 0; - } - - // Allocate array that can hold triangle flags. - // If you have multiple meshes you need to process, allocate - // and array which can hold the max number of triangles you need to process. - m_triflags = new unsigned char[m_chunkyMesh->maxTrisPerChunk]; - if (!m_triflags) - { - if (rcGetLog()) - rcGetLog()->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'triangleFlags' (%d).", m_chunkyMesh->maxTrisPerChunk); - return 0; - } - - - float tbmin[2], tbmax[2]; - tbmin[0] = m_cfg.bmin[0]; - tbmin[1] = m_cfg.bmin[2]; - tbmax[0] = m_cfg.bmax[0]; - tbmax[1] = m_cfg.bmax[2]; - int cid[256];// TODO: Make grow when returning too many items. - const int ncid = rcGetChunksInRect(m_chunkyMesh, tbmin, tbmax, cid, 256); - if (!ncid) - return 0; - - m_tileTriCount = 0; - - for (int i = 0; i < ncid; ++i) - { - const rcChunkyTriMeshNode& node = m_chunkyMesh->nodes[cid[i]]; - const int* tris = &m_chunkyMesh->tris[node.i*3]; - const int ntris = node.n; - - m_tileTriCount += ntris; - - memset(m_triflags, 0, ntris*sizeof(unsigned char)); - rcMarkWalkableTriangles(m_cfg.walkableSlopeAngle, - m_verts, m_nverts, tris, ntris, m_triflags); - - rcRasterizeTriangles(m_verts, m_nverts, tris, m_triflags, ntris, *m_solid); - } - - if (!m_keepInterResults) - { - delete [] m_triflags; - m_triflags = 0; - } - - // Once all geoemtry is rasterized, we do initial pass of filtering to - // remove unwanted overhangs caused by the conservative rasterization - // as well as filter spans where the character cannot possibly stand. - rcFilterLedgeSpans(m_cfg.walkableHeight, m_cfg.walkableClimb, *m_solid); - rcFilterWalkableLowHeightSpans(m_cfg.walkableHeight, *m_solid); - - // Compact the heightfield so that it is faster to handle from now on. - // This will result more cache coherent data as well as the neighbours - // between walkable cells will be calculated. - m_chf = new rcCompactHeightfield; - if (!m_chf) - { - if (rcGetLog()) - rcGetLog()->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'chf'."); - return 0; - } - if (!rcBuildCompactHeightfield(m_cfg.walkableHeight, m_cfg.walkableClimb, RC_WALKABLE, *m_solid, *m_chf)) - { - if (rcGetLog()) - rcGetLog()->log(RC_LOG_ERROR, "buildNavigation: Could not build compact data."); - return 0; - } - - if (!m_keepInterResults) - { - delete m_solid; - m_solid = 0; - } - - // Prepare for region partitioning, by calculating distance field along the walkable surface. - if (!rcBuildDistanceField(*m_chf)) - { - if (rcGetLog()) - rcGetLog()->log(RC_LOG_ERROR, "buildNavigation: Could not build distance field."); - return 0; - } - - // Partition the walkable surface into simple regions without holes. - if (!rcBuildRegions(*m_chf, m_cfg.walkableRadius, m_cfg.borderSize, m_cfg.minRegionSize, m_cfg.mergeRegionSize)) - { - if (rcGetLog()) - rcGetLog()->log(RC_LOG_ERROR, "buildNavigation: Could not build regions."); - return 0; - } - - // Create contours. - m_cset = new rcContourSet; - if (!m_cset) - { - if (rcGetLog()) - rcGetLog()->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'cset'."); - return 0; - } - if (!rcBuildContours(*m_chf, m_cfg.maxSimplificationError, m_cfg.maxEdgeLen, *m_cset)) - { - if (rcGetLog()) - rcGetLog()->log(RC_LOG_ERROR, "buildNavigation: Could not create contours."); - return 0; - } - - if (m_cset->nconts == 0) - { - return 0; - } - - // Build polygon navmesh from the contours. - m_pmesh = new rcPolyMesh; - if (!m_pmesh) - { - if (rcGetLog()) - rcGetLog()->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'pmesh'."); - return 0; - } - if (!rcBuildPolyMesh(*m_cset, m_cfg.maxVertsPerPoly, *m_pmesh)) - { - if (rcGetLog()) - rcGetLog()->log(RC_LOG_ERROR, "buildNavigation: Could not triangulate contours."); - return 0; - } - - // Build detail mesh. - m_dmesh = new rcPolyMeshDetail; - if (!m_dmesh) - { - if (rcGetLog()) - rcGetLog()->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'dmesh'."); - return 0; - } - - if (!rcBuildPolyMeshDetail(*m_pmesh, *m_chf, - m_cfg.detailSampleDist, m_cfg.detailSampleMaxError, - *m_dmesh)) - { - if (rcGetLog()) - rcGetLog()->log(RC_LOG_ERROR, "buildNavigation: Could build polymesh detail."); - return 0; - } - - if (!m_keepInterResults) - { - delete m_chf; - m_chf = 0; - delete m_cset; - m_cset = 0; - } - - unsigned char* navData = 0; - int navDataSize = 0; - if (m_cfg.maxVertsPerPoly <= DT_VERTS_PER_POLYGON) - { - // Remove padding from the polymesh data. TODO: Remove this odditity. - for (int i = 0; i < m_pmesh->nverts; ++i) - { - unsigned short* v = &m_pmesh->verts[i*3]; - v[0] -= (unsigned short)m_cfg.borderSize; - v[2] -= (unsigned short)m_cfg.borderSize; - } - - if (m_pmesh->nverts >= 0xffff) - { - // The vertex indices are ushorts, and cannot point to more than 0xffff vertices. - if (rcGetLog()) - rcGetLog()->log(RC_LOG_ERROR, "Too many vertices per tile %d (max: %d).", m_pmesh->nverts, 0xffff); - return false; - } -/* if (m_pmesh->npolys > DT_MAX_TILES) - { - // If you hit this error, you have too many polygons per tile. - // You can trade off tile count to poly count by adjusting DT_TILE_REF_TILE_BITS and DT_TILE_REF_POLY_BITS. - // The current setup is optimized for large number of tiles and small number of polys per tile. - if (rcGetLog()) - rcGetLog()->log(RC_LOG_ERROR, "Too many polygons per tile %d (max: %d).", m_pmesh->npolys, DT_MAX_TILES); - return false; - }*/ - - if (!dtCreateNavMeshData(m_pmesh->verts, m_pmesh->nverts, - m_pmesh->polys, m_pmesh->npolys, m_pmesh->nvp, - m_dmesh->meshes, m_dmesh->verts, m_dmesh->nverts, m_dmesh->tris, m_dmesh->ntris, - bmin, bmax, m_cfg.cs, m_cfg.ch, m_cfg.tileSize, m_cfg.walkableClimb, &navData, &navDataSize)) - { - if (rcGetLog()) - rcGetLog()->log(RC_LOG_ERROR, "Could not build Detour navmesh."); - return 0; - } - } - m_tileMemUsage = navDataSize/1024.0f; - - rcTimeVal totEndTime = rcGetPerformanceTimer(); - - // Show performance stats. - if (rcGetLog()) - { - const float pc = 100.0f / rcGetDeltaTimeUsec(totStartTime, totEndTime); - - rcGetLog()->log(RC_LOG_PROGRESS, "Rasterize: %.1fms (%.1f%%)", m_buildTimes.rasterizeTriangles/1000.0f, m_buildTimes.rasterizeTriangles*pc); - - rcGetLog()->log(RC_LOG_PROGRESS, "Build Compact: %.1fms (%.1f%%)", m_buildTimes.buildCompact/1000.0f, m_buildTimes.buildCompact*pc); - - rcGetLog()->log(RC_LOG_PROGRESS, "Filter Border: %.1fms (%.1f%%)", m_buildTimes.filterBorder/1000.0f, m_buildTimes.filterBorder*pc); - rcGetLog()->log(RC_LOG_PROGRESS, "Filter Walkable: %.1fms (%.1f%%)", m_buildTimes.filterWalkable/1000.0f, m_buildTimes.filterWalkable*pc); - rcGetLog()->log(RC_LOG_PROGRESS, "Filter Reachable: %.1fms (%.1f%%)", m_buildTimes.filterMarkReachable/1000.0f, m_buildTimes.filterMarkReachable*pc); - - rcGetLog()->log(RC_LOG_PROGRESS, "Build Distancefield: %.1fms (%.1f%%)", m_buildTimes.buildDistanceField/1000.0f, m_buildTimes.buildDistanceField*pc); - rcGetLog()->log(RC_LOG_PROGRESS, " - distance: %.1fms (%.1f%%)", m_buildTimes.buildDistanceFieldDist/1000.0f, m_buildTimes.buildDistanceFieldDist*pc); - rcGetLog()->log(RC_LOG_PROGRESS, " - blur: %.1fms (%.1f%%)", m_buildTimes.buildDistanceFieldBlur/1000.0f, m_buildTimes.buildDistanceFieldBlur*pc); - - rcGetLog()->log(RC_LOG_PROGRESS, "Build Regions: %.1fms (%.1f%%)", m_buildTimes.buildRegions/1000.0f, m_buildTimes.buildRegions*pc); - rcGetLog()->log(RC_LOG_PROGRESS, " - watershed: %.1fms (%.1f%%)", m_buildTimes.buildRegionsReg/1000.0f, m_buildTimes.buildRegionsReg*pc); - rcGetLog()->log(RC_LOG_PROGRESS, " - expand: %.1fms (%.1f%%)", m_buildTimes.buildRegionsExp/1000.0f, m_buildTimes.buildRegionsExp*pc); - rcGetLog()->log(RC_LOG_PROGRESS, " - find catchment basins: %.1fms (%.1f%%)", m_buildTimes.buildRegionsFlood/1000.0f, m_buildTimes.buildRegionsFlood*pc); - rcGetLog()->log(RC_LOG_PROGRESS, " - filter: %.1fms (%.1f%%)", m_buildTimes.buildRegionsFilter/1000.0f, m_buildTimes.buildRegionsFilter*pc); - - rcGetLog()->log(RC_LOG_PROGRESS, "Build Contours: %.1fms (%.1f%%)", m_buildTimes.buildContours/1000.0f, m_buildTimes.buildContours*pc); - rcGetLog()->log(RC_LOG_PROGRESS, " - trace: %.1fms (%.1f%%)", m_buildTimes.buildContoursTrace/1000.0f, m_buildTimes.buildContoursTrace*pc); - rcGetLog()->log(RC_LOG_PROGRESS, " - simplify: %.1fms (%.1f%%)", m_buildTimes.buildContoursSimplify/1000.0f, m_buildTimes.buildContoursSimplify*pc); - - rcGetLog()->log(RC_LOG_PROGRESS, "Build Polymesh: %.1fms (%.1f%%)", m_buildTimes.buildPolymesh/1000.0f, m_buildTimes.buildPolymesh*pc); - rcGetLog()->log(RC_LOG_PROGRESS, "Build Polymesh Detail: %.1fms (%.1f%%)", m_buildTimes.buildDetailMesh/1000.0f, m_buildTimes.buildDetailMesh*pc); - rcGetLog()->log(RC_LOG_PROGRESS, "Merge Polymeshes: %.1fms (%.1f%%)", m_buildTimes.mergePolyMesh/1000.0f, m_buildTimes.mergePolyMesh*pc); - rcGetLog()->log(RC_LOG_PROGRESS, "Merge Polymesh Details: %.1fms (%.1f%%)", m_buildTimes.mergePolyMeshDetail/1000.0f, m_buildTimes.mergePolyMeshDetail*pc); - - - rcGetLog()->log(RC_LOG_PROGRESS, "Build Polymesh: %.1fms (%.1f%%)", m_buildTimes.buildPolymesh/1000.0f, m_buildTimes.buildPolymesh*pc); - - rcGetLog()->log(RC_LOG_PROGRESS, "Polymesh: Verts:%d Polys:%d", m_pmesh->nverts, m_pmesh->npolys); - - rcGetLog()->log(RC_LOG_PROGRESS, "TOTAL: %.1fms", rcGetDeltaTimeUsec(totStartTime, totEndTime)/1000.0f); - } - - m_tileBuildTime = rcGetDeltaTimeUsec(totStartTime, totEndTime)/1000.0f; - - dataSize = navDataSize; - return navData; -} diff --git a/RecastDemo/Source/Sample_SoloMesh.cpp b/RecastDemo/Source/Sample_SoloMesh.cpp index 3c13f0c..9dfce1d 100644 --- a/RecastDemo/Source/Sample_SoloMesh.cpp +++ b/RecastDemo/Source/Sample_SoloMesh.cpp @@ -23,7 +23,7 @@ inline bool inRange(const float* v1, const float* v2, const float r, const float const float dx = v2[0] - v1[0]; const float dy = v2[1] - v1[1]; const float dz = v2[2] - v1[2]; - return (dx*dx + dz*dz) < r*r; // && fabsf(dy) < h; + return (dx*dx + dz*dz) < r*r && fabsf(dy) < h; } @@ -293,8 +293,8 @@ void Sample_SoloMesh::toolRender(int flags) if (flags & NAVMESH_POLYS) dtDebugDrawNavMesh(m_navMesh, m_toolMode == TOOLMODE_PATHFIND); -/* if (flags & NAVMESH_BVTREE) - dtDebugDrawNavMeshBVTree(m_navMesh);*/ + if (flags & NAVMESH_BVTREE) + dtDebugDrawNavMeshBVTree(m_navMesh); if (flags & NAVMESH_TOOLS) { diff --git a/RecastDemo/Source/Sample_SoloMeshSimple.cpp b/RecastDemo/Source/Sample_SoloMeshSimple.cpp index 1bad75f..4682b27 100644 --- a/RecastDemo/Source/Sample_SoloMeshSimple.cpp +++ b/RecastDemo/Source/Sample_SoloMeshSimple.cpp @@ -488,7 +488,7 @@ bool Sample_SoloMeshSimple::handleBuild() // The GUI may allow more max points per polygon than Detour can handle. // Only build the detour navmesh if we do not exceed the limit. - if (m_cfg.maxVertsPerPoly <= DT_STAT_VERTS_PER_POLYGON) + if (m_cfg.maxVertsPerPoly <= DT_VERTS_PER_POLYGON) { unsigned char* navData = 0; int navDataSize = 0; diff --git a/RecastDemo/Source/Sample_SoloMeshTiled.cpp b/RecastDemo/Source/Sample_SoloMeshTiled.cpp index 09f123c..8f5f4dc 100644 --- a/RecastDemo/Source/Sample_SoloMeshTiled.cpp +++ b/RecastDemo/Source/Sample_SoloMeshTiled.cpp @@ -905,7 +905,7 @@ bool Sample_SoloMeshTiled::handleBuild() } } - if (m_pmesh && m_cfg.maxVertsPerPoly <= DT_STAT_VERTS_PER_POLYGON) + if (m_pmesh && m_cfg.maxVertsPerPoly <= DT_VERTS_PER_POLYGON) { unsigned char* navData = 0; int navDataSize = 0; diff --git a/RecastDemo/Source/Sample_TileMesh.cpp b/RecastDemo/Source/Sample_TileMesh.cpp index 37ea3fd..0099f14 100644 --- a/RecastDemo/Source/Sample_TileMesh.cpp +++ b/RecastDemo/Source/Sample_TileMesh.cpp @@ -28,8 +28,8 @@ #include "Recast.h" #include "RecastTimer.h" #include "RecastDebugDraw.h" -#include "DetourTileNavMesh.h" -#include "DetourTileNavMeshBuilder.h" +#include "DetourNavMesh.h" +#include "DetourNavMeshBuilder.h" #include "DetourDebugDraw.h" #ifdef WIN32 @@ -37,6 +37,31 @@ #endif +inline unsigned int nextPow2(unsigned int v) +{ + v--; + v |= v >> 1; + v |= v >> 2; + v |= v >> 4; + v |= v >> 8; + v |= v >> 16; + v++; + return v; +} + +inline unsigned int ilog2(unsigned int v) +{ + unsigned int r; + unsigned int shift; + r = (v > 0xffff) << 4; v >>= r; + shift = (v > 0xff) << 3; v >>= shift; r |= shift; + shift = (v > 0xf) << 2; v >>= shift; r |= shift; + shift = (v > 0x3) << 1; v >>= shift; r |= shift; + r |= (v >> 1); + return r; +} + + Sample_TileMesh::Sample_TileMesh() : m_keepInterResults(false), m_navMesh(0), @@ -47,6 +72,8 @@ Sample_TileMesh::Sample_TileMesh() : m_cset(0), m_pmesh(0), m_dmesh(0), + m_maxTiles(0), + m_maxPolysPerTile(0), m_tileSize(32), m_sposSet(false), m_eposSet(false), @@ -94,7 +121,7 @@ void Sample_TileMesh::cleanup() void Sample_TileMesh::handleSettings() { Sample::handleCommonSettings(); - + imguiLabel("Tiling"); imguiSlider("TileSize", &m_tileSize, 16.0f, 1024.0f, 16.0f); @@ -106,6 +133,18 @@ void Sample_TileMesh::handleSettings() const int th = (gh + ts-1) / ts; snprintf(text, 64, "Tiles %d x %d", tw, th); imguiValue(text); + + // Max tiles and max polys affect how the tile IDs are caculated. + // There are 22 bits available for identifying a tile and a polygon. + int tileBits = rcMin((int)ilog2(nextPow2(tw*th)), 14); + if (tileBits > 14) tileBits = 14; + int polyBits = 22 - tileBits; + m_maxTiles = 1 << tileBits; + m_maxPolysPerTile = 1 << polyBits; + snprintf(text, 64, "Max Tiles %d", m_maxTiles); + imguiValue(text); + snprintf(text, 64, "Max Polys %d", m_maxPolysPerTile); + imguiValue(text); } void Sample_TileMesh::toolRecalc() @@ -113,7 +152,7 @@ void Sample_TileMesh::toolRecalc() m_startRef = 0; if (m_sposSet) m_startRef = m_navMesh->findNearestPoly(m_spos, m_polyPickExt); - + m_endRef = 0; if (m_eposSet) m_endRef = m_navMesh->findNearestPoly(m_epos, m_polyPickExt); @@ -184,6 +223,49 @@ void Sample_TileMesh::handleTools() m_toolMode = TOOLMODE_CREATE_TILES; toolRecalc(); } + + imguiIndent(); + + if (imguiButton("Create All")) + { + int gw = 0, gh = 0; + rcCalcGridSize(m_bmin, m_bmax, m_cellSize, &gw, &gh); + const int ts = (int)m_tileSize; + const int tw = (gw + ts-1) / ts; + const int th = (gh + ts-1) / ts; + const float tcs = m_tileSize*m_cellSize; + + for (int y = 0; y < th; ++y) + { + for (int x = 0; x < tw; ++x) + { + m_tileBmin[0] = m_bmin[0] + x*tcs; + m_tileBmin[1] = m_bmin[1]; + m_tileBmin[2] = m_bmin[2] + y*tcs; + + m_tileBmax[0] = m_bmin[0] + (x+1)*tcs; + m_tileBmax[1] = m_bmax[1]; + m_tileBmax[2] = m_bmin[2] + (y+1)*tcs; + + int dataSize = 0; + unsigned char* data = buildTileMesh(m_tileBmin, m_tileBmax, dataSize); + if (data) + { + // Remove any previous data (navmesh owns and deletes the data). + m_navMesh->removeTileAt(x,y,0,0); + // Let the navmesh own the data. + if (!m_navMesh->addTileAt(x,y,data,dataSize,true)) + delete [] data; + } + } + } + + toolRecalc(); + } + imguiUnindent(); + + imguiSeparator(); + if (imguiCheck("Pathfind", m_toolMode == TOOLMODE_PATHFIND)) { m_toolMode = TOOLMODE_PATHFIND; @@ -203,7 +285,7 @@ void Sample_TileMesh::handleTools() { m_toolMode = TOOLMODE_FIND_POLYS_AROUND; toolRecalc(); - } + } } void Sample_TileMesh::handleDebugMode() @@ -215,12 +297,16 @@ void Sample_TileMesh::handleDebugMode() imguiValue("LMB: (Re)Create tiles."); imguiValue("LMB+SHIFT: Remove tiles."); } - + else + { + imguiValue("Press [Build] to create tile mesh"); + imguiValue("with specified parameters."); + } } -static void getPolyCenter(dtTiledNavMesh* navMesh, dtTilePolyRef ref, float* center) +static void getPolyCenter(dtNavMesh* navMesh, dtPolyRef ref, float* center) { - const dtTilePoly* p = navMesh->getPolyByRef(ref); + const dtPoly* p = navMesh->getPolyByRef(ref); if (!p) return; const float* verts = navMesh->getPolyVertsByRef(ref); center[0] = 0; @@ -243,21 +329,21 @@ void Sample_TileMesh::handleRender() { if (!m_verts || !m_tris || !m_trinorms) return; - + DebugDrawGL dd; - + // Draw mesh if (m_navMesh) rcDebugDrawMesh(&dd, m_verts, m_nverts, m_tris, m_trinorms, m_ntris, 0); else rcDebugDrawMeshSlope(&dd, m_verts, m_nverts, m_tris, m_trinorms, m_ntris, m_agentMaxSlope); - + glDepthMask(GL_FALSE); // Draw bounds float col[4] = {1,1,1,0.5f}; rcDebugDrawBoxWire(&dd, m_bmin[0],m_bmin[1],m_bmin[2], m_bmax[0],m_bmax[1],m_bmax[2], col); - + // Tiling grid. const int ts = (int)m_tileSize; int gw = 0, gh = 0; @@ -297,9 +383,9 @@ void Sample_TileMesh::handleRender() // Draw active tile rcDebugDrawBoxWire(&dd, m_tileBmin[0],m_tileBmin[1],m_tileBmin[2], m_tileBmax[0],m_tileBmax[1],m_tileBmax[2], m_tileCol); - + if (m_navMesh) - dtDebugDrawTiledNavMesh(m_navMesh); + dtDebugDrawNavMesh(m_navMesh); if (m_sposSet) { @@ -338,13 +424,13 @@ void Sample_TileMesh::handleRender() if (m_toolMode == TOOLMODE_PATHFIND) { - dtDebugDrawTiledNavMeshPoly(m_navMesh, m_startRef, startCol); - dtDebugDrawTiledNavMeshPoly(m_navMesh, m_endRef, endCol); + dtDebugDrawNavMeshPoly(m_navMesh, m_startRef, startCol); + dtDebugDrawNavMeshPoly(m_navMesh, m_endRef, endCol); if (m_npolys) { for (int i = 1; i < m_npolys-1; ++i) - dtDebugDrawTiledNavMeshPoly(m_navMesh, m_polys[i], pathCol); + dtDebugDrawNavMeshPoly(m_navMesh, m_polys[i], pathCol); } if (m_nstraightPath) { @@ -365,12 +451,12 @@ void Sample_TileMesh::handleRender() } else if (m_toolMode == TOOLMODE_RAYCAST) { - dtDebugDrawTiledNavMeshPoly(m_navMesh, m_startRef, startCol); + dtDebugDrawNavMeshPoly(m_navMesh, m_startRef, startCol); if (m_nstraightPath) { for (int i = 1; i < m_npolys; ++i) - dtDebugDrawTiledNavMeshPoly(m_navMesh, m_polys[i], pathCol); + dtDebugDrawNavMeshPoly(m_navMesh, m_polys[i], pathCol); glColor4ub(64,16,0,220); glLineWidth(3.0f); @@ -389,7 +475,7 @@ void Sample_TileMesh::handleRender() } else if (m_toolMode == TOOLMODE_DISTANCE_TO_WALL) { - dtDebugDrawTiledNavMeshPoly(m_navMesh, m_startRef, startCol); + dtDebugDrawNavMeshPoly(m_navMesh, m_startRef, startCol); const float col[4] = {1,1,1,0.5f}; rcDebugDrawCylinderWire(&dd, m_spos[0]-m_distanceToWall, m_spos[1]+0.02f, m_spos[2]-m_distanceToWall, m_spos[0]+m_distanceToWall, m_spos[1]+m_agentHeight, m_spos[2]+m_distanceToWall, col); @@ -406,7 +492,7 @@ void Sample_TileMesh::handleRender() const float cola[4] = {0,0,0,0.5f}; for (int i = 0; i < m_npolys; ++i) { - dtDebugDrawTiledNavMeshPoly(m_navMesh, m_polys[i], pathCol); + dtDebugDrawNavMeshPoly(m_navMesh, m_polys[i], pathCol); if (m_parent[i]) { float p0[3], p1[3]; @@ -435,7 +521,7 @@ void Sample_TileMesh::handleRenderOverlay(double* proj, double* model, int* view // Draw start and end point labels if (m_tileBuildTime > 0.0f && gluProject((GLdouble)(m_tileBmin[0]+m_tileBmax[0])/2, (GLdouble)(m_tileBmin[1]+m_tileBmax[1])/2, (GLdouble)(m_tileBmin[2]+m_tileBmax[2])/2, - model, proj, view, &x, &y, &z)) + model, proj, view, &x, &y, &z)) { char text[32]; snprintf(text,32,"%.3fms / %dTris / %.1fkB", m_tileBuildTime, m_tileTriCount, m_tileMemUsage); @@ -444,8 +530,8 @@ void Sample_TileMesh::handleRenderOverlay(double* proj, double* model, int* view } void Sample_TileMesh::handleMeshChanged(const float* verts, int nverts, - const int* tris, const float* trinorms, int ntris, - const float* bmin, const float* bmax) + const int* tris, const float* trinorms, int ntris, + const float* bmin, const float* bmax) { m_verts = verts; m_nverts = nverts; @@ -454,7 +540,7 @@ void Sample_TileMesh::handleMeshChanged(const float* verts, int nverts, m_ntris = ntris; vcopy(m_bmin, bmin); vcopy(m_bmax, bmax); - + delete m_chunkyMesh; m_chunkyMesh = 0; delete m_navMesh; @@ -466,7 +552,7 @@ void Sample_TileMesh::setToolStartPos(const float* p) { m_sposSet = true; vcopy(m_spos, p); - + if (m_toolMode == TOOLMODE_CREATE_TILES) removeTile(m_spos); else @@ -477,7 +563,7 @@ void Sample_TileMesh::setToolEndPos(const float* p) { if (!m_navMesh) return; - + m_eposSet = true; vcopy(m_epos, p); @@ -491,23 +577,26 @@ bool Sample_TileMesh::handleBuild() { if (!m_verts || !m_tris) { - printf("No verts or tris\n"); + if (rcGetLog()) + rcGetLog()->log(RC_LOG_ERROR, "buildTiledNavigation: No vertices and triangles."); return false; } - + delete m_navMesh; - m_navMesh = new dtTiledNavMesh; + m_navMesh = new dtNavMesh; if (!m_navMesh) { - printf("Could not allocate navmehs\n"); + if (rcGetLog()) + rcGetLog()->log(RC_LOG_ERROR, "buildTiledNavigation: Could not allocate navmesh."); return false; } - if (!m_navMesh->init(m_bmin, m_tileSize*m_cellSize, m_agentMaxClimb*m_cellHeight)) + if (!m_navMesh->init(m_bmin, m_tileSize*m_cellSize, m_tileSize*m_cellSize, m_agentMaxClimb*m_cellHeight, m_maxTiles, m_maxPolysPerTile, 2048)) { - printf("Could not init navmesh\n"); + if (rcGetLog()) + rcGetLog()->log(RC_LOG_ERROR, "buildTiledNavigation: Could not init navmesh."); return false; } - + // Build chunky mesh. delete m_chunkyMesh; m_chunkyMesh = new rcChunkyTriMesh; @@ -523,7 +612,7 @@ bool Sample_TileMesh::handleBuild() rcGetLog()->log(RC_LOG_ERROR, "buildTiledNavigation: Could not build chunky mesh."); return false; } - + return true; } @@ -531,17 +620,17 @@ void Sample_TileMesh::buildTile(const float* pos) { if (!m_navMesh) return; - + const float ts = m_tileSize*m_cellSize; const int tx = (int)floorf((pos[0]-m_bmin[0]) / ts); const int ty = (int)floorf((pos[2]-m_bmin[2]) / ts); if (tx < 0 || ty < 0) return; - + m_tileBmin[0] = m_bmin[0] + tx*ts; m_tileBmin[1] = m_bmin[1]; m_tileBmin[2] = m_bmin[2] + ty*ts; - + m_tileBmax[0] = m_bmin[0] + (tx+1)*ts; m_tileBmax[1] = m_bmax[1]; m_tileBmax[2] = m_bmin[2] + (ty+1)*ts; @@ -665,7 +754,7 @@ unsigned char* Sample_TileMesh::buildTileMesh(const float* bmin, const float* bm return 0; } - + float tbmin[2], tbmax[2]; tbmin[0] = m_cfg.bmin[0]; tbmin[1] = m_cfg.bmin[2]; @@ -675,15 +764,15 @@ unsigned char* Sample_TileMesh::buildTileMesh(const float* bmin, const float* bm const int ncid = rcGetChunksInRect(m_chunkyMesh, tbmin, tbmax, cid, 256); if (!ncid) return 0; - + m_tileTriCount = 0; - + for (int i = 0; i < ncid; ++i) { const rcChunkyTriMeshNode& node = m_chunkyMesh->nodes[cid[i]]; const int* tris = &m_chunkyMesh->tris[node.i*3]; const int ntris = node.n; - + m_tileTriCount += ntris; memset(m_triflags, 0, ntris*sizeof(unsigned char)); @@ -759,6 +848,11 @@ unsigned char* Sample_TileMesh::buildTileMesh(const float* bmin, const float* bm return 0; } + if (m_cset->nconts == 0) + { + return 0; + } + // Build polygon navmesh from the contours. m_pmesh = new rcPolyMesh; if (!m_pmesh) @@ -773,7 +867,7 @@ unsigned char* Sample_TileMesh::buildTileMesh(const float* bmin, const float* bm rcGetLog()->log(RC_LOG_ERROR, "buildNavigation: Could not triangulate contours."); return 0; } - + // Build detail mesh. m_dmesh = new rcPolyMeshDetail; if (!m_dmesh) @@ -802,7 +896,7 @@ unsigned char* Sample_TileMesh::buildTileMesh(const float* bmin, const float* bm unsigned char* navData = 0; int navDataSize = 0; - if (m_cfg.maxVertsPerPoly == DT_TILE_VERTS_PER_POLYGON) + if (m_cfg.maxVertsPerPoly <= DT_VERTS_PER_POLYGON) { // Remove padding from the polymesh data. TODO: Remove this odditity. for (int i = 0; i < m_pmesh->nverts; ++i) @@ -819,20 +913,20 @@ unsigned char* Sample_TileMesh::buildTileMesh(const float* bmin, const float* bm rcGetLog()->log(RC_LOG_ERROR, "Too many vertices per tile %d (max: %d).", m_pmesh->nverts, 0xffff); return false; } - if (m_pmesh->npolys > DT_MAX_TILES) - { - // If you hit this error, you have too many polygons per tile. - // You can trade off tile count to poly count by adjusting DT_TILE_REF_TILE_BITS and DT_TILE_REF_POLY_BITS. - // The current setup is optimized for large number of tiles and small number of polys per tile. - if (rcGetLog()) - rcGetLog()->log(RC_LOG_ERROR, "Too many polygons per tile %d (max: %d).", m_pmesh->npolys, DT_MAX_TILES); - return false; - } - - if (!dtCreateNavMeshTileData(m_pmesh->verts, m_pmesh->nverts, - m_pmesh->polys, m_pmesh->npolys, m_pmesh->nvp, - m_dmesh->meshes, m_dmesh->verts, m_dmesh->nverts, m_dmesh->tris, m_dmesh->ntris, - bmin, bmax, m_cfg.cs, m_cfg.ch, m_cfg.tileSize, m_cfg.walkableClimb, &navData, &navDataSize)) + /* if (m_pmesh->npolys > DT_MAX_TILES) + { + // If you hit this error, you have too many polygons per tile. + // You can trade off tile count to poly count by adjusting DT_TILE_REF_TILE_BITS and DT_TILE_REF_POLY_BITS. + // The current setup is optimized for large number of tiles and small number of polys per tile. + if (rcGetLog()) + rcGetLog()->log(RC_LOG_ERROR, "Too many polygons per tile %d (max: %d).", m_pmesh->npolys, DT_MAX_TILES); + return false; + }*/ + + if (!dtCreateNavMeshData(m_pmesh->verts, m_pmesh->nverts, + m_pmesh->polys, m_pmesh->npolys, m_pmesh->nvp, + m_dmesh->meshes, m_dmesh->verts, m_dmesh->nverts, m_dmesh->tris, m_dmesh->ntris, + bmin, bmax, m_cfg.cs, m_cfg.ch, m_cfg.tileSize, m_cfg.walkableClimb, &navData, &navDataSize)) { if (rcGetLog()) rcGetLog()->log(RC_LOG_ERROR, "Could not build Detour navmesh."); @@ -882,7 +976,7 @@ unsigned char* Sample_TileMesh::buildTileMesh(const float* bmin, const float* bm rcGetLog()->log(RC_LOG_PROGRESS, "TOTAL: %.1fms", rcGetDeltaTimeUsec(totStartTime, totEndTime)/1000.0f); } - + m_tileBuildTime = rcGetDeltaTimeUsec(totStartTime, totEndTime)/1000.0f; dataSize = navDataSize; diff --git a/RecastDemo/Source/main.cpp b/RecastDemo/Source/main.cpp index 543d7d7..9dffa28 100644 --- a/RecastDemo/Source/main.cpp +++ b/RecastDemo/Source/main.cpp @@ -18,7 +18,6 @@ #include "Sample_SoloMeshSimple.h" #include "Sample_SoloMeshTiled.h" #include "Sample_TileMesh.h" -#include "Sample_DynMesh.h" #ifdef WIN32 # define snprintf _snprintf @@ -198,14 +197,12 @@ struct SampleItem Sample* createSoloSimple() { return new Sample_SoloMeshSimple(); } Sample* createSoloTiled() { return new Sample_SoloMeshTiled(); } Sample* createTile() { return new Sample_TileMesh(); } -Sample* createDyn() { return new Sample_DynMesh(); } static SampleItem g_samples[] = { -{ createSoloSimple, "Solo Mesh Simple" }, -{ createSoloTiled, "Solo Mesh Tiled" }, -{ createTile, "Tile Mesh" }, -{ createDyn, "Dyn Mesh" }, + { createSoloSimple, "Solo Mesh Simple" }, + { createSoloTiled, "Solo Mesh Tiled" }, + { createTile, "Tile Mesh" }, }; static const int g_nsamples = sizeof(g_samples)/sizeof(SampleItem);