| 78 | } |
| 79 | |
| 80 | void NpAggregate::release() |
| 81 | { |
| 82 | NP_WRITE_CHECK(getOwnerScene()); |
| 83 | PX_SIMD_GUARD; |
| 84 | |
| 85 | NpPhysics::getInstance().notifyDeletionListenersUserRelease(this, NULL); |
| 86 | |
| 87 | /* |
| 88 | "An aggregate should be empty when it gets released. If it isn't, the behavior should be: remove the actors from |
| 89 | the aggregate, then remove the aggregate from the scene (if any) then delete it. I guess that implies the actors |
| 90 | get individually reinserted into the broad phase if the aggregate is in a scene." |
| 91 | */ |
| 92 | for(PxU32 i=0;i<mNbActors;i++) |
| 93 | { |
| 94 | if (mActors[i]->getType() == PxActorType::eARTICULATION_LINK) |
| 95 | { |
| 96 | NpArticulationLink* link = static_cast<NpArticulationLink*>(mActors[i]); |
| 97 | PxArticulationImpl* impl = reinterpret_cast<PxArticulationImpl*>(link->getRoot().getImpl()); |
| 98 | impl->setAggregate(NULL); |
| 99 | } |
| 100 | |
| 101 | removeAndReinsert(*mActors[i], true); |
| 102 | } |
| 103 | |
| 104 | NpScene* s = getAPIScene(); |
| 105 | if(s) |
| 106 | { |
| 107 | s->getScene().removeAggregate(getScbAggregate()); |
| 108 | s->removeFromAggregateList(*this); |
| 109 | } |
| 110 | |
| 111 | mAggregate.destroy(); |
| 112 | } |
| 113 | |
| 114 | void NpAggregate::addActorInternal(PxActor& actor, NpScene& s, const PxBVHStructure* bvhStructure) |
| 115 | { |
nothing calls this directly
no test coverage detected