rename the confounding function

This commit is contained in:
JozsefA 2021-01-18 00:35:16 -08:00
parent 398a848791
commit 9df796029f
2 changed files with 5 additions and 8 deletions

View File

@ -3,7 +3,7 @@ package com.simibubi.create.foundation.render;
public class RenderMath {
public static final float SQRT2 = 1.41421356237f;
public static int timesSqrt2(int i) {
public static int rotateSideLength(int i) {
return (int) Math.floor((float) i * SQRT2 / 4f);
}

View File

@ -3,14 +3,11 @@ package com.simibubi.create.foundation.render.light;
import com.simibubi.create.foundation.render.RenderMath;
import net.minecraft.util.Direction;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.SectionPos;
import net.minecraft.util.math.Vec3i;
import net.minecraft.world.LightType;
import java.util.function.IntFunction;
import static com.simibubi.create.foundation.render.RenderMath.isPowerOf2;
import static com.simibubi.create.foundation.render.RenderMath.rotateSideLength;
public class GridAlignedBB {
public int minX;
@ -94,11 +91,11 @@ public class GridAlignedBB {
public void rotate45(Direction.Axis axis) {
if (axis == Direction.Axis.X) {
this.grow(0, RenderMath.timesSqrt2(sizeY()), RenderMath.timesSqrt2(sizeZ()));
this.grow(0, rotateSideLength(sizeY()), rotateSideLength(sizeZ()));
} else if (axis == Direction.Axis.Y) {
this.grow(RenderMath.timesSqrt2(sizeX()), 0, RenderMath.timesSqrt2(sizeZ()));
this.grow(rotateSideLength(sizeX()), 0, rotateSideLength(sizeZ()));
} else if (axis == Direction.Axis.Z) {
this.grow(RenderMath.timesSqrt2(sizeX()), RenderMath.timesSqrt2(sizeY()), 0);
this.grow(rotateSideLength(sizeX()), rotateSideLength(sizeY()), 0);
}
}