Update MathHelper.java

This commit is contained in:
PeytonPlayz595 2024-03-23 14:51:01 -04:00
parent 185690d8fa
commit 3f5d1cd6d1
4 changed files with 8484 additions and 7809 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,14 +1,14 @@
package net.minecraft.src;
public class MathHelper {
private static float[] SIN_TABLE = new float[4096];
private static float[] SIN_TABLE = new float[65536];
public static final float sin(float var0) {
return SIN_TABLE[(int)(var0 * 651.8986F) & 4095];
return SIN_TABLE[(int)(var0 * 10430.378F) & '\uffff'];
}
public static final float cos(float var0) {
return SIN_TABLE[(int)((var0 + ((float)Math.PI / 2F)) * 651.8986F) & 4095];
return SIN_TABLE[(int)(var0 * 10430.378F + 16384.0F) & '\uffff'];
}
public static final float sqrt_float(float var0) {
@ -50,12 +50,9 @@ public class MathHelper {
}
static {
for (int j = 0; j < 4096; ++j) {
SIN_TABLE[j] = (float)Math.sin((double)(((float)j + 0.5F) / 4096.0F * ((float)Math.PI * 2F)));
for(int var0 = 0; var0 < 65536; ++var0) {
SIN_TABLE[var0] = (float)Math.sin((double)var0 * Math.PI * 2.0D / 65536.0D);
}
for (int l = 0; l < 360; l += 90) {
SIN_TABLE[(int)((float)l * 11.377778F) & 4095] = (float)Math.sin((double)((float)l * 0.017453292F));
}
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long