| 258 | } |
| 259 | |
| 260 | xGridBound** xGridGetCell(xGrid* grid, const xEnt* ent, S32& grx, S32& grz) |
| 261 | { |
| 262 | const xBound* bound = &ent->bound; |
| 263 | const xVec3* center; |
| 264 | if (bound->type == XBOUND_TYPE_SPHERE) |
| 265 | { |
| 266 | center = &bound->sph.center; |
| 267 | } |
| 268 | else if (bound->type == XBOUND_TYPE_OBB) |
| 269 | { |
| 270 | center = &bound->box.center; |
| 271 | } |
| 272 | else if (bound->type == XBOUND_TYPE_BOX) |
| 273 | { |
| 274 | center = &bound->box.center; |
| 275 | } |
| 276 | else |
| 277 | { |
| 278 | return 0; |
| 279 | } |
| 280 | |
| 281 | xGridGetCell(grid, center->x, center->y, center->z, grx, grz); |
| 282 | return &grid->cells[grz * grid->nx] + grx; |
| 283 | } |
| 284 | |
| 285 | void xGridGetCell(xGrid* grid, F32 x, F32 y, F32 z, S32& grx, S32& grz) |
| 286 | { |
no outgoing calls
no test coverage detected