#160092 - ChronoDK - Thu Jul 10, 2008 2:35 pm
Hi,
I'm slowly porting a demo I made on pc, but I ran into a problem. I was using the Quake 3 InvSqrt function:
But it does not seem to work on DS. I'm guessing the float format is different. Is there some way to make this magic work?
I'm slowly porting a demo I made on pc, but I ran into a problem. I was using the Quake 3 InvSqrt function:
Code: |
float CVector2D::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; } |
But it does not seem to work on DS. I'm guessing the float format is different. Is there some way to make this magic work?