MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / GetBoxExtensions

Function GetBoxExtensions

ogsr_engine/xrGame/Geometry.cpp:21–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21void GetBoxExtensions(dGeomID box, const dReal* axis, const dReal* pos, const dReal* rot, float center_prg, dReal* lo_ext, dReal* hi_ext)
22{
23 R_ASSERT2(dGeomGetClass(box) == dBoxClass, "is not a box");
24 dVector3 length;
25 dGeomBoxGetLengths(box, length);
26 dReal dif = dDOT(pos, axis) - center_prg;
27 dReal ful_ext = dFabs(dDOT14(axis, rot + 0)) * length[0] + dFabs(dDOT14(axis, rot + 1)) * length[1] + dFabs(dDOT14(axis, rot + 2)) * length[2];
28 ful_ext /= 2.f;
29 *lo_ext = -ful_ext + dif;
30 *hi_ext = ful_ext + dif;
31}
32
33void GetCylinderExtensions(dGeomID cyl, const dReal* axis, const dReal* pos, const dReal* rot, float center_prg, dReal* lo_ext, dReal* hi_ext)
34{

Callers 1

get_extensions_btMethod · 0.85

Calls 3

dGeomGetClassFunction · 0.85
dGeomBoxGetLengthsFunction · 0.85
dDOT14Function · 0.85

Tested by

no test coverage detected