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

Method add

physx/source/common/src/CmCollection.cpp:36–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34using namespace Cm;
35
36void Collection::add(PxBase& object, PxSerialObjectId id)
37{
38 PxSerialObjectId originId = getId(object);
39 if( originId != PX_SERIAL_OBJECT_ID_INVALID)
40 {
41 if( originId != id)
42 {
43 physx::shdfnd::getFoundation().error(physx::PxErrorCode::eINVALID_PARAMETER, __FILE__, __LINE__,
44 "PxCollection::add called for an object that has an associated id already present in the collection!");
45 }
46 return;
47 }
48
49 if(id != PX_SERIAL_OBJECT_ID_INVALID)
50 {
51 if(!mIds.insert(id, &object))
52 {
53 physx::shdfnd::getFoundation().error(physx::PxErrorCode::eINVALID_PARAMETER, __FILE__, __LINE__,
54 "PxCollection::add called with an id which is already used in the collection");
55 return;
56 }
57 }
58
59 mObjects[&object] = id;
60}
61
62void Collection::remove(PxBase& object)
63{

Callers

nothing calls this directly

Calls 6

errorMethod · 0.80
insertMethod · 0.45
reserveMethod · 0.45
capacityMethod · 0.45
sizeMethod · 0.45
getEntriesMethod · 0.45

Tested by

no test coverage detected