MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / release

Method release

src/engine/PhysicsCommon.cpp:134–214  ·  view source on GitHub ↗

Destroy and release everything that has been allocated

Source from the content-addressed store, hash-verified

132
133// Destroy and release everything that has been allocated
134void PhysicsCommon::release() {
135
136 // Destroy the physics worlds
137 for (auto it = mPhysicsWorlds.begin(); it != mPhysicsWorlds.end(); ++it) {
138 deletePhysicsWorld(*it);
139 }
140 mPhysicsWorlds.clear();
141
142 // Destroy the sphere shapes
143 for (auto it = mSphereShapes.begin(); it != mSphereShapes.end(); ++it) {
144 deleteSphereShape(*it);
145 }
146 mSphereShapes.clear();
147
148 // Destroy the box shapes
149 for (auto it = mBoxShapes.begin(); it != mBoxShapes.end(); ++it) {
150 deleteBoxShape(*it);
151 }
152 mBoxShapes.clear();
153
154 // Destroy the capsule shapes
155 for (auto it = mCapsuleShapes.begin(); it != mCapsuleShapes.end(); ++it) {
156 deleteCapsuleShape(*it);
157 }
158 mCapsuleShapes.clear();
159
160 // Destroy the convex mesh shapes
161 for (auto it = mConvexMeshShapes.begin(); it != mConvexMeshShapes.end(); ++it) {
162 deleteConvexMeshShape(*it);
163 }
164 mConvexMeshShapes.clear();
165
166 // Destroy the heigh-field shapes
167 for (auto it = mHeightFieldShapes.begin(); it != mHeightFieldShapes.end(); ++it) {
168 deleteHeightFieldShape(*it);
169 }
170 mHeightFieldShapes.clear();
171
172 // Destroy the concave mesh shapes
173 for (auto it = mConcaveMeshShapes.begin(); it != mConcaveMeshShapes.end(); ++it) {
174 deleteConcaveMeshShape(*it);
175 }
176 mConcaveMeshShapes.clear();
177
178 // Destroy the convex mesh
179 for (auto it = mConvexMeshes.begin(); it != mConvexMeshes.end(); ++it) {
180 deleteConvexMesh(*it);
181 }
182 mConvexMeshes.clear();
183
184 // Destroy the triangle mesh
185 for (auto it = mTriangleMeshes.begin(); it != mTriangleMeshes.end(); ++it) {
186 deleteTriangleMesh(*it);
187 }
188 mTriangleMeshes.clear();
189
190 // Destroy the height-field mesh
191 for (auto it = mHeightFields.begin(); it != mHeightFields.end(); ++it) {

Callers 15

destroyRigidBodyMethod · 0.45
destroyJointMethod · 0.45
deletePhysicsWorldMethod · 0.45
deleteSphereShapeMethod · 0.45
deleteBoxShapeMethod · 0.45
deleteCapsuleShapeMethod · 0.45
deleteConvexMeshShapeMethod · 0.45
createHeightFieldMethod · 0.45
createConvexMeshMethod · 0.45
deleteConvexMeshMethod · 0.45

Calls 3

beginMethod · 0.45
endMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected