/move and /rotate fixes

This commit is contained in:
Light
2014-06-07 20:58:36 +02:00
parent 2b8ba3e101
commit 6245de711d
3 changed files with 16 additions and 5 deletions
+10
View File
@@ -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;
}
}