Cuboids
Overview
Apollo uses cuboids to define regions of 2D and 3D space. These are primarily used to define the region surrounded by a Border.
Cuboid2D
Builder
public class Cuboid2D {
/**
* Returns the cuboid {@link Double} start x.
*
* @return the cuboid start x
* @since 1.0.0
*/
double minX;
/**
* Returns the cuboid {@link Double} start z.
*
* @return the cuboid start z
* @since 1.0.0
*/
double minZ;
/**
* Returns the cuboid {@link Double} end x.
*
* @return the cuboid end x
* @since 1.0.0
*/
double maxX;
/**
* Returns the cuboid {@link Double} end z.
*
* @return the cuboid end z
* @since 1.0.0
*/
double maxZ;
}
Sample Code
public static Cuboid2D createCuboid2DExample() {
return Cuboid2D.builder()
.minX(-50)
.minZ(-50)
.maxX(50)
.maxZ(50)
.build();
}
Cuboid3D
Builder
public class Cuboid3D {
/**
* Returns the cuboid {@link Double} start x.
*
* @return the cuboid start x
* @since 1.0.0
*/
double minX;
/**
* Returns the cuboid {@link Double} start y.
*
* @return the cuboid start y
* @since 1.0.0
*/
double minY;
/**
* Returns the cuboid {@link Double} start z.
*
* @return the cuboid start z
* @since 1.0.0
*/
double minZ;
/**
* Returns the cuboid {@link Double} end x.
*
* @return the cuboid end x
* @since 1.0.0
*/
double maxX;
/**
* Returns the cuboid {@link Double} end y.
*
* @return the cuboid end y
* @since 1.0.0
*/
double maxY;
/**
* Returns the cuboid {@link Double} end z.
*
* @return the cuboid end z
* @since 1.0.0
*/
double maxZ;
}
Sample Code
public static Cuboid3D createCuboid3DExample() {
return Cuboid3D.builder()
.minX(-50)
.minY(0)
.minZ(-50)
.maxX(50)
.maxY(256)
.maxZ(50)
.build();
}