Merge pull request #119 from richard-fine/features/raycast-edgeinfo
Include hit edge index in dtRaycastHit.
This commit is contained in:
commit
2ea77f6cf4
@ -132,6 +132,9 @@ struct dtRaycastHit
|
||||
/// hitNormal The normal of the nearest wall hit. [(x, y, z)]
|
||||
float hitNormal[3];
|
||||
|
||||
/// The index of the edge on the final polygon where the wall was hit.
|
||||
int hitEdgeIndex;
|
||||
|
||||
/// Pointer to an array of reference ids of the visited polygons. [opt]
|
||||
dtPolyRef* path;
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user