MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / release

Method release

physx/source/physx/src/NpAggregate.cpp:80–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void 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
114void NpAggregate::addActorInternal(PxActor& actor, NpScene& s, const PxBVHStructure* bvhStructure)
115{

Callers

nothing calls this directly

Calls 9

getTypeMethod · 0.45
getImplMethod · 0.45
getRootMethod · 0.45
setAggregateMethod · 0.45
removeAggregateMethod · 0.45
getSceneMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected