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

Function dJointGroupEmpty

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

Source from the content-addressed store, hash-verified

1054
1055
1056void dJointGroupEmpty (dJointGroupID group)
1057{
1058 // the joints in this group are detached starting from the most recently
1059 // added (at the top of the stack). this helps ensure that the various
1060 // linked lists are not traversed too much, as the joints will hopefully
1061 // be at the start of those lists.
1062 // if any group joints have their world pointer set to 0, their world was
1063 // previously destroyed. no special handling is required for these joints.
1064
1065 dAASSERT (group);
1066 int i;
1067 dxJoint **jlist = (dxJoint**) ALLOCA (group->num * sizeof(dxJoint*));
1068 dxJoint *j = (dxJoint*) group->stack.rewind();
1069 for (i=0; i < group->num; i++) {
1070 jlist[i] = j;
1071 j = (dxJoint*) (group->stack.next (j->vtable->size));
1072 }
1073 for (i=group->num-1; i >= 0; i--) {
1074 if (jlist[i]->world) {
1075 removeJointReferencesFromAttachedBodies (jlist[i]);
1076 //removeObjectFromList (jlist[i]);
1077 ///jlist[i]->world->nj--;
1078 }
1079 }
1080 group->num = 0;
1081 group->stack.freeAll();
1082}
1083
1084
1085void dJointAttach (dxJoint *joint, dxBody *body1, dxBody *body2)

Callers 6

dJointGroupDestroyFunction · 0.85
emptyMethod · 0.85
reinit_singleMethod · 0.85
DestroyMethod · 0.85
StepMethod · 0.85
StepTouchMethod · 0.85

Calls 4

nextMethod · 0.80
freeAllMethod · 0.80
rewindMethod · 0.45

Tested by

no test coverage detected