MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / xGridGetCell

Function xGridGetCell

src/SB/Core/x/xGrid.cpp:260–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258}
259
260xGridBound** 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
285void xGridGetCell(xGrid* grid, F32 x, F32 y, F32 z, S32& grx, S32& grz)
286{

Callers 3

xRayHitsGridFunction · 0.70
xGridUpdateFunction · 0.70
xGridIterFirstCellFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected