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

Method createCollection

physx/source/physxextensions/src/ExtCollection.cpp:101–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101PxCollection* PxCollectionExt::createCollection(PxPhysics& physics)
102{
103 PxCollection* collection = PxCreateCollection();
104 if (!collection)
105 return NULL;
106
107 // Collect convexes
108 {
109 shdfnd::Array<PxConvexMesh*> objects(physics.getNbConvexMeshes());
110 const PxU32 nb = physics.getConvexMeshes(objects.begin(), objects.size());
111 PX_ASSERT(nb == objects.size());
112 PX_UNUSED(nb);
113
114 for(PxU32 i=0;i<objects.size();i++)
115 collection->add(*objects[i]);
116 }
117
118 // Collect triangle meshes
119 {
120 shdfnd::Array<PxTriangleMesh*> objects(physics.getNbTriangleMeshes());
121 const PxU32 nb = physics.getTriangleMeshes(objects.begin(), objects.size());
122
123 PX_ASSERT(nb == objects.size());
124 PX_UNUSED(nb);
125
126 for(PxU32 i=0;i<objects.size();i++)
127 collection->add(*objects[i]);
128 }
129
130 // Collect heightfields
131 {
132 shdfnd::Array<PxHeightField*> objects(physics.getNbHeightFields());
133 const PxU32 nb = physics.getHeightFields(objects.begin(), objects.size());
134
135 PX_ASSERT(nb == objects.size());
136 PX_UNUSED(nb);
137
138 for(PxU32 i=0;i<objects.size();i++)
139 collection->add(*objects[i]);
140 }
141
142 // Collect materials
143 {
144 shdfnd::Array<PxMaterial*> objects(physics.getNbMaterials());
145 const PxU32 nb = physics.getMaterials(objects.begin(), objects.size());
146
147 PX_ASSERT(nb == objects.size());
148 PX_UNUSED(nb);
149
150 for(PxU32 i=0;i<objects.size();i++)
151 collection->add(*objects[i]);
152 }
153
154 // Collect shapes
155 {
156 shdfnd::Array<PxShape*> objects(physics.getNbShapes());
157 const PxU32 nb = physics.getShapes(objects.begin(), objects.size());
158

Callers 1

SnRepXUpgrader.cppFile · 0.80

Calls 15

PxCreateCollectionFunction · 0.85
PX_UNUSEDFunction · 0.85
getNbAggregatesMethod · 0.80
getAggregatesMethod · 0.80
getNbConvexMeshesMethod · 0.45
getConvexMeshesMethod · 0.45
beginMethod · 0.45
sizeMethod · 0.45
addMethod · 0.45
getNbTriangleMeshesMethod · 0.45
getTriangleMeshesMethod · 0.45
getNbHeightFieldsMethod · 0.45

Tested by

no test coverage detected