diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/RenderExtensions.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/RenderExtensions.kt index 1d08afc62..432d88021 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/RenderExtensions.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/RenderExtensions.kt @@ -5,6 +5,7 @@ import com.mojang.blaze3d.vertex.Tesselator import com.mojang.blaze3d.vertex.VertexConsumer import net.minecraft.core.Vec3i import org.joml.Matrix4f +import org.joml.Quaternionf import org.joml.Vector3f import ru.dbotthepony.mc.otm.core.math.IAngle import ru.dbotthepony.mc.otm.core.math.RGBAColor @@ -52,6 +53,12 @@ fun PoseStack.rotateAroundPoint(point: Vector3f, rotation: IAngle) { // last.normal().mul(rotation.forward().rotateAroundThis(rotation)) } +fun PoseStack.rotateAround(rotationMatrix: Quaternionf, x: Float, y: Float, z: Float) { + val pose = last + pose.pose.rotateAround(rotationMatrix, x, y, z) + pose.normal().rotate(rotationMatrix) +} + fun PoseStack.translation(): Vector3f { return last().pose().translation } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/blockentity/FluidTankRenderer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/blockentity/FluidTankRenderer.kt index 3159ae3ca..c36fb08dd 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/blockentity/FluidTankRenderer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/blockentity/FluidTankRenderer.kt @@ -18,6 +18,7 @@ import net.minecraftforge.fluids.FluidStack import net.minecraftforge.fluids.capability.IFluidHandler import ru.dbotthepony.mc.otm.block.entity.decorative.FluidTankBlockEntity import ru.dbotthepony.mc.otm.client.minecraft +import ru.dbotthepony.mc.otm.client.render.rotateAround import ru.dbotthepony.mc.otm.core.ifPresentK import ru.dbotthepony.mc.otm.core.math.RGBAColor import ru.dbotthepony.mc.otm.core.math.linearInterpolation