MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / removeAggregate

Method removeAggregate

deps/physx/physx/source/physx/src/NpScene.cpp:1182–1225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1180}
1181
1182void NpScene::removeAggregate(PxAggregate& aggregate, bool wakeOnLostTouch)
1183{
1184 PX_PROFILE_ZONE("API.removeAggregate", getContextId());
1185 NP_WRITE_CHECK(this);
1186 if(!removeFromSceneCheck(this, aggregate.getScene(), "PxScene::removeAggregate(): Aggregate"))
1187 return;
1188
1189 NpAggregate& np = static_cast<NpAggregate&>(aggregate);
1190 if(np.getScene()!=this)
1191 return;
1192
1193 const PxU32 nb = np.getCurrentSizeFast();
1194 for(PxU32 j=0;j<nb;j++)
1195 {
1196 PxActor* a = np.getActorFast(j);
1197 PX_ASSERT(a);
1198
1199 if (a->getType() != PxActorType::eARTICULATION_LINK)
1200 {
1201 Scb::Actor& scb = NpActor::getScbFromPxActor(*a);
1202
1203 np.getScbAggregate().removeActor(scb, false); // This is only here to make sure the aggregateID gets set to invalid on sync
1204
1205 removeActorInternal(*a, wakeOnLostTouch, false);
1206 }
1207 else if (a->getScene())
1208 {
1209 NpArticulationLink& al = static_cast<NpArticulationLink&>(*a);
1210 PxArticulationBase& npArt = al.getRoot();
1211 PxArticulationImpl* impl = reinterpret_cast<PxArticulationImpl*>(npArt.getImpl());
1212 NpArticulationLink* const* links = impl->getLinks();
1213 for(PxU32 i=0; i < npArt.getNbLinks(); i++)
1214 {
1215 np.getScbAggregate().removeActor(links[i]->getScbActorFast(), false); // This is only here to make sure the aggregateID gets set to invalid on sync
1216 }
1217
1218 removeArticulationInternal(npArt, wakeOnLostTouch, false);
1219 }
1220 }
1221
1222 mScene.removeAggregate(np.getScbAggregate());
1223
1224 removeFromAggregateList(aggregate);
1225}
1226
1227PxU32 NpScene::getNbAggregates() const
1228{

Callers 1

releaseMethod · 0.45

Calls 11

removeFromSceneCheckFunction · 0.85
getCurrentSizeFastMethod · 0.80
getActorFastMethod · 0.80
getContextIdFunction · 0.50
getSceneMethod · 0.45
getTypeMethod · 0.45
removeActorMethod · 0.45
getRootMethod · 0.45
getImplMethod · 0.45
getLinksMethod · 0.45
getNbLinksMethod · 0.45

Tested by

no test coverage detected