swordlegend / recastnavigation

Automatically exported from code.google.com/p/recastnavigation
zlib License
0 stars 0 forks source link

rcBuildContours fails when small area is marked near tile edge #94

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Select Solo Mesh Tiled generation
2. open nav_test.obj
2. Mark a very small square convex area aprox 5x5 cells very close to the edge 
of the tile, but not touching it.
4. Generate data

What is the expected output? What do you see instead?
Expected - tile is separated into multiple nav polys
Instead - A counter is generated that encompass the entire tiles

What version of the product are you using? On what operating system?
rev 167
Win 7 64 bit
vc9 build

Please provide any additional information below.
Upon investigating this issue this is the data that I've found:
1. Multiple regions are generated for the tile.
2. The marked region is found in the rcBuildContours and a contour is found 
 but the simplifyContour fails. The conditional on aprox ln 298:
->if (differentRegs || areaBorders)
never evaluates to true all points are marked with RC_AREA_BORDER
3. If the volume is placed more towards the center this failure does not happen.
4. If another volume is placed near the volume that didn't generate correctly 
it will generate correctly but the newly placed volume will not 

Original issue reported on code.google.com by shawnlha...@gmail.com on 6 Jul 2010 at 12:13

GoogleCodeExporter commented 9 years ago
Your reasoning sounds valid, but I was not able to reproduce this problem. Can 
you please create a test case for me? Basically create a volume which triggers 
the behavior, press 1 which saves the current setting to "geomset.txt". And 
attach that file here.

Original comment by memono...@gmail.com on 8 Jul 2010 at 12:11

GoogleCodeExporter commented 9 years ago
Here you go; hope this helps. 

Original comment by shawnlha...@gmail.com on 8 Jul 2010 at 1:57

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks, it triggered it. I was actually testing it with Sample_TileMesh, and it 
works.

It seems to be cause by the fact that the watershed partitioning fails in that 
case. It sometimes does when the hole is really small and relatively close to 
an edge (as you might have noticed :)). I have some code in there which tried 
to catch these small pockets, but seems to fail (as you have noticed as well).

I changed the simplification so that if it fails to find initial outline points 
based on the region differences, then it tries to use the fallback method to 
generate the contour. It's fixed in 174.

Original comment by memono...@gmail.com on 8 Jul 2010 at 2:40