Include hit edge index in dtRaycastHit.

This makes it simpler to investigate exactly what is blocking a ray - for example, if an agent cannot move onto a polygon due to QueryFilter flags, then this provides a way for the agent to find out which flags it needs to have and to perform a state change which alters its movement flags.
This commit is contained in:
Richard Fine
2015-11-15 21:46:30 +00:00
parent 2bcd32b0a3
commit 67736ae7d5
2 changed files with 6 additions and 0 deletions
+3
View File
@@ -2420,6 +2420,9 @@ dtStatus dtNavMeshQuery::raycast(dtPolyRef startRef, const float* startPos, cons
hit->pathCount = n;
return status;
}
hit->hitEdgeIndex = segMax;
// Keep track of furthest t so far.
if (tmax > hit->t)
hit->t = tmax;