| 1054 | |
| 1055 | |
| 1056 | void 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 | |
| 1085 | void dJointAttach (dxJoint *joint, dxBody *body1, dxBody *body2) |
no test coverage detected