Closed GoogleCodeExporter closed 9 years ago
On further inspection the raycast checks the next tile, then finds the link
back to
the previous tile and checks that, bouncing between the two indefinitly. It
would be
solved by always excluding off mesh links I guess.
Is it valid to raycast over an off mesh connection?
Original comment by cameron....@gmail.com
on 14 Apr 2010 at 6:21
Thanks for the report. My earlier tests did not capture this, but I'm able to
repro it.
Raycast should not follow off-mesh connections.
Efficient solution did not seem to be a simple one.
Original comment by memono...@gmail.com
on 14 Apr 2010 at 6:51
Could you not always treat jump links as walls on this line?
if (!nextRef || !passFilter(filter, getPolyFlags(nextRef)))
Original comment by cameron....@gmail.com
on 14 Apr 2010 at 11:22
Ah I see, the flags are specified by the app rather than Detour itself.
Original comment by cameron....@gmail.com
on 14 Apr 2010 at 11:24
I think I have a fix.
In dtNavMesh::raycast() Replace:
if (!nextRef || !passFilter(filter, getPolyFlags(nextRef)))
With:
const dtPoly* nextPoly = nextRef ? getPolyByRef(nextRef) : 0;
if (!nextPoly || nextPoly->type == DT_POLYTYPE_OFFMESH_CONNECTION ||
!passFilter(filter, nextPoly->flags))
This worked OK for me, although raycast ends up recalculating the current poly a
couple of times in the loop which is a bit wasteful.
Original comment by cameron....@gmail.com
on 15 Apr 2010 at 12:11
That does not work correctly, it should never follow the link to that off-mesh
connection.
Original comment by memono...@gmail.com
on 15 Apr 2010 at 6:56
Fixed in R157.
Original comment by memono...@gmail.com
on 15 Apr 2010 at 7:23
Original issue reported on code.google.com by
cameron....@gmail.com
on 14 Apr 2010 at 6:05Attachments: