Archive 17/01/2023.

Prevent navmesh generation for surfaces INSIDE collisionshape

dertom

Hi there,
is it possible to tell the navmesh generator to take not only the outline-wireframe of the collsionshape (no matter if box or convex) but also the area inside out of the navmesh? See the red marked area in the screenshot.

(This is me current navmesh generation-code:

m_navMesh = m_scene->GetOrCreateComponent<NavigationMesh>();
m_navMesh->SetTileSize(32);
m_navMesh->SetAgentRadius(0.005f);
m_navMesh->SetAgentMaxClimb(0.25f);
m_navMesh->SetPadding(Vector3(0.0f,10.0f,0.0f));
m_navMesh->Build();

)

Untitled

Btw, urho3d rocks!

Sinoid

Your only options are to use an Obstacle or NavArea. If the NavArea’s AreaID == 0 then it will mark the overlapping cells as non-walkable (RC_NULL_AREA internally) and they won’t appear in the final mesh.

dertom

Thx for the fast reply. I will give it a try.

Sinoid

If boxes aren’t good enough you can add cylinders to the code with relative ease (rcMarkCylinderArea).

No idea why I didn’t originally implement those, I think contrib. standards might have been higher back then and Bullet/Box2D were the only things doing really wonky things for shapes.

dertom

Thx dude, using NavArea with AreadID==0 works as wanted. No need for CylinderShape (yet).