-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: expose all RecastDebugDraw and DetourDebugDraw functions
- Loading branch information
1 parent
87f43f1
commit c3114dd
Showing
9 changed files
with
187 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
packages/recast-navigation-wasm/src/DebugDraw/DetourDebugDraw.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#include "DetourDebugDraw.h" | ||
|
||
void DetourDebugDraw::debugDrawNavMesh(duDebugDraw* dd, const dtNavMesh& mesh, const int flags) | ||
{ | ||
duDebugDrawNavMesh(dd, mesh, flags); | ||
} | ||
void DetourDebugDraw::debugDrawNavMeshWithClosedList(struct duDebugDraw* dd, const dtNavMesh& mesh, const dtNavMeshQuery& query, unsigned char flags) | ||
{ | ||
duDebugDrawNavMeshWithClosedList(dd, mesh, query, flags); | ||
} | ||
void DetourDebugDraw::debugDrawNavMeshNodes(struct duDebugDraw* dd, const dtNavMeshQuery& query) | ||
{ | ||
duDebugDrawNavMeshNodes(dd, query); | ||
} | ||
void DetourDebugDraw::debugDrawNavMeshBVTree(struct duDebugDraw* dd, const dtNavMesh& mesh) | ||
{ | ||
duDebugDrawNavMeshBVTree(dd, mesh); | ||
} | ||
void DetourDebugDraw::debugDrawNavMeshPortals(struct duDebugDraw* dd, const dtNavMesh& mesh) | ||
{ | ||
duDebugDrawNavMeshPortals(dd, mesh); | ||
} | ||
void DetourDebugDraw::debugDrawNavMeshPolysWithFlags(struct duDebugDraw* dd, const dtNavMesh& mesh, const unsigned short polyFlags, const unsigned int col) | ||
{ | ||
duDebugDrawNavMeshPolysWithFlags(dd, mesh, polyFlags, col); | ||
} | ||
void DetourDebugDraw::debugDrawNavMeshPoly(struct duDebugDraw* dd, const dtNavMesh& mesh, dtPolyRef ref, const unsigned int col) | ||
{ | ||
duDebugDrawNavMeshPoly(dd, mesh, ref, col); | ||
} | ||
|
||
void DetourDebugDraw::debugDrawTileCacheLayerAreas(struct duDebugDraw* dd, const dtTileCacheLayer& layer, const float cs, const float ch) | ||
{ | ||
duDebugDrawTileCacheLayerAreas(dd, layer, cs, ch); | ||
} | ||
void DetourDebugDraw::debugDrawTileCacheLayerRegions(struct duDebugDraw* dd, const dtTileCacheLayer& layer, const float cs, const float ch) | ||
{ | ||
duDebugDrawTileCacheLayerRegions(dd, layer, cs, ch); | ||
} | ||
void DetourDebugDraw::debugDrawTileCacheContours(duDebugDraw* dd, const struct dtTileCacheContourSet& lcset, const float* orig, const float cs, const float ch) | ||
{ | ||
duDebugDrawTileCacheContours(dd, lcset, orig, cs, ch); | ||
} | ||
void DetourDebugDraw::debugDrawTileCachePolyMesh(duDebugDraw* dd, const struct dtTileCachePolyMesh& lmesh, const float* orig, const float cs, const float ch) | ||
{ | ||
duDebugDrawTileCachePolyMesh(dd, lmesh, orig, cs, ch); | ||
} |
21 changes: 21 additions & 0 deletions
21
packages/recast-navigation-wasm/src/DebugDraw/DetourDebugDraw.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#pragma once | ||
|
||
#include "../../recastnavigation/DebugUtils/Include/DebugDraw.h" | ||
#include "../../recastnavigation/DebugUtils/Include/DetourDebugDraw.h" | ||
|
||
class DetourDebugDraw | ||
{ | ||
public: | ||
void debugDrawNavMesh(duDebugDraw* dd, const dtNavMesh& mesh, const int flags); | ||
void debugDrawNavMeshWithClosedList(struct duDebugDraw* dd, const dtNavMesh& mesh, const dtNavMeshQuery& query, unsigned char flags); | ||
void debugDrawNavMeshNodes(struct duDebugDraw* dd, const dtNavMeshQuery& query); | ||
void debugDrawNavMeshBVTree(struct duDebugDraw* dd, const dtNavMesh& mesh); | ||
void debugDrawNavMeshPortals(struct duDebugDraw* dd, const dtNavMesh& mesh); | ||
void debugDrawNavMeshPolysWithFlags(struct duDebugDraw* dd, const dtNavMesh& mesh, const unsigned short polyFlags, const unsigned int col); | ||
void debugDrawNavMeshPoly(struct duDebugDraw* dd, const dtNavMesh& mesh, dtPolyRef ref, const unsigned int col); | ||
|
||
void debugDrawTileCacheLayerAreas(struct duDebugDraw* dd, const dtTileCacheLayer& layer, const float cs, const float ch); | ||
void debugDrawTileCacheLayerRegions(struct duDebugDraw* dd, const dtTileCacheLayer& layer, const float cs, const float ch); | ||
void debugDrawTileCacheContours(duDebugDraw* dd, const struct dtTileCacheContourSet& lcset, const float* orig, const float cs, const float ch); | ||
void debugDrawTileCachePolyMesh(duDebugDraw* dd, const struct dtTileCachePolyMesh& lmesh, const float* orig, const float cs, const float ch); | ||
}; |
61 changes: 61 additions & 0 deletions
61
packages/recast-navigation-wasm/src/DebugDraw/RecastDebugDraw.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#include "RecastDebugDraw.h" | ||
|
||
void RecastDebugDraw::debugDrawHeightfieldSolid(duDebugDraw* dd, const rcHeightfield& hf) | ||
{ | ||
duDebugDrawHeightfieldSolid(dd, hf); | ||
} | ||
|
||
void RecastDebugDraw::debugDrawHeightfieldWalkable(duDebugDraw* dd, const rcHeightfield& hf) | ||
{ | ||
duDebugDrawHeightfieldWalkable(dd, hf); | ||
} | ||
|
||
void RecastDebugDraw::debugDrawCompactHeightfieldSolid(duDebugDraw* dd, const rcCompactHeightfield& chf) | ||
{ | ||
duDebugDrawCompactHeightfieldSolid(dd, chf); | ||
} | ||
|
||
void RecastDebugDraw::debugDrawCompactHeightfieldRegions(duDebugDraw* dd, const rcCompactHeightfield& chf) | ||
{ | ||
duDebugDrawCompactHeightfieldRegions(dd, chf); | ||
} | ||
|
||
void RecastDebugDraw::debugDrawCompactHeightfieldDistance(duDebugDraw* dd, const rcCompactHeightfield& chf) | ||
{ | ||
duDebugDrawCompactHeightfieldDistance(dd, chf); | ||
} | ||
|
||
void RecastDebugDraw::debugDrawHeightfieldLayer(duDebugDraw* dd, const rcHeightfieldLayer& layer, const int idx) | ||
{ | ||
duDebugDrawHeightfieldLayer(dd, layer, idx); | ||
} | ||
|
||
void RecastDebugDraw::debugDrawHeightfieldLayers(duDebugDraw* dd, const rcHeightfieldLayerSet& lset) | ||
{ | ||
duDebugDrawHeightfieldLayers(dd, lset); | ||
} | ||
|
||
void RecastDebugDraw::debugDrawRegionConnections(duDebugDraw* dd, const rcContourSet& cset, const float alpha = 1.0f) | ||
{ | ||
duDebugDrawRegionConnections(dd, cset, alpha); | ||
} | ||
|
||
void RecastDebugDraw::debugDrawRawContours(duDebugDraw* dd, const rcContourSet& cset, const float alpha = 1.0f) | ||
{ | ||
duDebugDrawRawContours(dd, cset, alpha); | ||
} | ||
|
||
void RecastDebugDraw::debugDrawContours(duDebugDraw* dd, const rcContourSet& cset, const float alpha = 1.0f) | ||
{ | ||
duDebugDrawContours(dd, cset, alpha); | ||
} | ||
|
||
void RecastDebugDraw::debugDrawPolyMesh(duDebugDraw* dd, const rcPolyMesh& mesh) | ||
{ | ||
duDebugDrawPolyMesh(dd, mesh); | ||
} | ||
|
||
void RecastDebugDraw::debugDrawPolyMeshDetail(duDebugDraw* dd, const rcPolyMeshDetail& dmesh) | ||
{ | ||
duDebugDrawPolyMeshDetail(dd, dmesh); | ||
} |
32 changes: 32 additions & 0 deletions
32
packages/recast-navigation-wasm/src/DebugDraw/RecastDebugDraw.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#pragma once | ||
|
||
#include "../../recastnavigation/DebugUtils/Include/DebugDraw.h" | ||
#include "../../recastnavigation/DebugUtils/Include/RecastDebugDraw.h" | ||
|
||
class RecastDebugDraw | ||
{ | ||
public: | ||
void debugDrawHeightfieldSolid(duDebugDraw* dd, const rcHeightfield& hf); | ||
|
||
void debugDrawHeightfieldWalkable(duDebugDraw* dd, const rcHeightfield& hf); | ||
|
||
void debugDrawCompactHeightfieldSolid(duDebugDraw* dd, const rcCompactHeightfield& chf); | ||
|
||
void debugDrawCompactHeightfieldRegions(duDebugDraw* dd, const rcCompactHeightfield& chf); | ||
|
||
void debugDrawCompactHeightfieldDistance(duDebugDraw* dd, const rcCompactHeightfield& chf); | ||
|
||
void debugDrawHeightfieldLayer(duDebugDraw* dd, const rcHeightfieldLayer& layer, const int idx); | ||
|
||
void debugDrawHeightfieldLayers(duDebugDraw* dd, const rcHeightfieldLayerSet& lset); | ||
|
||
void debugDrawRegionConnections(duDebugDraw* dd, const rcContourSet& cset, const float alpha); | ||
|
||
void debugDrawRawContours(duDebugDraw* dd, const rcContourSet& cset, const float alpha); | ||
|
||
void debugDrawContours(duDebugDraw* dd, const rcContourSet& cset, const float alpha); | ||
|
||
void debugDrawPolyMesh(duDebugDraw* dd, const rcPolyMesh& mesh); | ||
|
||
void debugDrawPolyMeshDetail(duDebugDraw* dd, const rcPolyMeshDetail& dmesh); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters