Class CornerBoundingBox2d
java.lang.Object
net.buildtheearth.terraminusminus.util.CornerBoundingBox2d
- All Implemented Interfaces:
Bounds2d
A 2D bounding box consisting of 4 corners.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected final doubleprotected final doubleprotected final doubleprotected final doubleprotected final doubleprotected final doubleprotected final doubleprotected final doubleprotected CornerBoundingBox2dprotected final @NonNull GeographicProjection -
Constructor Summary
ConstructorsConstructorDescriptionCornerBoundingBox2d(@lombok.NonNull double[] point00, @lombok.NonNull double[] point01, @lombok.NonNull double[] point10, @lombok.NonNull double[] point11, @NonNull GeographicProjection proj, boolean geo) CornerBoundingBox2d(double x, double z, double sizeX, double sizeZ, @NonNull GeographicProjection proj, boolean geo) -
Method Summary
Modifier and TypeMethodDescriptionfromGeo()fromGeo(@NonNull GeographicProjection proj) doublemaxX()doublemaxZ()doubleminX()doubleminZ()double[]point(double[] dst, double fx, double fz) Gets the coordinates of a point in this bounding box.toGeo()toGeo(@NonNull GeographicProjection proj) toString()validate()Ensures that this bounding box is entirely within valid projection bounds.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.buildtheearth.terraminusminus.util.bvh.Bounds2d
contains, expand, intersects, toCornerBB, toTiles, union, validate
-
Field Details
-
lon00
protected final double lon00 -
lon01
protected final double lon01 -
lon10
protected final double lon10 -
lon11
protected final double lon11 -
lat00
protected final double lat00 -
lat01
protected final double lat01 -
lat10
protected final double lat10 -
lat11
protected final double lat11 -
proj
-
geo
protected final boolean geo -
other
-
-
Constructor Details
-
CornerBoundingBox2d
public CornerBoundingBox2d(double x, double z, double sizeX, double sizeZ, @NonNull @NonNull GeographicProjection proj, boolean geo) throws OutOfProjectionBoundsException - Throws:
OutOfProjectionBoundsException
-
CornerBoundingBox2d
public CornerBoundingBox2d(@NonNull @lombok.NonNull double[] point00, @NonNull @lombok.NonNull double[] point01, @NonNull @lombok.NonNull double[] point10, @NonNull @lombok.NonNull double[] point11, @NonNull @NonNull GeographicProjection proj, boolean geo) throws OutOfProjectionBoundsException - Throws:
OutOfProjectionBoundsException
-
-
Method Details
-
point
public double[] point(double[] dst, double fx, double fz) Gets the coordinates of a point in this bounding box.The relative coordinates are both given in range
[0-1]. Providing relative coordinates outside of this range will produce unexpected results.- Parameters:
dst- thedouble[]to attempt to store the point infx- the relative position of the point along the X axisfz- the relative position of the point along the Z axis- Returns:
- a
double[]which contains the point (possibly the same asdst)
-
axisAlign
- Returns:
- a
Bounds2dwhich contains the entire area enclosed by this bounding box - Throws:
OutOfProjectionBoundsException
-
toGeo
- Returns:
- this bounding box, projected to geographic coordinates
- Throws:
OutOfProjectionBoundsException
-
fromGeo
- Returns:
- this bounding box, projected to local coordinates
- Throws:
OutOfProjectionBoundsException
-
toGeo
public CornerBoundingBox2d toGeo(@NonNull @NonNull GeographicProjection proj) throws OutOfProjectionBoundsException - Returns:
- this bounding box, projected to geographic coordinates using the given
GeographicProjection - Throws:
OutOfProjectionBoundsException
-
fromGeo
public CornerBoundingBox2d fromGeo(@NonNull @NonNull GeographicProjection proj) throws OutOfProjectionBoundsException - Returns:
- this bounding box, projected to local coordinates using the given
GeographicProjection - Throws:
OutOfProjectionBoundsException
-
validate
Ensures that this bounding box is entirely within valid projection bounds.- Throws:
OutOfProjectionBoundsException- if any part of this bounding box is out of valid projection bounds
-
minX
public double minX() -
maxX
public double maxX() -
minZ
public double minZ() -
maxZ
public double maxZ() -
toString
-