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

Method removeArticulationAndReinsert

physx/source/physx/src/NpAggregate.cpp:290–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288}
289
290bool NpAggregate::removeArticulationAndReinsert(PxArticulationBase& art, bool reinsert)
291{
292 bool found = false;
293 PxU32 idx = 0;
294 while(idx < mNbActors)
295 {
296 if ((mActors[idx]->getType() == PxActorType::eARTICULATION_LINK) && (&static_cast<NpArticulationLink*>(mActors[idx])->getRoot() == &art))
297 {
298 PxActor* a = mActors[idx];
299 mActors[idx] = mActors[--mNbActors];
300 removeAndReinsert(*a, reinsert);
301 found = true;
302 }
303 else
304 idx++;
305 }
306
307 reinterpret_cast<PxArticulationImpl*>(art.getImpl())->setAggregate(NULL);
308
309 if (!found)
310 Ps::getFoundation().error(PxErrorCode::eDEBUG_WARNING, __FILE__, __LINE__, "PxAggregate: can't remove articulation, articulation doesn't belong to aggregate");
311 return found;
312}
313
314bool NpAggregate::removeArticulation(PxArticulationBase& art)
315{

Callers 1

Calls 5

errorMethod · 0.80
getTypeMethod · 0.45
getRootMethod · 0.45
setAggregateMethod · 0.45
getImplMethod · 0.45

Tested by

no test coverage detected