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

Method removeActor

physx/source/physx/src/NpAggregate.cpp:208–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208bool NpAggregate::removeActor(PxActor& actor)
209{
210 NP_WRITE_CHECK(getOwnerScene());
211 PX_SIMD_GUARD;
212
213 if(actor.getType() == PxActorType::eARTICULATION_LINK)
214 {
215 Ps::getFoundation().error(PxErrorCode::eDEBUG_WARNING, __FILE__, __LINE__, "PxAggregate: can't remove articulation link, only whole articulations can be removed");
216 return false;
217 }
218
219 // A.B. remove the BVH structure reference if there is and the aggregate was not added to a scene
220 NpScene* s = getAPIScene();
221 if(!s)
222 {
223 NpActor& np = NpActor::getFromPxActor(actor);
224 Gu::BVHStructure* bvhStructure = NULL;
225 if(np.getConnectors<Gu::BVHStructure>(NpConnectorType::eBvhStructure, &bvhStructure, 1))
226 {
227 np.removeConnector(actor, NpConnectorType::eBvhStructure, bvhStructure, "PxBVHStructure connector could not have been removed!");
228 bvhStructure->decRefCount();
229 }
230 }
231
232 // PT: there are really 2 cases here:
233 // a) the user just wants to remove the actor from the aggregate, but the actor is still alive so if the aggregate has been added to a scene,
234 // we must reinsert the removed actor to that same scene
235 // b) this is called by the framework when releasing an actor, in which case we don't want to reinsert it anywhere.
236 //
237 // We assume that when called by the user, we always want to reinsert. The framework however will call the internal function
238 // without reinsertion.
239 return removeActorAndReinsert(actor, true);
240}
241
242bool NpAggregate::addArticulation(PxArticulationBase& art)
243{

Callers 1

removeAndReinsertMethod · 0.45

Calls 4

errorMethod · 0.80
removeConnectorMethod · 0.80
getTypeMethod · 0.45
decRefCountMethod · 0.45

Tested by

no test coverage detected