Class BoxBlockIterator

java.lang.Object
com.hypixel.hytale.math.iterator.BoxBlockIterator

public final class BoxBlockIterator extends Object
This class allows to iterate an axis-aligned bounding box over a grid of 1x1 cubes. The algorithm reports all hit blocks in chronological order and reports every iteration step to the BoxIterationConsumer.

This class makes use of the BlockIterator as it's base algorithm.

Since:
07.10.2016
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
    static interface 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Provides a BoxIterationBuffer to use with box iteration
    static boolean
    iterate(double minX, double minY, double minZ, double maxX, double maxY, double maxZ, double px, double py, double pz, double dx, double dy, double dz, double maxDistance, BoxBlockIterator.BoxIterationConsumer consumer)
    Starts the iteration process at with a given axis-aligned bounding box along a given direction until it hits a given maxDistance and reports all hit blocks to the given consumer.
    static boolean
    iterate(double minX, double minY, double minZ, double maxX, double maxY, double maxZ, double px, double py, double pz, double dx, double dy, double dz, double maxDistance, BoxBlockIterator.BoxIterationConsumer consumer, BoxBlockIterator.BoxIterationBuffer buffer)
    Starts the iteration process at with a given axis-aligned bounding box along a given direction until it hits a given maxDistance and reports all hit blocks to the given consumer.
    static boolean
    iterate(Box box, double px, double py, double pz, double dx, double dy, double dz, double maxDistance, BoxBlockIterator.BoxIterationConsumer consumer)
    Starts the iteration process at with a given axis-aligned bounding box along a given direction until it hits a given maxDistance and reports all hit blocks to the given consumer.
    static boolean
    iterate(Box box, double px, double py, double pz, double dx, double dy, double dz, double maxDistance, BoxBlockIterator.BoxIterationConsumer consumer, BoxBlockIterator.BoxIterationBuffer buffer)
    Starts the iteration process at with a given axis-aligned bounding box along a given direction until it hits a given maxDistance and reports all hit blocks to the given consumer.
    static boolean
    iterate(Box box, org.joml.Vector3d position, org.joml.Vector3d d, double maxDistance, BoxBlockIterator.BoxIterationConsumer consumer)
    Starts the iteration process at with a given axis-aligned bounding box along a given direction until it hits a given maxDistance and reports all hit blocks to the given consumer.
    static boolean
    iterate(Box box, org.joml.Vector3d pos, org.joml.Vector3d d, double maxDistance, BoxBlockIterator.BoxIterationConsumer consumer, BoxBlockIterator.BoxIterationBuffer buffer)
    Starts the iteration process at with a given axis-aligned bounding box along a given direction until it hits a given maxDistance and reports all hit blocks to the given consumer.
    static boolean
    iterate(org.joml.Vector3d min, org.joml.Vector3d max, double px, double py, double pz, double dx, double dy, double dz, double maxDistance, BoxBlockIterator.BoxIterationConsumer consumer)
    Starts the iteration process at with a given axis-aligned bounding box along a given direction until it hits a given maxDistance and reports all hit blocks to the given consumer.
    static boolean
    iterate(org.joml.Vector3d min, org.joml.Vector3d max, double px, double py, double pz, double dx, double dy, double dz, double maxDistance, BoxBlockIterator.BoxIterationConsumer consumer, BoxBlockIterator.BoxIterationBuffer buffer)
    Starts the iteration process at with a given axis-aligned bounding box along a given direction until it hits a given maxDistance and reports all hit blocks to the given consumer.
    static boolean
    iterate(org.joml.Vector3d min, org.joml.Vector3d max, org.joml.Vector3d pos, org.joml.Vector3d d, double maxDistance, BoxBlockIterator.BoxIterationConsumer consumer)
    Starts the iteration process at with a given axis-aligned bounding box along a given direction until it hits a given maxDistance and reports all hit blocks to the given consumer.
    static boolean
    iterate(org.joml.Vector3d min, org.joml.Vector3d max, org.joml.Vector3d pos, org.joml.Vector3d d, double maxDistance, BoxBlockIterator.BoxIterationConsumer consumer, BoxBlockIterator.BoxIterationBuffer buffer)
    Starts the iteration process at with a given axis-aligned bounding box along a given direction until it hits a given maxDistance and reports all hit blocks to the given consumer.

    Methods inherited from class Object

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

    • getBuffer

      public static BoxBlockIterator.BoxIterationBuffer getBuffer()
      Provides a BoxIterationBuffer to use with box iteration
      Returns:
      BoxIterationBuffer
    • iterate

      public static boolean iterate(@Nonnull Box box, @Nonnull org.joml.Vector3d position, @Nonnull org.joml.Vector3d d, double maxDistance, @Nonnull BoxBlockIterator.BoxIterationConsumer consumer)
      Starts the iteration process at with a given axis-aligned bounding box along a given direction until it hits a given maxDistance and reports all hit blocks to the given consumer.
      Parameters:
      box - Axis-aligned bounding box
      d - Direction of iteration
      maxDistance - Maximum distance to hit blocks at, aborts after given distance
      consumer - BoxIterationConsumer to report blocks to
      Returns:
      TRUE if the iteration finished, FALSE if the iteration was aborted by the consumer
    • iterate

      public static boolean iterate(@Nonnull Box box, @Nonnull org.joml.Vector3d pos, @Nonnull org.joml.Vector3d d, double maxDistance, @Nonnull BoxBlockIterator.BoxIterationConsumer consumer, @Nonnull BoxBlockIterator.BoxIterationBuffer buffer)
      Starts the iteration process at with a given axis-aligned bounding box along a given direction until it hits a given maxDistance and reports all hit blocks to the given consumer.
      Parameters:
      box - Axis-aligned bounding box
      d - Direction of iteration
      maxDistance - Maximum distance to hit blocks at, aborts after given distance
      consumer - BoxIterationConsumer to report blocks to
      buffer - BoxIterationBuffer to store temporary data
      Returns:
      TRUE if the iteration finished, FALSE if the iteration was aborted by the consumer
    • iterate

      public static boolean iterate(@Nonnull Box box, double px, double py, double pz, double dx, double dy, double dz, double maxDistance, @Nonnull BoxBlockIterator.BoxIterationConsumer consumer)
      Starts the iteration process at with a given axis-aligned bounding box along a given direction until it hits a given maxDistance and reports all hit blocks to the given consumer.
      Parameters:
      box - Axis-aligned bounding box
      px - X-value of position
      py - Y-value of position
      pz - Z-value of position
      dx - X-value of direction
      dy - Y-value of direction
      dz - Z-value of direction
      maxDistance - Maximum distance to hit blocks at, aborts after given distance
      consumer - BoxIterationConsumer to report blocks to
      Returns:
      TRUE if the iteration finished, FALSE if the iteration was aborted by the consumer
    • iterate

      public static boolean iterate(@Nonnull Box box, double px, double py, double pz, double dx, double dy, double dz, double maxDistance, @Nonnull BoxBlockIterator.BoxIterationConsumer consumer, @Nonnull BoxBlockIterator.BoxIterationBuffer buffer)
      Starts the iteration process at with a given axis-aligned bounding box along a given direction until it hits a given maxDistance and reports all hit blocks to the given consumer.
      Parameters:
      box - Axis-aligned bounding box
      px - X-value of position
      py - Y-value of position
      pz - Z-value of position
      dx - X-value of direction
      dy - Y-value of direction
      dz - Z-value of direction
      maxDistance - Maximum distance to hit blocks at, aborts after given distance
      consumer - BoxIterationConsumer to report blocks to
      buffer - BoxIterationBuffer to store temporary data
      Returns:
      TRUE if the iteration finished, FALSE if the iteration was aborted by the consumer
    • iterate

      public static boolean iterate(@Nonnull org.joml.Vector3d min, @Nonnull org.joml.Vector3d max, double px, double py, double pz, double dx, double dy, double dz, double maxDistance, @Nonnull BoxBlockIterator.BoxIterationConsumer consumer)
      Starts the iteration process at with a given axis-aligned bounding box along a given direction until it hits a given maxDistance and reports all hit blocks to the given consumer.
      Parameters:
      min - Vector of minimum coordinates of bounding box
      max - Vector of maximum coordinates of bounding box
      px - X-value of position
      py - Y-value of position
      pz - Z-value of position
      dx - X-value of direction
      dy - Y-value of direction
      dz - Z-value of direction
      maxDistance - Maximum distance to hit blocks at, aborts after given distance
      consumer - BoxIterationConsumer to report blocks to
      Returns:
      TRUE if the iteration finished, FALSE if the iteration was aborted by the consumer
    • iterate

      public static boolean iterate(@Nonnull org.joml.Vector3d min, @Nonnull org.joml.Vector3d max, double px, double py, double pz, double dx, double dy, double dz, double maxDistance, @Nonnull BoxBlockIterator.BoxIterationConsumer consumer, @Nonnull BoxBlockIterator.BoxIterationBuffer buffer)
      Starts the iteration process at with a given axis-aligned bounding box along a given direction until it hits a given maxDistance and reports all hit blocks to the given consumer.
      Parameters:
      min - Vector of minimum coordinates of bounding box
      max - Vector of maximum coordinates of bounding box
      px - X-value of position
      py - Y-value of position
      pz - Z-value of position
      dx - X-value of direction
      dy - Y-value of direction
      dz - Z-value of direction
      maxDistance - Maximum distance to hit blocks at, aborts after given distance
      consumer - BoxIterationConsumer to report blocks to
      buffer - BoxIterationBuffer to store temporary data
      Returns:
      TRUE if the iteration finished, FALSE if the iteration was aborted by the consumer
    • iterate

      public static boolean iterate(@Nonnull org.joml.Vector3d min, @Nonnull org.joml.Vector3d max, @Nonnull org.joml.Vector3d pos, @Nonnull org.joml.Vector3d d, double maxDistance, @Nonnull BoxBlockIterator.BoxIterationConsumer consumer)
      Starts the iteration process at with a given axis-aligned bounding box along a given direction until it hits a given maxDistance and reports all hit blocks to the given consumer.
      Parameters:
      min - Vector of minimum coordinates of bounding box
      max - Vector of maximum coordinates of bounding box
      pos - Origin of the described box
      d - Direction of iteration
      maxDistance - Maximum distance to hit blocks at, aborts after given distance
      consumer - BoxIterationConsumer to report blocks to
      Returns:
      TRUE if the iteration finished, FALSE if the iteration was aborted by the consumer
    • iterate

      public static boolean iterate(@Nonnull org.joml.Vector3d min, @Nonnull org.joml.Vector3d max, @Nonnull org.joml.Vector3d pos, @Nonnull org.joml.Vector3d d, double maxDistance, @Nonnull BoxBlockIterator.BoxIterationConsumer consumer, @Nonnull BoxBlockIterator.BoxIterationBuffer buffer)
      Starts the iteration process at with a given axis-aligned bounding box along a given direction until it hits a given maxDistance and reports all hit blocks to the given consumer.
      Parameters:
      min - Vector of minimum coordinates of bounding box
      max - Vector of maximum coordinates of bounding box
      d - Direction of iteration
      maxDistance - Maximum distance to hit blocks at, aborts after given distance
      consumer - BoxIterationConsumer to report blocks to
      buffer - BoxIterationBuffer to store temporary data
      Returns:
      TRUE if the iteration finished, FALSE if the iteration was aborted by the consumer
    • iterate

      public static boolean iterate(double minX, double minY, double minZ, double maxX, double maxY, double maxZ, double px, double py, double pz, double dx, double dy, double dz, double maxDistance, @Nonnull BoxBlockIterator.BoxIterationConsumer consumer)
      Starts the iteration process at with a given axis-aligned bounding box along a given direction until it hits a given maxDistance and reports all hit blocks to the given consumer.
      Parameters:
      minX - Minimum X-Coordinate of box
      minY - Minimum Y-Coordinate of box
      minZ - Minimum Z-Coordinate of box
      maxX - Maximum X-Coordinate of box
      maxY - Maximum Y-Coordinate of box
      maxZ - Maximum Z-Coordinate of box
      px - X-value of position
      py - Y-value of position
      pz - Z-value of position
      dx - X-value of direction
      dy - Y-value of direction
      dz - Z-value of direction
      maxDistance - Maximum distance to hit blocks at, aborts after given distance
      consumer - BoxIterationConsumer to report blocks to
      Returns:
      TRUE if the iteration finished, FALSE if the iteration was aborted by the consumer
    • iterate

      public static boolean iterate(double minX, double minY, double minZ, double maxX, double maxY, double maxZ, double px, double py, double pz, double dx, double dy, double dz, double maxDistance, @Nonnull BoxBlockIterator.BoxIterationConsumer consumer, @Nonnull BoxBlockIterator.BoxIterationBuffer buffer)
      Starts the iteration process at with a given axis-aligned bounding box along a given direction until it hits a given maxDistance and reports all hit blocks to the given consumer.
      Parameters:
      minX - Minimum X-Coordinate of box
      minY - Minimum Y-Coordinate of box
      minZ - Minimum Z-Coordinate of box
      maxX - Maximum X-Coordinate of box
      maxY - Maximum Y-Coordinate of box
      maxZ - Maximum Z-Coordinate of box
      px - X-value of position
      py - Y-value of position
      pz - Z-value of position
      dx - X-value of direction
      dy - Y-value of direction
      dz - Z-value of direction
      maxDistance - Maximum distance to hit blocks at, aborts after given distance
      consumer - BoxIterationConsumer to report blocks to
      buffer - BoxIterationBuffer contains data to avoid allocation of lambda
      Returns:
      TRUE if the iteration finished, FALSE if the iteration was aborted by the consumer