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

Function xsqrt

src/SB/Core/x/xBound.cpp:88–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88F32 xsqrt(F32 x)
89{
90 const F32 half = 0.5f;
91 const F32 three = 3.0f;
92
93 if (x <= 0.0f || isinf(x))
94 {
95 return x;
96 }
97
98 // non-matching: frsp instruction
99
100 F32 guess = __frsqrte(x);
101 guess = half * guess * (three - guess * guess * x);
102
103 if (guess > 0.0000099999997f)
104 {
105 return 1.0f / guess;
106 }
107
108 return 100000.0f;
109}
110
111U32 xBoundSphereHitsOBB(const xSphere* s, const xBox* b, const xMat4x3* m, xCollis* coll)
112{

Callers 15

zThrown_SetupFunction · 0.85
CheckSpotMethod · 0.85
MoveEvadePosMethod · 0.85
ProcessMethod · 0.85
PlayerInSpotMethod · 0.85
MoveToHomeMethod · 0.85
CacheAimPointMethod · 0.85
EnterMethod · 0.85
ResumeMethod · 0.85
PlayerAbsControlFunction · 0.85
BbowlCBFunction · 0.85
DblJumpCBFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected