Contents
Class BlockRotationUtil
java.lang.Object
com.hypixel.hytale.server.core.universe.world.chunk.BlockRotationUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RotationTuplegetFlipped(RotationTuple blockRotation, BlockFlipType flipType, Axis axis) Computes the flipped rotation for a block reflected across the given axis.static intgetFlippedFiller(int filler, Axis axis, BlockBoundingBoxes.RotatedVariantBoxes from, BlockBoundingBoxes.RotatedVariantBoxes to) Computes the filler offset of a cell after the multi-cell block it belongs to is mirrored acrossaxis.static RotationTuplegetRotated(RotationTuple blockRotation, Axis axis, Rotation rotation, VariantRotation variantRotation) static intgetRotatedFiller(int filler, Axis axis, Rotation rotation) static intgetRotatedFiller(int filler, RotationTuple rotation)
-
Constructor Details
-
BlockRotationUtil
public BlockRotationUtil()
-
-
Method Details
-
getFlipped
@Nullable public static RotationTuple getFlipped(@Nonnull RotationTuple blockRotation, @Nullable BlockFlipType flipType, @Nonnull Axis axis) Computes the flipped rotation for a block reflected across the given axis. For blocks with aBlockFlipType, uses a matrix-based approach: Build the rotation matrix M (Ry*Rx*Rz, matching the rendering convention) Reflect across the flip axis: negate the corresponding row of M Apply a local chirality correction (right-multiply by C) to convert the improper rotation back to a proper rotation Decompose back to Euler angles For blocks without a flip type, uses a direct Euler-angle flip. -
getRotated
@Nullable public static RotationTuple getRotated(@Nonnull RotationTuple blockRotation, @Nonnull Axis axis, Rotation rotation, @Nonnull VariantRotation variantRotation) -
getFlippedFiller
public static int getFlippedFiller(int filler, @Nonnull Axis axis, @Nonnull BlockBoundingBoxes.RotatedVariantBoxes from, @Nonnull BlockBoundingBoxes.RotatedVariantBoxes to) Computes the filler offset of a cell after the multi-cell block it belongs to is mirrored acrossaxis.A multi-cell block stores every cell as an offset from its base cell, and the offsets a rotation allows come from the hitbox of that rotation. A mirror moves the base cell to the opposite end of the footprint, so the offsets are mirrored and then re-anchored: the mirrored footprint is aligned with the footprint of the flipped rotation, and each cell keeps its offset from that shared corner.
- Parameters:
from- the footprint of the rotation the block hadto- the footprint of the rotation the block has after the flip
-
getRotatedFiller
-
getRotatedFiller
-