L
lrbtav
Saw this on beyond 3d's website earlier today:
I don't know what it is. OK, I know it's the inverse of the square root
of x, but I'm having difficulty relating how this segment of code and
Quake 3 are related.
float InvSqrt (float x){
float xhalf = 0.5f*x;
int i = *(int*)&x;
i = 0x5f3759df - (i>>1);
x = *(float*)&i;
x = x*(1.5f - xhalf*x*x);
return x;
}
I don't know what it is. OK, I know it's the inverse of the square root
of x, but I'm having difficulty relating how this segment of code and
Quake 3 are related.