Class TriggerVolumeShape

java.lang.Object
com.hypixel.hytale.builtin.triggervolumes.shape.TriggerVolumeShape
Direct Known Subclasses:
BoxShape, CylinderShape, SphereShape

public abstract class TriggerVolumeShape extends Object
Base shape contract for trigger volumes. Shapes store their geometry relative to the volume's origin, while containment tests receive world-space points and the world-space origin separately.
  • Field Details

  • Constructor Details

    • TriggerVolumeShape

      public TriggerVolumeShape()
  • Method Details

    • contains

      public abstract boolean contains(@Nonnull org.joml.Vector3d origin, @Nonnull org.joml.Vector3d testPoint)
      Returns whether the world-space testPoint lies inside this origin-relative shape.
    • getBoundingRadius

      public abstract double getBoundingRadius()
      Radius used when this shape must be represented generically for display. This may be smaller than getMaxDistanceFromOrigin() for shapes offset from their origin.
    • getMaxDistanceFromOrigin

      public abstract double getMaxDistanceFromOrigin()
      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.
    • getWorldAABB

      public abstract void getWorldAABB(@Nonnull org.joml.Vector3d origin, @Nonnull org.joml.Vector3d outMin, @Nonnull org.joml.Vector3d outMax)
    • rotateInPlace

      public abstract 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.
    • copy

      @Nonnull public abstract TriggerVolumeShape copy()
    • registerBuiltinShapes

      public static void registerBuiltinShapes()
      Registers the built-in shape types. Must not run from a static initializer: when a subclass loads first, this superclass initializes while the subclass CODEC is still null.