some quick rough info on fixing the incorrect bounding boxes on rotating bmodel objects in the released quake source... this fixes the problem with rotating bmodels letting the player walk through in most positions during the rotation, by calculating the radius correctly in SV_LinkEdict (world.c), the rotated bmodel code is like this originally:float max, v; int i; max = 0; for (i=0 ; i<3 ; i++) { v = fabs(ent->v.mins[i]); if (v > max) max = v; v = fabs(ent->v.maxs[i]); if (v > max) max = v; } for (i=0 ; i<3 ; i++) { ent->v.absmin[i] = ent->v.origin[i] - max; ent->v.absmax[i] = ent->v.origin[i] + max; } float max, v; int i; max = DotProduct(ent->v.mins, ent->v.mins); v = DotProduct(ent->v.maxs, ent->v.maxs); if (max < v) max = v; max = sqrt(max); for (i=0 ; i<3 ; i++) { ent->v.absmin[i] = ent->v.origin[i] - max; ent->v.absmax[i] = ent->v.origin[i] + max; } |