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