MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / raycast

Method raycast

deps/physx/physx/source/physx/src/NpBatchQuery.cpp:471–491  ·  view source on GitHub ↗

//////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

469
470///////////////////////////////////////////////////////////////////////////////
471void NpBatchQuery::raycast(
472 const PxVec3& origin, const PxVec3& unitDir, PxReal distance, PxU16 maxTouchHits,
473 PxHitFlags hitFlags, const PxQueryFilterData& fd, void* userData, const PxQueryCache* cache)
474{
475 PX_CHECK_AND_RETURN(distance>0, "PxBatchQuery::raycast: The maximum distance must be greater than zero!");
476 PX_CHECK_AND_RETURN(unitDir.isNormalized(), "PxBatchQuery::raycast: Direction must be normalized");
477 PX_CHECK_AND_RETURN(origin.isFinite(), "PxBatchQuery::raycast: origin is not valid");
478 if (mNbRaycasts >= mDesc.queryMemory.getMaxRaycastsPerExecute())
479 {
480 PX_CHECK_AND_RETURN(mNbRaycasts < mDesc.queryMemory.getMaxRaycastsPerExecute(),
481 "PxBatchQuery: number of raycast() calls exceeds PxBatchQueryMemory::raycastResultBufferSize, query discarded");
482 return;
483 }
484 CHECK_RUNNING("PxBatchQuery::raycast: This batch is still executing, skipping query.");
485 mNbRaycasts++;
486
487 writeBatchHeader(BatchStreamHeader(hitFlags, cache, fd, userData, maxTouchHits, QTypeROS::eRAYCAST));
488 writeQueryInput(mStream, MultiQueryInput(origin, unitDir, distance));
489
490 Ps::atomicExchange(&mBatchQueryIsRunning, 0);
491}
492
493///////////////////////////////////////////////////////////////////////////////
494void NpBatchQuery::overlap(

Callers 15

RaycastMethod · 0.45
threadExecuteFunction · 0.45
addTreesMethod · 0.45
onPointerInputEventMethod · 0.45
getPlaceOnFloorMethod · 0.45
scanForObstaclesMethod · 0.45
createDynamicActorsMethod · 0.45
pickMethod · 0.45
CCDRaycastFunction · 0.45
updateMethod · 0.45
onPointerInputEventMethod · 0.45
raycastAnyMethod · 0.45

Calls 6

writeQueryInputFunction · 0.85
MultiQueryInputClass · 0.85
BatchStreamHeaderClass · 0.70
atomicExchangeFunction · 0.50
isNormalizedMethod · 0.45
isFiniteMethod · 0.45

Tested by

no test coverage detected