See: http://en.wikipedia.org/wiki/Fast_inverse_square_root
| 55 | |
| 56 | // See: http://en.wikipedia.org/wiki/Fast_inverse_square_root |
| 57 | float SF::invSqrt(float x) |
| 58 | { |
| 59 | float halfx = 0.5f * x; |
| 60 | union { |
| 61 | float f; |
| 62 | uint32_t i; |
| 63 | } conv = { .f = x }; |
| 64 | conv.i = 0x5f3759df - (conv.i >> 1); |
| 65 | conv.f *= 1.5f - (halfx * conv.f * conv.f); |
| 66 | conv.f *= 1.5f - (halfx * conv.f * conv.f); |
| 67 | return conv.f; |
| 68 | } |
| 69 | |
| 70 | //------------------------------------------------------------------------------------------- |
| 71 | void SF::computeAngles() |
nothing calls this directly
no outgoing calls
no test coverage detected