diff --git a/Recast/Include/Recast.h b/Recast/Include/Recast.h index a68138a..d117394 100644 --- a/Recast/Include/Recast.h +++ b/Recast/Include/Recast.h @@ -424,6 +424,20 @@ void rcMarkWalkableTriangles(const float walkableSlopeAngle, const int* tris, int nt, unsigned char* flags); +// Adds span to heighfield. +// The span addition can set to favor flags. If the span is merged to +// another span and the new smax is within 'flagMergeThr' units away +// from the existing span the span flags are merged and stored. +// Params: +// solid - (in) heighfield where the spans is added to +// x,y - (in) location on the heighfield where the span is added +// smin,smax - (in) spans min/max height +// flags - (in) span flags (zero or WALKABLE) +// flagMergeThr - (in) merge threshold. +void rcAddSpan(rcHeightfield& solid, const int x, const int y, + const unsigned short smin, const unsigned short smax, + const unsigned short flags, const int flagMergeThr); + // Rasterizes a triangle into heightfield spans. // Params: // v0,v1,v2 - (in) the vertices of the triangle. diff --git a/Recast/Source/RecastRasterization.cpp b/Recast/Source/RecastRasterization.cpp index 84284e6..6d8e087 100644 --- a/Recast/Source/RecastRasterization.cpp +++ b/Recast/Source/RecastRasterization.cpp @@ -83,9 +83,9 @@ static void freeSpan(rcHeightfield& hf, rcSpan* ptr) hf.freelist = ptr; } -static void addSpan(rcHeightfield& hf, const int x, const int y, - const unsigned short smin, const unsigned short smax, - const unsigned short flags, const int flagMergeThr) +void rcAddSpan(rcHeightfield& hf, const int x, const int y, + const unsigned short smin, const unsigned short smax, + const unsigned short flags, const int flagMergeThr) { int idx = x + y*hf.width; @@ -263,7 +263,7 @@ static void rasterizeTri(const float* v0, const float* v1, const float* v2, unsigned short ismin = (unsigned short)rcClamp((int)floorf(smin * ich), 0, 0x7fff); unsigned short ismax = (unsigned short)rcClamp((int)ceilf(smax * ich), 0, 0x7fff); - addSpan(hf, x, y, ismin, ismax, flags, flagMergeThr); + rcAddSpan(hf, x, y, ismin, ismax, flags, flagMergeThr); } } } diff --git a/RecastDemo/Bin/Recast.app/Contents/MacOS/Recast b/RecastDemo/Bin/Recast.app/Contents/MacOS/Recast index 7cbfd8b..714caed 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 12f9833..941e7cc 100644 --- a/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.pbxuser +++ b/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.pbxuser @@ -983,6 +983,12 @@ 6B324F441125891F00EBD2FD /* PBXTextBookmark */ = 6B324F441125891F00EBD2FD /* PBXTextBookmark */; 6B324F451125891F00EBD2FD /* PBXTextBookmark */ = 6B324F451125891F00EBD2FD /* PBXTextBookmark */; 6B324F471125894D00EBD2FD /* PBXTextBookmark */ = 6B324F471125894D00EBD2FD /* PBXTextBookmark */; + 6B324F4911258C7000EBD2FD /* PBXTextBookmark */ = 6B324F4911258C7000EBD2FD /* PBXTextBookmark */; + 6B324F4A11258C7000EBD2FD /* PBXTextBookmark */ = 6B324F4A11258C7000EBD2FD /* PBXTextBookmark */; + 6B324F4B11258C7000EBD2FD /* PBXTextBookmark */ = 6B324F4B11258C7000EBD2FD /* PBXTextBookmark */; + 6B324F4C11258C7000EBD2FD /* PBXTextBookmark */ = 6B324F4C11258C7000EBD2FD /* PBXTextBookmark */; + 6B324F4D11258C7000EBD2FD /* PBXTextBookmark */ = 6B324F4D11258C7000EBD2FD /* PBXTextBookmark */; + 6B324F4E11258C7000EBD2FD /* PBXTextBookmark */ = 6B324F4E11258C7000EBD2FD /* PBXTextBookmark */; 6B69739F10FFCA4500984788 = 6B69739F10FFCA4500984788 /* PBXTextBookmark */; 6B6973A210FFCA4500984788 = 6B6973A210FFCA4500984788 /* PBXTextBookmark */; 6B8DE70D10B01BBF00DF20FB = 6B8DE70D10B01BBF00DF20FB /* PBXTextBookmark */; @@ -1394,9 +1400,9 @@ }; 6B137C7E0F7FCBFE00459200 /* Recast.h */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {815, 9760}}"; - sepNavSelRange = "{4844, 328}"; - sepNavVisRange = "{4505, 1487}"; + sepNavIntBoundsRect = "{{0, 0}, {815, 10256}}"; + sepNavSelRange = "{14702, 0}"; + sepNavVisRange = "{13926, 1346}"; }; }; 6B137C800F7FCBFE00459200 /* RecastLog.h */ = { @@ -1452,9 +1458,9 @@ }; 6B137C880F7FCC1100459200 /* RecastRasterization.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {815, 5632}}"; - sepNavSelRange = "{1836, 0}"; - sepNavVisRange = "{1732, 859}"; + sepNavIntBoundsRect = "{{0, 0}, {815, 5488}}"; + sepNavSelRange = "{2684, 178}"; + sepNavVisRange = "{2394, 676}"; }; }; 6B137C890F7FCC1100459200 /* RecastRegion.cpp */ = { @@ -5286,7 +5292,7 @@ fRef = 6B137C7E0F7FCBFE00459200 /* Recast.h */; name = "Recast.h: 518"; rLen = 36; - rLoc = 18994; + rLoc = 19670; rType = 0; vrLen = 1457; vrLoc = 17378; @@ -5865,7 +5871,7 @@ fRef = 6B137C7E0F7FCBFE00459200 /* Recast.h */; name = "Recast.h: 534"; rLen = 0; - rLoc = 18922; + rLoc = 19598; rType = 0; vrLen = 1493; vrLoc = 18110; @@ -5893,7 +5899,7 @@ fRef = 6B137C7E0F7FCBFE00459200 /* Recast.h */; name = "Recast.h: 534"; rLen = 0; - rLoc = 18922; + rLoc = 19598; rType = 0; vrLen = 1493; vrLoc = 18110; @@ -6243,7 +6249,7 @@ fRef = 6B137C7E0F7FCBFE00459200 /* Recast.h */; name = "Recast.h: 534"; rLen = 0; - rLoc = 18922; + rLoc = 19598; rType = 0; vrLen = 1493; vrLoc = 18110; @@ -10038,6 +10044,66 @@ vrLen = 907; vrLoc = 7014; }; + 6B324F4911258C7000EBD2FD /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB7FC0A10EBB6AA006DA0A6 /* NavMeshTesterTool.cpp */; + name = "NavMeshTesterTool.cpp: 272"; + rLen = 0; + rLoc = 7129; + rType = 0; + vrLen = 907; + vrLoc = 7014; + }; + 6B324F4A11258C7000EBD2FD /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B137C880F7FCC1100459200 /* RecastRasterization.cpp */; + name = "RecastRasterization.cpp: 86"; + rLen = 178; + rLoc = 2684; + rType = 0; + vrLen = 676; + vrLoc = 2394; + }; + 6B324F4B11258C7000EBD2FD /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B137C7E0F7FCBFE00459200 /* Recast.h */; + name = "Recast.h: 131"; + rLen = 328; + rLoc = 4844; + rType = 0; + vrLen = 1230; + vrLoc = 4505; + }; + 6B324F4C11258C7000EBD2FD /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB7FC0A10EBB6AA006DA0A6 /* NavMeshTesterTool.cpp */; + name = "NavMeshTesterTool.cpp: 272"; + rLen = 0; + rLoc = 7129; + rType = 0; + vrLen = 907; + vrLoc = 7014; + }; + 6B324F4D11258C7000EBD2FD /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B137C880F7FCC1100459200 /* RecastRasterization.cpp */; + name = "RecastRasterization.cpp: 86"; + rLen = 178; + rLoc = 2684; + rType = 0; + vrLen = 676; + vrLoc = 2394; + }; + 6B324F4E11258C7000EBD2FD /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B137C7E0F7FCBFE00459200 /* Recast.h */; + name = "Recast.h: 439"; + rLen = 0; + rLoc = 14702; + rType = 0; + vrLen = 1346; + vrLoc = 13926; + }; 6B555DAE100B211D00247EA3 /* imguiRenderGL.h */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {915, 492}}"; @@ -11466,7 +11532,7 @@ fRef = 6B137C880F7FCC1100459200 /* RecastRasterization.cpp */; name = "RecastRasterization.cpp: 145"; rLen = 0; - rLoc = 3893; + rLoc = 3890; rType = 0; vrLen = 588; vrLoc = 3412; @@ -11516,7 +11582,7 @@ fRef = 6B137C880F7FCC1100459200 /* RecastRasterization.cpp */; name = "RecastRasterization.cpp: 131"; rLen = 12; - rLoc = 3614; + rLoc = 3611; rType = 0; vrLen = 605; vrLoc = 3228; @@ -11536,7 +11602,7 @@ fRef = 6B137C880F7FCC1100459200 /* RecastRasterization.cpp */; name = "RecastRasterization.cpp: 130"; rLen = 0; - rLoc = 3567; + rLoc = 3564; rType = 0; vrLen = 605; vrLoc = 3228; @@ -11546,7 +11612,7 @@ fRef = 6B137C880F7FCC1100459200 /* RecastRasterization.cpp */; name = "RecastRasterization.cpp: 133"; rLen = 0; - rLoc = 3686; + rLoc = 3683; rType = 0; vrLen = 598; vrLoc = 3228; @@ -11556,7 +11622,7 @@ fRef = 6B137C880F7FCC1100459200 /* RecastRasterization.cpp */; name = "RecastRasterization.cpp: 272"; rLen = 0; - rLoc = 7212; + rLoc = 7211; rType = 0; vrLen = 889; vrLoc = 6644; @@ -11566,7 +11632,7 @@ fRef = 6B137C880F7FCC1100459200 /* RecastRasterization.cpp */; name = "RecastRasterization.cpp: 272"; rLen = 22; - rLoc = 7202; + rLoc = 7201; rType = 0; vrLen = 1012; vrLoc = 6614; @@ -11576,7 +11642,7 @@ fRef = 6B137C880F7FCC1100459200 /* RecastRasterization.cpp */; name = "RecastRasterization.cpp: 325"; rLen = 0; - rLoc = 8863; + rLoc = 8862; rType = 0; vrLen = 992; vrLoc = 8139; @@ -11596,7 +11662,7 @@ fRef = 6B137C880F7FCC1100459200 /* RecastRasterization.cpp */; name = "RecastRasterization.cpp: 318"; rLen = 0; - rLoc = 8684; + rLoc = 8683; rType = 0; vrLen = 977; vrLoc = 7116; @@ -11646,7 +11712,7 @@ fRef = 6B137C880F7FCC1100459200 /* RecastRasterization.cpp */; name = "RecastRasterization.cpp: 339"; rLen = 0; - rLoc = 9316; + rLoc = 9315; rType = 0; vrLen = 995; vrLoc = 8761; @@ -11756,7 +11822,7 @@ fRef = 6B137C880F7FCC1100459200 /* RecastRasterization.cpp */; name = "RecastRasterization.cpp: 273"; rLen = 0; - rLoc = 7225; + rLoc = 7224; rType = 0; vrLen = 991; vrLoc = 8360; @@ -11766,7 +11832,7 @@ fRef = 6B137C880F7FCC1100459200 /* RecastRasterization.cpp */; name = "RecastRasterization.cpp: 273"; rLen = 0; - rLoc = 7225; + rLoc = 7224; rType = 0; vrLen = 991; vrLoc = 8360; @@ -13533,7 +13599,7 @@ fRef = 6B137C7E0F7FCBFE00459200 /* Recast.h */; name = "Recast.h: 550"; rLen = 0; - rLoc = 20803; + rLoc = 21479; rType = 0; vrLen = 1291; vrLoc = 19607; diff --git a/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.perspectivev3 b/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.perspectivev3 index 9e757fb..ff923a7 100644 --- a/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.perspectivev3 +++ b/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.perspectivev3 @@ -281,8 +281,8 @@ PBXSmartGroupTreeModuleOutlineStateSelectionKey - 50 - 44 + 30 + 21 1 0 @@ -323,7 +323,7 @@ PBXProjectModuleGUID 6B8632A30F78115100E2684A PBXProjectModuleLabel - NavMeshTesterTool.cpp + Recast.h PBXSplitModuleInNavigatorKey Split0 @@ -331,11 +331,11 @@ PBXProjectModuleGUID 6B8632A40F78115100E2684A PBXProjectModuleLabel - NavMeshTesterTool.cpp + Recast.h _historyCapacity 0 bookmark - 6B324F471125894D00EBD2FD + 6B324F4E11258C7000EBD2FD history 6B8DE70D10B01BBF00DF20FB @@ -372,12 +372,10 @@ 6B324CFA111C7B0900EBD2FD 6B324D0F1121C78000EBD2FD 6B324D101121C78000EBD2FD - 6B324D501121D61A00EBD2FD 6B324D511121D61A00EBD2FD 6B324E181125566A00EBD2FD 6B324E2C1125598400EBD2FD 6B324E3B11255BA700EBD2FD - 6B324E4911255F5B00EBD2FD 6B324E6D11256D1000EBD2FD 6B324E6E11256D1000EBD2FD 6B324E7011256D1000EBD2FD @@ -398,7 +396,9 @@ 6B324F3B1125891F00EBD2FD 6B324F3C1125891F00EBD2FD 6B324F3D1125891F00EBD2FD - 6B324F3E1125891F00EBD2FD + 6B324F4911258C7000EBD2FD + 6B324F4A11258C7000EBD2FD + 6B324F4B11258C7000EBD2FD prevStack @@ -575,6 +575,8 @@ 6B324F421125891F00EBD2FD 6B324F431125891F00EBD2FD 6B324F441125891F00EBD2FD + 6B324F4C11258C7000EBD2FD + 6B324F4D11258C7000EBD2FD SplitCount