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

Method addActorInternal

deps/physx/physx/source/physx/src/NpScene.cpp:363–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

361}
362
363void NpScene::addActorInternal(PxActor& actor, const PxBVHStructure* bvhStructure)
364{
365 // BvhStructure check
366 if(bvhStructure)
367 {
368 const PxRigidActor* rigidActor = actor.is<PxRigidActor>();
369 if(!rigidActor || bvhStructure->getNbBounds() == 0 || bvhStructure->getNbBounds() > rigidActor->getNbShapes())
370 {
371 Ps::getFoundation().error(PxErrorCode::eINVALID_PARAMETER, __FILE__, __LINE__, "PxRigidActor::setBVHStructure structure is empty or does not match shapes in the actor.");
372 return;
373 }
374 }
375
376 switch(actor.getConcreteType())
377 {
378 case PxConcreteType::eRIGID_STATIC:
379 {
380 NpRigidStatic& npStatic = static_cast<NpRigidStatic&>(actor);
381#if PX_CHECKED
382 checkPositionSanity(npStatic, npStatic.getGlobalPose(), "PxScene::addActor or PxScene::addAggregate");
383#endif
384 addRigidStatic(npStatic, static_cast<const Gu::BVHStructure*>(bvhStructure));
385 }
386 break;
387
388 case PxConcreteType::eRIGID_DYNAMIC:
389 {
390 NpRigidDynamic& npDynamic = static_cast<NpRigidDynamic&>(actor);
391#if PX_CHECKED
392 checkPositionSanity(npDynamic, npDynamic.getGlobalPose(), "PxScene::addActor or PxScene::addAggregate");
393#endif
394 addRigidDynamic(npDynamic, static_cast<const Gu::BVHStructure*>(bvhStructure));
395 }
396 break;
397
398 case PxConcreteType::eARTICULATION_LINK:
399 {
400 Ps::getFoundation().error(PxErrorCode::eDEBUG_WARNING, __FILE__, __LINE__, "PxScene::addActor(): Individual articulation links can not be added to the scene");
401 }
402 break;
403
404 default:
405 PX_ASSERT(0);
406 }
407}
408
409void NpScene::updateScbStateAndSetupSq(const PxRigidActor& rigidActor, Scb::Actor& scbActor, NpShapeManager& shapeManager, bool actorDynamic, const PxBounds3* bounds, bool hasPrunerStructure)
410{

Callers 1

addAggregateMethod · 0.45

Calls 5

getNbBoundsMethod · 0.80
getNbShapesMethod · 0.45
errorMethod · 0.45
getConcreteTypeMethod · 0.45
getGlobalPoseMethod · 0.45

Tested by

no test coverage detected