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

Method addPrunerShape

physx/source/scenequery/src/SqSceneQueryManager.cpp:311–347  ·  view source on GitHub ↗

PT: TODO: consider passing the payload directly to this function, for a cleaner interface that makes more sense. But the shape & actor pointers are used directly in the function, so this whole thing is fishy.

Source from the content-addressed store, hash-verified

309// PT: TODO: consider passing the payload directly to this function, for a cleaner interface that makes more sense.
310// But the shape & actor pointers are used directly in the function, so this whole thing is fishy.
311PrunerData SceneQueryManager::addPrunerShape(const Scb::Shape& scbShape, const Scb::Actor& scbActor, bool dynamic, PrunerCompoundId compoundId, const PxBounds3* bounds, bool hasPrunerStructure)
312{
313 mPrunerNeedsUpdating = true;
314
315 PrunerPayload pp;
316 pp.data[0] = size_t(&scbShape); //PAYLOAD
317 pp.data[1] = size_t(&scbActor); //PAYLOAD
318
319 const PxU32 index = PxU32(dynamic);
320 PrunerHandle handle;
321
322 mPrunerExt[index].invalidateTimestamp();
323 if(compoundId == INVALID_PRUNERHANDLE)
324 {
325 PxBounds3 b;
326 if(bounds)
327 inflateBounds(b, *bounds);
328 else
329 (gComputeBoundsTable[dynamic])(b, scbShape, scbActor);
330
331 PX_ASSERT(mPrunerExt[index].pruner());
332 mPrunerExt[index].pruner()->addObjects(&handle, &b, &pp, 1, hasPrunerStructure);
333
334 mPrunerExt[index].growDirtyList(handle);
335 }
336 else
337 {
338 PxBounds3 b;
339 const PxTransform& shape2Actor = scbShape.getShape2Actor();
340 Gu::computeBounds(b, scbShape.getGeometry(), shape2Actor, 0.0f, NULL, SQ_PRUNER_INFLATION);
341
342 PX_ASSERT(mCompoundPrunerExt.pruner());
343 mCompoundPrunerExt.pruner()->addObject(compoundId, handle, b, pp);
344 }
345
346 return createPrunerData(index, handle);
347}
348
349const PrunerPayload& SceneQueryManager::getPayload(PrunerCompoundId compoundId, PrunerData data) const
350{

Callers

nothing calls this directly

Calls 8

computeBoundsFunction · 0.85
invalidateTimestampMethod · 0.80
growDirtyListMethod · 0.80
inflateBoundsFunction · 0.70
prunerMethod · 0.45
addObjectsMethod · 0.45
getGeometryMethod · 0.45
addObjectMethod · 0.45

Tested by

no test coverage detected