maxSegments parameter for dtNavMeshQuery::getPolyWallSegments

16 views
Skip to first unread message

Julien

unread,
Nov 21, 2011, 4:07:23 PM11/21/11
to recastnavigation
Hi all,

I pass DT_VERTS_PER_POLYGON as the value for maxSegments to the
dtNavMeshQuery::getPolyWallSegments method. It works well in most
cases, but sometimes it seems that more segments are "detected" and I
get a status with the DT_BUFFER_TOO_SMALL set. I thought that using
DT_VERTS_PER_POLYGON was in line with the comment right above the
method prototype:

"The @p segmentVerts and @p segmentRefs buffers should normally be
sized for the
maximum segments per polygon of the source navigation mesh."

Did I miss something? I fixed it by increasing the value I pass as
maxSegments, but I'd like to have a better understanding of what's
going on.

Thanks for your help in advance!

Mikko Mononen

unread,
Nov 22, 2011, 1:01:50 AM11/22/11
to recastna...@googlegroups.com
The can potentially be more segments at the tile boundary in case the portals dont match perfectly. I think i used 2*maxverts in my examples.

Do you have example (screenshot) case where buffer is too small?

--mikko

Sent from my iPhone

Julien

unread,
Nov 22, 2011, 9:05:08 PM11/22/11
to recastnavigation
Here are some screenshots with the walls edges in red (there's one
edge missing in that case), the navmesh and the tiles:
http://imgur.com/aJo3q
http://imgur.com/Ijcn8
http://imgur.com/Usp2x

In that case using maxverts + 1 fixes the problem.

On Nov 22, 1:01 am, Mikko Mononen <memono...@gmail.com> wrote:
> The can potentially be more segments at the tile boundary in case the portals dont match perfectly. I think i used 2*maxverts in my examples.
>
> Do you have example (screenshot) case where buffer is too small?
>
> --mikko
>
> Sent from my iPhone
>

Mikko Mononen

unread,
Nov 23, 2011, 5:36:36 AM11/23/11
to recastna...@googlegroups.com
Hmm... looks like that polygon has 7 vertices and it looks concave.
There's actually two of them. Are you using unmodified tile cache?

--mikko

Julien

unread,
Nov 23, 2011, 10:03:24 AM11/23/11
to recastnavigation
By unmodified, do you mean unmodified implementation (code)? Or
unmodified data?

Mikko Mononen

unread,
Nov 23, 2011, 11:38:33 AM11/23/11
to recastna...@googlegroups.com
Both. Should i be able to repro the problem with the svn version?

--mikko

Sent from my iPhone

Reply all
Reply to author
Forward
0 new messages