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

Method addId

physx/source/common/src/CmCollection.cpp:79–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79void Collection::addId(PxBase& object, PxSerialObjectId id)
80{
81 PX_CHECK_AND_RETURN(contains(object), "PxCollection::addId called for object that is not contained in the collection!");
82 PX_CHECK_AND_RETURN(id != PX_SERIAL_OBJECT_ID_INVALID, "PxCollection::addId called with PxSerialObjectId being set to PX_SERIAL_OBJECT_ID_INVALID!");
83 PX_CHECK_AND_RETURN(mIds.find(id) == NULL, "PxCollection::addId called with an id which is already used in the collection!");
84
85 const ObjectToIdMap::Entry* e = mObjects.find(&object);
86 if(e && e->second != PX_SERIAL_OBJECT_ID_INVALID)
87 mIds.erase(e->second);
88
89 mIds.insert(id, &object);
90 mObjects[&object] = id;
91}
92
93void Collection::removeId(PxSerialObjectId id)
94{

Callers 2

saveMethod · 0.80

Calls 4

containsFunction · 0.50
findMethod · 0.45
eraseMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected