| 399 | ////////////////////////////////////////////////////////////////////////// |
| 400 | |
| 401 | void PruningStructure::invalidate(PxActor* actor) |
| 402 | { |
| 403 | PX_ASSERT(actor); |
| 404 | |
| 405 | // remove actor from the actor list to avoid mem corruption |
| 406 | // this slow, but should be called only with error msg send to user about invalid behavior |
| 407 | for (PxU32 i = 0; i < mNbActors; i++) |
| 408 | { |
| 409 | if(mActors[i] == actor) |
| 410 | { |
| 411 | // set pruning structure to NULL and remove the actor from the list |
| 412 | PxType type = mActors[i]->getConcreteType(); |
| 413 | if (type == PxConcreteType::eRIGID_STATIC) |
| 414 | { |
| 415 | static_cast<NpRigidStatic*>(mActors[i])->getShapeManager().setPruningStructure(NULL); |
| 416 | } |
| 417 | else if (type == PxConcreteType::eRIGID_DYNAMIC) |
| 418 | { |
| 419 | static_cast<NpRigidDynamic*>(mActors[i])->getShapeManager().setPruningStructure(NULL); |
| 420 | } |
| 421 | |
| 422 | mActors[i] = mActors[mNbActors--]; |
| 423 | break; |
| 424 | } |
| 425 | } |
| 426 | |
| 427 | mValid = false; |
| 428 | } |
| 429 |
no test coverage detected