mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-10-12 02:13:48 -04:00
/move and /rotate fixes
This commit is contained in:
@@ -68,4 +68,14 @@ public class MathUtilities {
|
||||
BigDecimal dec = new BigDecimal(seconds);
|
||||
return dec.remainder(new BigDecimal(3600)).divide(new BigDecimal(60), BigDecimal.ROUND_FLOOR).intValue();
|
||||
}
|
||||
|
||||
public float fastInverseSqrt(float x) {
|
||||
float xHalf = 0.5F * x;
|
||||
int temp = Float.floatToRawIntBits(x);
|
||||
temp = 0x5F3759DF - (temp >> 1); // magic
|
||||
float newX = Float.intBitsToFloat(temp);
|
||||
newX = newX * (1.5F - xHalf * newX * newX);
|
||||
return newX;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user