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

Function get_lower_extent

src/SB/Core/x/xEnt.cpp:377–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

375namespace
376{
377 F32 get_lower_extent(const xBound& bound)
378 {
379 switch (bound.type)
380 {
381 case XBOUND_TYPE_SPHERE:
382 {
383 return bound.sph.r;
384 }
385 case XBOUND_TYPE_BOX:
386 {
387 return bound.box.center.y - bound.box.box.lower.y;
388 }
389 case XBOUND_TYPE_OBB:
390 {
391 if (0.0f == bound.mat->up.x && 0.0f == bound.mat->up.z)
392 {
393 return bound.box.center.y -
394 (bound.mat->up.y * bound.box.box.lower.y + bound.mat->pos.y);
395 }
396 else
397 {
398 xBox box;
399 xBoundGetBox(box, bound);
400
401 return bound.box.center.y - box.lower.y;
402 }
403 }
404 case XBOUND_TYPE_CYL:
405 default:
406 {
407 return 0.0f;
408 }
409 }
410 }
411
412 bool collide_downward(xVec3& loc, xEnt*& hit, xScene& s, xEnt& ent, F32 max_dist)
413 {

Callers 1

collide_downwardFunction · 0.85

Calls 1

xBoundGetBoxFunction · 0.70

Tested by

no test coverage detected