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

Method updateScbStateAndSetupSq

physx/source/physx/src/NpScene.cpp:412–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410}
411
412void NpScene::updateScbStateAndSetupSq(const PxRigidActor& rigidActor, Scb::Actor& scbActor, NpShapeManager& shapeManager, bool actorDynamic, const PxBounds3* bounds, bool hasPrunerStructure)
413{
414 // all the things Scb does in non-buffered insertion
415 SceneQueryManager& sqManager = getSceneQueryManagerFast();
416
417 scbActor.setScbScene(&mScene);
418 scbActor.setControlState(Scb::ControlState::eIN_SCENE);
419 NpShape*const * shapes = shapeManager.getShapes();
420 PxU32 nbShapes = shapeManager.getNbShapes();
421
422 for(PxU32 i=0;i<nbShapes;i++)
423 {
424 NpShape& shape = *shapes[i];
425 const PxShapeFlags shapeFlags = shape.getFlagsUnbuffered(); // PT: note that the regular code reads buffered flags
426
427 shape.incRefCount();
428 if(shape.isExclusiveFast())
429 {
430 shape.getScbShape().setScbScene(&mScene);
431 shape.getScbShape().setControlState(Scb::ControlState::eIN_SCENE);
432 }
433
434 // PT: this part is copied from 'NpShapeManager::setupAllSceneQuery'
435 if(shapeFlags & PxShapeFlag::eSCENE_QUERY_SHAPE) // PT: TODO: refactor with 'isSceneQuery' in shape manager?
436 shapeManager.addPrunerShape(sqManager, i, shape, rigidActor, actorDynamic, bounds ? bounds+i : NULL, hasPrunerStructure);
437 }
438}
439
440PX_FORCE_INLINE void NpScene::updateScbStateAndSetupSq(const PxRigidActor& rigidActor, Scb::Body& body, NpShapeManager& shapeManager, bool actorDynamic, const PxBounds3* bounds, bool hasPrunerStructure)
441{

Callers

nothing calls this directly

Calls 6

getFlagsUnbufferedMethod · 0.80
getShapesMethod · 0.45
getNbShapesMethod · 0.45
incRefCountMethod · 0.45
addPrunerShapeMethod · 0.45
initBufferedStateMethod · 0.45

Tested by

no test coverage detected