MCPcopy Create free account
hub / github.com/axmolengine/axmol / raycast

Method raycast

3rdparty/recast/DetourNavMeshQuery.cpp:2408–2425  ·  view source on GitHub ↗

@par This method is meant to be used for quick, short distance checks. If the path array is too small to hold the result, it will be filled as far as possible from the start postion toward the end position. Using the Hit Parameter (t) If the hit parameter is a very high value (FLT_MAX), then the ray has hit the end position. In this case the path represents a valid corridor to the end p

Source from the content-addressed store, hash-verified

2406/// this method is meant for short distance checks.
2407///
2408dtStatus dtNavMeshQuery::raycast(dtPolyRef startRef, const float* startPos, const float* endPos,
2409 const dtQueryFilter* filter,
2410 float* t, float* hitNormal, dtPolyRef* path, int* pathCount, const int maxPath) const
2411{
2412 dtRaycastHit hit;
2413 hit.path = path;
2414 hit.maxPath = maxPath;
2415
2416 dtStatus status = raycast(startRef, startPos, endPos, filter, 0, &hit);
2417
2418 *t = hit.t;
2419 if (hitNormal)
2420 dtVcopy(hitNormal, hit.hitNormal);
2421 if (pathCount)
2422 *pathCount = hit.pathCount;
2423
2424 return status;
2425}
2426
2427
2428/// @par

Callers 1

Calls 14

dtVcopyFunction · 0.85
dtVisfiniteFunction · 0.85
dtVsubFunction · 0.85
dtVsetFunction · 0.85
dtIntersectSegmentPoly2DFunction · 0.85
dtSwapFunction · 0.85
dtVmadFunction · 0.85
dtSqrFunction · 0.85
dtVnormalizeFunction · 0.85
getCostMethod · 0.80
passFilterMethod · 0.80

Tested by

no test coverage detected