From 9df796029f75e8ab7ba4308335c21f8cc1ef3486 Mon Sep 17 00:00:00 2001 From: JozsefA Date: Mon, 18 Jan 2021 00:35:16 -0800 Subject: [PATCH] rename the confounding function --- .../simibubi/create/foundation/render/RenderMath.java | 2 +- .../create/foundation/render/light/GridAlignedBB.java | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/simibubi/create/foundation/render/RenderMath.java b/src/main/java/com/simibubi/create/foundation/render/RenderMath.java index 5ca9e3d66..b9cb6c5be 100644 --- a/src/main/java/com/simibubi/create/foundation/render/RenderMath.java +++ b/src/main/java/com/simibubi/create/foundation/render/RenderMath.java @@ -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); } diff --git a/src/main/java/com/simibubi/create/foundation/render/light/GridAlignedBB.java b/src/main/java/com/simibubi/create/foundation/render/light/GridAlignedBB.java index 368b6883b..bb86dd135 100644 --- a/src/main/java/com/simibubi/create/foundation/render/light/GridAlignedBB.java +++ b/src/main/java/com/simibubi/create/foundation/render/light/GridAlignedBB.java @@ -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); } }