| 361 | } |
| 362 | |
| 363 | void 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 | |
| 409 | void NpScene::updateScbStateAndSetupSq(const PxRigidActor& rigidActor, Scb::Actor& scbActor, NpShapeManager& shapeManager, bool actorDynamic, const PxBounds3* bounds, bool hasPrunerStructure) |
| 410 | { |
no test coverage detected