Merge pull request #119 from richard-fine/features/raycast-edgeinfo
Include hit edge index in dtRaycastHit.
This commit is contained in:
commit
2ea77f6cf4
@ -131,6 +131,9 @@ struct dtRaycastHit
|
|||||||
|
|
||||||
/// hitNormal The normal of the nearest wall hit. [(x, y, z)]
|
/// hitNormal The normal of the nearest wall hit. [(x, y, z)]
|
||||||
float hitNormal[3];
|
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]
|
/// Pointer to an array of reference ids of the visited polygons. [opt]
|
||||||
dtPolyRef* path;
|
dtPolyRef* path;
|
||||||
|
@ -2420,6 +2420,9 @@ dtStatus dtNavMeshQuery::raycast(dtPolyRef startRef, const float* startPos, cons
|
|||||||
hit->pathCount = n;
|
hit->pathCount = n;
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hit->hitEdgeIndex = segMax;
|
||||||
|
|
||||||
// Keep track of furthest t so far.
|
// Keep track of furthest t so far.
|
||||||
if (tmax > hit->t)
|
if (tmax > hit->t)
|
||||||
hit->t = tmax;
|
hit->t = tmax;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user