Class BoxShape

java.lang.Object
com.hypixel.hytale.builtin.triggervolumes.shape.TriggerVolumeShape
com.hypixel.hytale.builtin.triggervolumes.shape.BoxShape

public class BoxShape extends TriggerVolumeShape
Box volume shape. Min/Max define the unrotated box relative to the volume origin; the optional Rotation (pitch, yaw, roll in radians) orients the box around its own center, turning containment into an OBB test.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final BuilderCodec<BoxShape>
     

    Fields inherited from class TriggerVolumeShape

    BASE_CODEC
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    BoxShape(org.joml.Vector3d min, org.joml.Vector3d max)
     
    BoxShape(org.joml.Vector3d min, org.joml.Vector3d max, org.joml.Vector3d rotation)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(org.joml.Vector3d origin, org.joml.Vector3d testPoint)
    Returns whether the world-space testPoint lies inside this origin-relative shape.
     
    double
    Radius used when this shape must be represented generically for display.
    org.joml.Vector3d
     
    double
    Maximum distance from the volume origin to any point in this shape, including offsets.
    org.joml.Vector3d
     
    org.joml.Vector3d
    Pitch (X), yaw (Y), roll (Z) in radians, or null when axis-aligned.
    void
    getWorldAABB(org.joml.Vector3d origin, org.joml.Vector3d outMin, org.joml.Vector3d outMax)
     
    boolean
     
    void
    rotateInPlace(float yawRadians)
    Bakes a yaw rotation into the stored shape data during paste/worldgen conversion so runtime containment checks can stay axis-aligned to the stored shape representation.
    void
    setRotation(org.joml.Vector3d rotation)
     

    Methods inherited from class TriggerVolumeShape

    registerBuiltinShapes

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • BoxShape

      public BoxShape()
    • BoxShape

      public BoxShape(@Nonnull org.joml.Vector3d min, @Nonnull org.joml.Vector3d max)
    • BoxShape

      public BoxShape(@Nonnull org.joml.Vector3d min, @Nonnull org.joml.Vector3d max, @Nullable org.joml.Vector3d rotation)
  • Method Details

    • hasRotation

      public boolean hasRotation()
    • contains

      public boolean contains(@Nonnull org.joml.Vector3d origin, @Nonnull org.joml.Vector3d testPoint)
      Description copied from class: TriggerVolumeShape
      Returns whether the world-space testPoint lies inside this origin-relative shape.
      Specified by:
      contains in class TriggerVolumeShape
    • getBoundingRadius

      public double getBoundingRadius()
      Description copied from class: TriggerVolumeShape
      Radius used when this shape must be represented generically for display. This may be smaller than TriggerVolumeShape.getMaxDistanceFromOrigin() for shapes offset from their origin.
      Specified by:
      getBoundingRadius in class TriggerVolumeShape
    • getMaxDistanceFromOrigin

      public double getMaxDistanceFromOrigin()
      Description copied from class: TriggerVolumeShape
      Maximum distance from the volume origin to any point in this shape, including offsets. The spatial index uses this as the conservative query radius before exact shape tests.
      Specified by:
      getMaxDistanceFromOrigin in class TriggerVolumeShape
    • getWorldAABB

      public void getWorldAABB(@Nonnull org.joml.Vector3d origin, @Nonnull org.joml.Vector3d outMin, @Nonnull org.joml.Vector3d outMax)
      Specified by:
      getWorldAABB in class TriggerVolumeShape
    • rotateInPlace

      public void rotateInPlace(float yawRadians)
      Description copied from class: TriggerVolumeShape
      Bakes a yaw rotation into the stored shape data during paste/worldgen conversion so runtime containment checks can stay axis-aligned to the stored shape representation.
      Specified by:
      rotateInPlace in class TriggerVolumeShape
    • copy

      @Nonnull public BoxShape copy()
      Specified by:
      copy in class TriggerVolumeShape
    • getMin

      @Nonnull public org.joml.Vector3d getMin()
    • getMax

      @Nonnull public org.joml.Vector3d getMax()
    • getRotation

      @Nullable public org.joml.Vector3d getRotation()
      Pitch (X), yaw (Y), roll (Z) in radians, or null when axis-aligned.
    • setRotation

      public void setRotation(@Nullable org.joml.Vector3d rotation)