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

Function GetCylinderExtensions

ogsr_engine/xrGame/Geometry.cpp:33–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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{
35 R_ASSERT2(dGeomGetClass(cyl) == dCylinderClassUser, "is not a cylinder");
36 dReal radius, length;
37 dGeomCylinderGetParams(cyl, &radius, &length);
38 dReal dif = dDOT(pos, axis) - center_prg;
39 dReal _cos = dFabs(dDOT14(axis, rot + 1));
40 dReal cos1 = dDOT14(axis, rot + 0);
41 dReal cos3 = dDOT14(axis, rot + 2);
42 dReal _sin = _sqrt(cos1 * cos1 + cos3 * cos3);
43 length /= 2.f;
44 dReal ful_ext = _cos * length + _sin * radius;
45 *lo_ext = -ful_ext + dif;
46 *hi_ext = ful_ext + dif;
47}
48
49void GetSphereExtensions(dGeomID sphere, const dReal* axis, const dReal* pos, float center_prg, dReal* lo_ext, dReal* hi_ext)
50{

Callers 1

get_extensions_btMethod · 0.85

Calls 4

dGeomGetClassFunction · 0.85
dGeomCylinderGetParamsFunction · 0.85
dDOT14Function · 0.85
_sqrtFunction · 0.85

Tested by

no test coverage detected