From 5514fd2645f67cd9097dc1fb196d085ebc1f019a Mon Sep 17 00:00:00 2001 From: Sjoerd van de Goor Date: Wed, 8 Feb 2023 01:51:39 +0100 Subject: [PATCH] Proper ordering --- .../com/volmit/iris/engine/object/IrisObject.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/volmit/iris/engine/object/IrisObject.java b/src/main/java/com/volmit/iris/engine/object/IrisObject.java index c483449f9..49107c58e 100644 --- a/src/main/java/com/volmit/iris/engine/object/IrisObject.java +++ b/src/main/java/com/volmit/iris/engine/object/IrisObject.java @@ -500,7 +500,13 @@ public class IrisObject extends IrisRegistrant { // Rotation calculation double slopeRotationY = 0; ProceduralStream heightStream = rdata.getEngine().getComplex().getHeightStream(); - if (config.isRotateTowardsSlope()) { + if (config.isRotateTowardsSlopePrecise()) { + // I take three points which together make a plane that decently represents the slope beneath the object + double hNorth = heightStream.get(x, z + ((float)h) / 2); + double hEast = heightStream.get(x + ((float)w) / 2, z); + double hSouthWest = heightStream.get(x - ((float)w) / 2, z - ((float)h) / 2); + // TODO: Complex math + } else if (config.isRotateTowardsSlope()) { // TODO: Make this respect object rotation (I have no idea how. So just make sure your objects are sort of square and you'll be fine) // Whichever side of the rectangle that bounds the object is lowest is the 'direction' of the slope (simply said). double hNorth = heightStream.get(x, z + ((float)h) / 2); @@ -517,12 +523,6 @@ public class IrisObject extends IrisRegistrant { } else if (min == hWest) { slopeRotationY = 270; } - } else if (config.isRotateTowardsSlopePrecise()) { - // I take three points which together make a plane that decently represents the slope beneath the object - double hNorth = heightStream.get(x, z + ((float)h) / 2); - double hEast = heightStream.get(x + ((float)w) / 2, z); - double hSouthWest = heightStream.get(x - ((float)w) / 2, z - ((float)h) / 2); - // TODO: Complex math } if (config.isSmartBore()) {