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

Function xSphereHitsCapsule

src/SB/Core/x/xCollide.cpp:2674–2693  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2672 if (q < 0.0f)
2673 return false;
2674
2675 F32 d = xsqrt(q);
2676 F32 r1 = 1.0f / (2.0f * f31) * (-b + d);
2677 F32 r2 = 1.0f / (2.0f * f31) * (-b - d);
2678
2679 return ((r1 >= 0.0f && r1 <= 1.0f) || (r2 >= 0.0f && r2 <= 1.0f));
2680}
2681
2682F32 xVec2::length2() const
2683{
2684 return x * x + y * y;
2685}
2686
2687xVec2 xVec2::operator-(const xVec2& v) const
2688{
2689 xVec2 vec = *this;
2690 vec -= v;
2691 return vec;
2692}
2693
2694xVec2& xVec2::operator-=(const xVec2& v)
2695{
2696 x -= v.x;

Callers

nothing calls this directly

Calls 3

xsqrtFunction · 0.85
length2Method · 0.45
dotMethod · 0.45

Tested by

no test coverage detected