MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / raycast

Method raycast

physx/source/physx/src/NpBatchQuery.cpp:470–490  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers 15

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
raycastSingleMethod · 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