Commit 1c8283c
committed
fix(recast): fix box_blur and merge_small_regions to match C++
Bug #24: merge_small_regions was missing canMergeWithRegion checks
(area type, connection count, floor overlaps) and proper mergeRegions
connection topology splicing. Also fix replace_neighbour to update
floor lists and use removeAdjacentNeighbours.
Bug #25: box_blur divided by actual neighbor count instead of always 9.
C++ pads missing neighbors with the center value and uses (d+5)/9.
This produced wrong smoothed distances, causing flood_region to create
~100 extra region IDs (253 vs 148 for nav_test).
After fix: nav_test regions 147 (exact match with C++), contours 149
(exact match). Polygons 534 vs 537 (0.994x).1 parent 31a08c3 commit 1c8283c
File tree
5 files changed
+211
-81
lines changed- crates
- detour/tests
- recast
- src
- tests
5 files changed
+211
-81
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | | - | |
52 | | - | |
| 52 | + | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | | - | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
86 | 88 | | |
87 | | - | |
| 89 | + | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
853 | 853 | | |
854 | 854 | | |
855 | 855 | | |
856 | | - | |
| 856 | + | |
| 857 | + | |
857 | 858 | | |
858 | 859 | | |
859 | 860 | | |
| |||
888 | 889 | | |
889 | 890 | | |
890 | 891 | | |
891 | | - | |
892 | 892 | | |
893 | | - | |
| 893 | + | |
894 | 894 | | |
895 | 895 | | |
896 | 896 | | |
897 | 897 | | |
898 | | - | |
899 | 898 | | |
900 | 899 | | |
901 | 900 | | |
902 | 901 | | |
903 | 902 | | |
904 | | - | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
905 | 906 | | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
906 | 911 | | |
907 | 912 | | |
908 | 913 | | |
909 | | - | |
| 914 | + | |
| 915 | + | |
910 | 916 | | |
911 | 917 | | |
912 | 918 | | |
| |||
0 commit comments