| 31 | } |
| 32 | |
| 33 | void 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 | |
| 49 | void GetSphereExtensions(dGeomID sphere, const dReal* axis, const dReal* pos, float center_prg, dReal* lo_ext, dReal* hi_ext) |
| 50 | { |
no test coverage detected