MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / dWorldDestroy

Function dWorldDestroy

3rd_party/Src/ode/ode/src/ode.cpp:1236–1264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1234
1235
1236void dWorldDestroy (dxWorld *w)
1237{
1238 // delete all bodies and joints
1239 dAASSERT (w);
1240 dxBody *nextb, *b = w->firstbody;
1241 while (b) {
1242 nextb = (dxBody*) b->next;
1243 delete b;
1244 b = nextb;
1245 }
1246 dxJoint *nextj, *j = w->firstjoint;
1247 while (j) {
1248 nextj = (dxJoint*)j->next;
1249 if (j->flags & dJOINT_INGROUP) {
1250 // the joint is part of a group, so "deactivate" it instead
1251 j->world = 0;
1252 j->node[0].body = 0;
1253 j->node[0].next = 0;
1254 j->node[1].body = 0;
1255 j->node[1].next = 0;
1256 dMessage (0,"warning: destroying world containing grouped joints");
1257 }
1258 else {
1259 dFree (j,j->vtable->size);
1260 }
1261 j = nextj;
1262 }
1263 delete w;
1264}
1265
1266
1267void dWorldSetGravity (dWorldID w, dReal x, dReal y, dReal z)

Callers 1

~dWorldMethod · 0.85

Calls 2

dMessageFunction · 0.85
dFreeFunction · 0.85

Tested by

no test coverage detected