diff --git a/Detour/Include/DetourNavMesh.h b/Detour/Include/DetourNavMesh.h index 310bf64..2f650ab 100644 --- a/Detour/Include/DetourNavMesh.h +++ b/Detour/Include/DetourNavMesh.h @@ -385,8 +385,11 @@ public: // Return polygon flags. unsigned short getPolyFlags(dtPolyRef ref); + // Set polygon type. + void setPolyArea(dtPolyRef ref, unsigned char area); + // Return polygon type. - unsigned char getPolyType(dtPolyRef ref); + unsigned char getPolyArea(dtPolyRef ref); // Returns pointer to a polygon based on ref. const dtPoly* getPolyByRef(dtPolyRef ref) const; diff --git a/Detour/Source/DetourNavMesh.cpp b/Detour/Source/DetourNavMesh.cpp index f71aa8e..6606c0d 100644 --- a/Detour/Source/DetourNavMesh.cpp +++ b/Detour/Source/DetourNavMesh.cpp @@ -1763,7 +1763,19 @@ unsigned short dtNavMesh::getPolyFlags(dtPolyRef ref) return poly->flags; } -unsigned char dtNavMesh::getPolyType(dtPolyRef ref) +void dtNavMesh::setPolyArea(dtPolyRef ref, unsigned char area) +{ + unsigned int salt, it, ip; + decodePolyId(ref, salt, it, ip); + if (it >= (unsigned int)m_maxTiles) return; + if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return; + if (ip >= (unsigned int)m_tiles[it].header->polyCount) return; + dtMeshHeader* header = m_tiles[it].header; + dtPoly* poly = &header->polys[ip]; + poly->area = area; +} + +unsigned char dtNavMesh::getPolyArea(dtPolyRef ref) { unsigned int salt, it, ip; decodePolyId(ref, salt, it, ip); @@ -1772,7 +1784,7 @@ unsigned char dtNavMesh::getPolyType(dtPolyRef ref) if (ip >= (unsigned int)m_tiles[it].header->polyCount) return 0; const dtMeshHeader* header = m_tiles[it].header; const dtPoly* poly = &header->polys[ip]; - return poly->type; + return poly->area; } int dtNavMesh::raycast(dtPolyRef centerRef, const float* startPos, const float* endPos, dtQueryFilter* filter, diff --git a/RecastDemo/Bin/Recast.app/Contents/MacOS/Recast b/RecastDemo/Bin/Recast.app/Contents/MacOS/Recast index 60ce9bd..f2ba3be 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/Build/Xcode/Recast.xcodeproj/memon.pbxuser b/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.pbxuser index c06ebbf..6436175 100644 --- a/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.pbxuser +++ b/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.pbxuser @@ -1063,6 +1063,14 @@ 6B324FC811259FFA00EBD2FD /* PBXTextBookmark */ = 6B324FC811259FFA00EBD2FD /* PBXTextBookmark */; 6B324FC911259FFA00EBD2FD /* PBXTextBookmark */ = 6B324FC911259FFA00EBD2FD /* PBXTextBookmark */; 6B324FCA11259FFA00EBD2FD /* PBXTextBookmark */ = 6B324FCA11259FFA00EBD2FD /* PBXTextBookmark */; + 6B324FCD1125A7BB00EBD2FD /* PBXTextBookmark */ = 6B324FCD1125A7BB00EBD2FD /* PBXTextBookmark */; + 6B324FCE1125A7BB00EBD2FD /* PBXTextBookmark */ = 6B324FCE1125A7BB00EBD2FD /* PBXTextBookmark */; + 6B324FCF1125A7BB00EBD2FD /* PBXTextBookmark */ = 6B324FCF1125A7BB00EBD2FD /* PBXTextBookmark */; + 6B324FD01125A7BB00EBD2FD /* PBXTextBookmark */ = 6B324FD01125A7BB00EBD2FD /* PBXTextBookmark */; + 6B324FD11125A7BB00EBD2FD /* PBXTextBookmark */ = 6B324FD11125A7BB00EBD2FD /* PBXTextBookmark */; + 6B324FD21125A7BB00EBD2FD /* PBXTextBookmark */ = 6B324FD21125A7BB00EBD2FD /* PBXTextBookmark */; + 6B324FD31125A7BB00EBD2FD /* PBXTextBookmark */ = 6B324FD31125A7BB00EBD2FD /* PBXTextBookmark */; + 6B324FD41125A7BB00EBD2FD /* PBXTextBookmark */ = 6B324FD41125A7BB00EBD2FD /* PBXTextBookmark */; 6B69739F10FFCA4500984788 = 6B69739F10FFCA4500984788 /* PBXTextBookmark */; 6B6973A210FFCA4500984788 = 6B6973A210FFCA4500984788 /* PBXTextBookmark */; 6B8DE70D10B01BBF00DF20FB = 6B8DE70D10B01BBF00DF20FB /* PBXTextBookmark */; @@ -2204,7 +2212,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 446"; rLen = 0; - rLoc = 19911; + rLoc = 19988; rType = 0; vrLen = 1563; vrLoc = 18834; @@ -2244,7 +2252,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 446"; rLen = 0; - rLoc = 19911; + rLoc = 19988; rType = 0; vrLen = 1563; vrLoc = 18834; @@ -2264,7 +2272,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 1670"; rLen = 0; - rLoc = 48803; + rLoc = 49208; rType = 0; vrLen = 874; vrLoc = 45419; @@ -2324,7 +2332,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 439"; rLen = 0; - rLoc = 19731; + rLoc = 19808; rType = 0; vrLen = 1637; vrLoc = 18794; @@ -2334,7 +2342,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 1670"; rLen = 0; - rLoc = 48803; + rLoc = 49208; rType = 0; vrLen = 874; vrLoc = 45419; @@ -3757,7 +3765,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 460"; rLen = 0; - rLoc = 19865; + rLoc = 19942; rType = 0; vrLen = 1696; vrLoc = 19209; @@ -3777,7 +3785,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 460"; rLen = 0; - rLoc = 19865; + rLoc = 19942; rType = 0; vrLen = 1708; vrLoc = 19209; @@ -3797,7 +3805,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 463"; rLen = 0; - rLoc = 20240; + rLoc = 20317; rType = 0; vrLen = 1706; vrLoc = 19209; @@ -6920,7 +6928,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 469"; rLen = 0; - rLoc = 20249; + rLoc = 20326; rType = 0; vrLen = 1613; vrLoc = 19392; @@ -7000,7 +7008,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 409"; rLen = 16; - rLoc = 18109; + rLoc = 18186; rType = 0; vrLen = 1069; vrLoc = 17040; @@ -7020,7 +7028,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 465"; rLen = 0; - rLoc = 20249; + rLoc = 20326; rType = 0; vrLen = 1662; vrLoc = 19392; @@ -7040,7 +7048,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 465"; rLen = 0; - rLoc = 20249; + rLoc = 20326; rType = 0; vrLen = 1662; vrLoc = 19392; @@ -7060,7 +7068,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 465"; rLen = 193; - rLoc = 20249; + rLoc = 20326; rType = 0; vrLen = 1702; vrLoc = 19392; @@ -7080,7 +7088,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 467"; rLen = 0; - rLoc = 20423; + rLoc = 20500; rType = 0; vrLen = 1734; vrLoc = 19392; @@ -7100,7 +7108,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 465"; rLen = 0; - rLoc = 20249; + rLoc = 20326; rType = 0; vrLen = 1754; vrLoc = 19392; @@ -7120,7 +7128,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 469"; rLen = 0; - rLoc = 20423; + rLoc = 20500; rType = 0; vrLen = 1634; vrLoc = 19392; @@ -7140,7 +7148,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 465"; rLen = 0; - rLoc = 20249; + rLoc = 20326; rType = 0; vrLen = 1669; vrLoc = 19392; @@ -7160,7 +7168,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 469"; rLen = 0; - rLoc = 20249; + rLoc = 20326; rType = 0; vrLen = 1613; vrLoc = 19392; @@ -7180,7 +7188,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 468"; rLen = 0; - rLoc = 20414; + rLoc = 20491; rType = 0; vrLen = 1681; vrLoc = 19392; @@ -7210,7 +7218,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 468"; rLen = 0; - rLoc = 20414; + rLoc = 20491; rType = 0; vrLen = 1681; vrLoc = 19392; @@ -7250,7 +7258,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 461"; rLen = 0; - rLoc = 20013; + rLoc = 20090; rType = 0; vrLen = 1683; vrLoc = 19392; @@ -7280,7 +7288,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 467"; rLen = 0; - rLoc = 20342; + rLoc = 20419; rType = 0; vrLen = 1682; vrLoc = 19392; @@ -7300,7 +7308,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 461"; rLen = 0; - rLoc = 20013; + rLoc = 20090; rType = 0; vrLen = 1683; vrLoc = 19392; @@ -7310,7 +7318,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 1936"; rLen = 0; - rLoc = 54405; + rLoc = 54810; rType = 0; vrLen = 1061; vrLoc = 52347; @@ -7320,7 +7328,7 @@ comments = "error: 'parent' was not declared in this scope"; fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; rLen = 1; - rLoc = 2190; + rLoc = 2202; rType = 1; }; 6B324DAE112548EF00EBD2FD /* PBXTextBookmark */ = { @@ -7328,7 +7336,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 2155"; rLen = 0; - rLoc = 60411; + rLoc = 60816; rType = 0; vrLen = 917; vrLoc = 59111; @@ -7338,7 +7346,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 2158"; rLen = 0; - rLoc = 60552; + rLoc = 60957; rType = 0; vrLen = 917; vrLoc = 59111; @@ -7356,7 +7364,7 @@ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; name = "DetourNavMesh.cpp: 2158"; rLen = 0; - rLoc = 60552; + rLoc = 60957; rType = 0; vrLen = 917; vrLoc = 59111; @@ -7888,7 +7896,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 456"; rLen = 0; - rLoc = 19731; + rLoc = 19808; rType = 0; vrLen = 1711; vrLoc = 18685; @@ -7908,7 +7916,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 382"; rLen = 0; - rLoc = 17165; + rLoc = 17242; rType = 0; vrLen = 1112; vrLoc = 16362; @@ -7978,7 +7986,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 425"; rLen = 0; - rLoc = 18296; + rLoc = 18373; rType = 0; vrLen = 1044; vrLoc = 17581; @@ -7988,7 +7996,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 413"; rLen = 0; - rLoc = 18013; + rLoc = 18090; rType = 0; vrLen = 1044; vrLoc = 17581; @@ -7998,7 +8006,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 413"; rLen = 0; - rLoc = 18013; + rLoc = 18090; rType = 0; vrLen = 1044; vrLoc = 17581; @@ -8028,7 +8036,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 413"; rLen = 0; - rLoc = 18013; + rLoc = 18090; rType = 0; vrLen = 1044; vrLoc = 17581; @@ -10914,6 +10922,86 @@ vrLen = 845; vrLoc = 24842; }; + 6B324FCD1125A7BB00EBD2FD /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B624169103434880002E346 /* RecastMeshDetail.cpp */; + name = "RecastMeshDetail.cpp: 1074"; + rLen = 0; + rLoc = 25933; + rType = 0; + vrLen = 877; + vrLoc = 25362; + }; + 6B324FCE1125A7BB00EBD2FD /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; + name = "DetourNavMesh.h: 389"; + rLen = 0; + rLoc = 17118; + rType = 0; + vrLen = 1010; + vrLoc = 16672; + }; + 6B324FCF1125A7BB00EBD2FD /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; + name = "DetourNavMesh.cpp: 1768"; + rLen = 0; + rLoc = 48488; + rType = 0; + vrLen = 905; + vrLoc = 47956; + }; + 6B324FD01125A7BB00EBD2FD /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B624169103434880002E346 /* RecastMeshDetail.cpp */; + name = "RecastMeshDetail.cpp: 1074"; + rLen = 0; + rLoc = 25933; + rType = 0; + vrLen = 877; + vrLoc = 25362; + }; + 6B324FD11125A7BB00EBD2FD /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; + name = "DetourNavMesh.h: 391"; + rLen = 0; + rLoc = 17197; + rType = 0; + vrLen = 1010; + vrLoc = 16672; + }; + 6B324FD21125A7BB00EBD2FD /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; + name = "DetourNavMesh.cpp: 1768"; + rLen = 0; + rLoc = 48488; + rType = 0; + vrLen = 905; + vrLoc = 47956; + }; + 6B324FD31125A7BB00EBD2FD /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; + name = "DetourNavMesh.h: 389"; + rLen = 0; + rLoc = 17118; + rType = 0; + vrLen = 1010; + vrLoc = 16672; + }; + 6B324FD41125A7BB00EBD2FD /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; + name = "DetourNavMesh.cpp: 1767"; + rLen = 0; + rLoc = 48460; + rType = 0; + vrLen = 1142; + vrLoc = 47956; + }; 6B555DAE100B211D00247EA3 /* imguiRenderGL.h */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {915, 492}}"; @@ -10937,9 +11025,9 @@ }; 6B624169103434880002E346 /* RecastMeshDetail.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {852, 19296}}"; - sepNavSelRange = "{25307, 0}"; - sepNavVisRange = "{24842, 845}"; + sepNavIntBoundsRect = "{{0, 0}, {852, 19280}}"; + sepNavSelRange = "{25933, 0}"; + sepNavVisRange = "{25362, 877}"; sepNavWindowFrame = "{{61, 36}, {1011, 695}}"; }; }; @@ -11065,9 +11153,9 @@ }; 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {817, 35824}}"; - sepNavSelRange = "{37090, 0}"; - sepNavVisRange = "{36916, 628}"; + sepNavIntBoundsRect = "{{0, 0}, {815, 35424}}"; + sepNavSelRange = "{48460, 0}"; + sepNavVisRange = "{47956, 1142}"; sepNavWindowFrame = "{{15, 51}, {1214, 722}}"; }; }; @@ -11080,9 +11168,9 @@ }; 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {845, 8144}}"; - sepNavSelRange = "{18013, 0}"; - sepNavVisRange = "{17581, 1044}"; + sepNavIntBoundsRect = "{{0, 0}, {845, 8096}}"; + sepNavSelRange = "{17118, 0}"; + sepNavVisRange = "{16672, 1010}"; }; }; 6B8DE88C10B69E4C00DF20FB /* DetourNavMeshBuilder.h */ = { @@ -11097,7 +11185,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = detail; rLen = 0; - rLoc = 17610; + rLoc = 17687; rType = 0; vrLen = 1182; vrLoc = 9676; @@ -11788,7 +11876,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 361"; rLen = 0; - rLoc = 17173; + rLoc = 17250; rType = 0; vrLen = 1227; vrLoc = 15736; @@ -11798,7 +11886,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 361"; rLen = 0; - rLoc = 17173; + rLoc = 17250; rType = 0; vrLen = 1311; vrLoc = 15654; @@ -11808,7 +11896,7 @@ fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; name = "DetourNavMesh.h: 361"; rLen = 0; - rLoc = 17173; + rLoc = 17250; rType = 0; vrLen = 1069; vrLoc = 2551; diff --git a/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.perspectivev3 b/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.perspectivev3 index f4bb98d..2798d54 100644 --- a/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.perspectivev3 +++ b/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.perspectivev3 @@ -281,8 +281,8 @@ PBXSmartGroupTreeModuleOutlineStateSelectionKey - 11 - 3 + 13 + 12 1 0 @@ -323,7 +323,7 @@ PBXProjectModuleGUID 6B8632A30F78115100E2684A PBXProjectModuleLabel - RecastMeshDetail.cpp + DetourNavMesh.cpp PBXSplitModuleInNavigatorKey Split0 @@ -331,11 +331,11 @@ PBXProjectModuleGUID 6B8632A40F78115100E2684A PBXProjectModuleLabel - RecastMeshDetail.cpp + DetourNavMesh.cpp _historyCapacity 0 bookmark - 6B324FCA11259FFA00EBD2FD + 6B324FD41125A7BB00EBD2FD history 6B8DE70D10B01BBF00DF20FB @@ -370,7 +370,6 @@ 6B324D0F1121C78000EBD2FD 6B324D101121C78000EBD2FD 6B324D511121D61A00EBD2FD - 6B324E181125566A00EBD2FD 6B324E2C1125598400EBD2FD 6B324E3B11255BA700EBD2FD 6B324E6D11256D1000EBD2FD @@ -388,7 +387,6 @@ 6B324F201125818400EBD2FD 6B324F2E112584FB00EBD2FD 6B324F3A1125891F00EBD2FD - 6B324F3B1125891F00EBD2FD 6B324F3C1125891F00EBD2FD 6B324F3D1125891F00EBD2FD 6B324F4A11258C7000EBD2FD @@ -398,11 +396,9 @@ 6B324F9A11259A5800EBD2FD 6B324F9B11259A5800EBD2FD 6B324FC711259FFA00EBD2FD - 6B324FC811259FFA00EBD2FD - - nextStack - - 6B324FC911259FFA00EBD2FD + 6B324FCD1125A7BB00EBD2FD + 6B324FCE1125A7BB00EBD2FD + 6B324FCF1125A7BB00EBD2FD prevStack @@ -579,6 +575,10 @@ 6B324F581125904E00EBD2FD 6BF7C4661115C514002B3F46 6B324B5F111C1AC800EBD2FD + 6B324FD01125A7BB00EBD2FD + 6B324FD11125A7BB00EBD2FD + 6B324FD21125A7BB00EBD2FD + 6B324FD31125A7BB00EBD2FD SplitCount