Skip to content

Connect tile polygons from different layers#1

Open
elsid wants to merge 1 commit into
OpenMW:openmw-fixesfrom
elsid:layered_navmesh
Open

Connect tile polygons from different layers#1
elsid wants to merge 1 commit into
OpenMW:openmw-fixesfrom
elsid:layered_navmesh

Conversation

@elsid

@elsid elsid commented May 24, 2026

Copy link
Copy Markdown

Fixes recastnavigation#818.

If a polygon is located at the top or bottom of a tile there is no indication of border polygon added by recast functions used to generate rcPolyMeshDetail. It is possible to have another tile higher or lower with the same polygon if they were generated from the same geometry which means they should be connected. But since there is no indication this does not happen and paths crossing a tile boundary cannot be found. A spiral stairs is an example used in the added test demonstrate the problem.

To workaround this problem check the centroid proximity of polygons on connecting 2 tiles in NavMesh::addTile. Consider them connected if they are close enough. This has some performance impact but the alternative is to modify recast functions to add indication which is a more complicated solution.

If a polygon is located at the top or bottom of a tile there is no
indication of border polygon added by recast functions used to generate
rcPolyMeshDetail. It is possible to have another tile higher or lower
with the same polygon if they were generated from the same geometry
which means they should be connected. But since there is no indication
this does not happen and paths crossing a tile boundary cannot be found.
A spiral stairs is an example used in the added test to demonstrate the
problem.

To workaround this problem check the centroid proximity of polygons on
connecting 2 tiles in NavMesh::addTile. Consider them connected if they
are close enough. This has some performance impact but the alternative
is to modify recast functions to add indication which is a more
complicated solution.
@elsid elsid force-pushed the layered_navmesh branch from cd35c6e to 4533f83 Compare May 31, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant