mirror of
https://github.com/HandmadeMath/HandmadeMath.git
synced 2025-09-06 10:18:18 +00:00
HMM_FastInverseSquareRoot indentation adjustment
This commit is contained in:
@@ -355,19 +355,19 @@ HMM_LengthSquareRoot(hmm_vec3 A)
|
|||||||
HINLINE float
|
HINLINE float
|
||||||
HMM_FastInverseSquareRoot(float Number)
|
HMM_FastInverseSquareRoot(float Number)
|
||||||
{
|
{
|
||||||
long i;
|
long i;
|
||||||
float x2, y;
|
float x2, y;
|
||||||
const float threehalfs = 1.5f;
|
const float threehalfs = 1.5f;
|
||||||
|
|
||||||
x2 = Number * 0.5f;
|
x2 = Number * 0.5f;
|
||||||
y = Number;
|
y = Number;
|
||||||
i = * ( long * ) &y; // evil floating point bit level hacking
|
i = * ( long * ) &y; // evil floating point bit level hacking
|
||||||
i = 0x5f3759df - ( i >> 1 ); // what the fuck?
|
i = 0x5f3759df - ( i >> 1 ); // what the fuck?
|
||||||
y = * ( float * ) &i;
|
y = * ( float * ) &i;
|
||||||
|
|
||||||
y = y * ( threehalfs - ( x2 * y * y ) );
|
y = y * ( threehalfs - ( x2 * y * y ) );
|
||||||
|
|
||||||
return ( y );
|
return ( y );
|
||||||
}
|
}
|
||||||
|
|
||||||
HINLINE float
|
HINLINE float
|
||||||
|
Reference in New Issue
Block a user