Contents
- Description
- Nested Class Summary
- Method Summary
- Method Details
- getBuffer()
- iterate(Box, Vector3d, Vector3d, double, BoxBlockIterator.BoxIterationConsumer)
- iterate(Box, Vector3d, Vector3d, double, BoxBlockIterator.BoxIterationConsumer, BoxBlockIterator.BoxIterationBuffer)
- iterate(Box, double, double, double, double, double, double, double, BoxBlockIterator.BoxIterationConsumer)
- iterate(Box, double, double, double, double, double, double, double, BoxBlockIterator.BoxIterationConsumer, BoxBlockIterator.BoxIterationBuffer)
- iterate(Vector3d, Vector3d, double, double, double, double, double, double, double, BoxBlockIterator.BoxIterationConsumer)
- iterate(Vector3d, Vector3d, double, double, double, double, double, double, double, BoxBlockIterator.BoxIterationConsumer, BoxBlockIterator.BoxIterationBuffer)
- iterate(Vector3d, Vector3d, Vector3d, Vector3d, double, BoxBlockIterator.BoxIterationConsumer)
- iterate(Vector3d, Vector3d, Vector3d, Vector3d, double, BoxBlockIterator.BoxIterationConsumer, BoxBlockIterator.BoxIterationBuffer)
- iterate(double, double, double, double, double, double, double, double, double, double, double, double, double, BoxBlockIterator.BoxIterationConsumer)
- iterate(double, double, double, double, double, double, double, double, double, double, double, double, double, BoxBlockIterator.BoxIterationConsumer, BoxBlockIterator.BoxIterationBuffer)
Class BoxBlockIterator
java.lang.Object
com.hypixel.hytale.math.iterator.BoxBlockIterator
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 ClassesModifier and TypeClassDescriptionstatic classstatic interface -
Method Summary
Modifier and TypeMethodDescriptionProvides a BoxIterationBuffer to use with box iterationstatic booleaniterate(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 booleaniterate(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 booleaniterate(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 booleaniterate(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 booleaniterate(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 booleaniterate(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 booleaniterate(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 booleaniterate(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 booleaniterate(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 booleaniterate(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.
-
Method Details
-
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 boxd- Direction of iterationmaxDistance- Maximum distance to hit blocks at, aborts after given distanceconsumer- 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 boxd- Direction of iterationmaxDistance- Maximum distance to hit blocks at, aborts after given distanceconsumer- BoxIterationConsumer to report blocks tobuffer- 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 boxpx- X-value of positionpy- Y-value of positionpz- Z-value of positiondx- X-value of directiondy- Y-value of directiondz- Z-value of directionmaxDistance- Maximum distance to hit blocks at, aborts after given distanceconsumer- 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 boxpx- X-value of positionpy- Y-value of positionpz- Z-value of positiondx- X-value of directiondy- Y-value of directiondz- Z-value of directionmaxDistance- Maximum distance to hit blocks at, aborts after given distanceconsumer- BoxIterationConsumer to report blocks tobuffer- 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 boxmax- Vector of maximum coordinates of bounding boxpx- X-value of positionpy- Y-value of positionpz- Z-value of positiondx- X-value of directiondy- Y-value of directiondz- Z-value of directionmaxDistance- Maximum distance to hit blocks at, aborts after given distanceconsumer- 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 boxmax- Vector of maximum coordinates of bounding boxpx- X-value of positionpy- Y-value of positionpz- Z-value of positiondx- X-value of directiondy- Y-value of directiondz- Z-value of directionmaxDistance- Maximum distance to hit blocks at, aborts after given distanceconsumer- BoxIterationConsumer to report blocks tobuffer- 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 boxmax- Vector of maximum coordinates of bounding boxpos- Origin of the described boxd- Direction of iterationmaxDistance- Maximum distance to hit blocks at, aborts after given distanceconsumer- 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 boxmax- Vector of maximum coordinates of bounding boxd- Direction of iterationmaxDistance- Maximum distance to hit blocks at, aborts after given distanceconsumer- BoxIterationConsumer to report blocks tobuffer- 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 boxminY- Minimum Y-Coordinate of boxminZ- Minimum Z-Coordinate of boxmaxX- Maximum X-Coordinate of boxmaxY- Maximum Y-Coordinate of boxmaxZ- Maximum Z-Coordinate of boxpx- X-value of positionpy- Y-value of positionpz- Z-value of positiondx- X-value of directiondy- Y-value of directiondz- Z-value of directionmaxDistance- Maximum distance to hit blocks at, aborts after given distanceconsumer- 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 boxminY- Minimum Y-Coordinate of boxminZ- Minimum Z-Coordinate of boxmaxX- Maximum X-Coordinate of boxmaxY- Maximum Y-Coordinate of boxmaxZ- Maximum Z-Coordinate of boxpx- X-value of positionpy- Y-value of positionpz- Z-value of positiondx- X-value of directiondy- Y-value of directiondz- Z-value of directionmaxDistance- Maximum distance to hit blocks at, aborts after given distanceconsumer- BoxIterationConsumer to report blocks tobuffer- BoxIterationBuffer contains data to avoid allocation of lambda- Returns:
- TRUE if the iteration finished, FALSE if the iteration was aborted by the consumer
-