public class BoundingBox2d extends Object
Constructor and Description |
---|
BoundingBox2d()
Initialize a BoundingBox by calling its reset method.
|
BoundingBox2d(float xmin,
float xmax,
float ymin,
float ymax)
Initialize a BoundingBox with raw values.
|
BoundingBox2d(List<Coord2d> list) |
Modifier and Type | Method and Description |
---|---|
void |
add(BoundingBox2d b)
Add a BoundingBox2d volume to the current one.
|
void |
add(Coord2d p)
Add a Point3d to the BoundingBox3d.
|
void |
add(float x,
float y)
Adds an x,y point to the bounding box, and enlarge the bounding
box if this points lies outside of it.
|
boolean |
contains(BoundingBox2d b2)
Return true if b2 is contained by this box.
|
boolean |
contains(Coord2d c)
Return true if coordinates is contained by this box.
|
Coord2d |
getCenter()
Compute and return the center point of the BoundingBox3d
|
double |
getRadius()
Return the radius of the Sphere containing the Bounding Box,
i.e., the distance between the center and the point (xmin, ymin, zmin).
|
boolean |
intersect(BoundingBox2d b2)
Return true if intersect b2.
|
void |
reset()
Initialize the bounding box with Float.MAX_VALUE as minimum
value, and -Float.MAX_VALUE as maximum value for each dimension.
|
BoundingBox2d |
scale(Coord3d scale)
Return a copy of the current bounding box after scaling.
|
String |
toString() |
String |
toString(int depth) |
float |
xmax()
Return the maximum x value.
|
float |
xmin()
Return the minimum x value.
|
float |
ymax()
Return the maximum y value.
|
float |
ymin()
Return the minimum y value.
|
public BoundingBox2d()
public BoundingBox2d(float xmin, float xmax, float ymin, float ymax)
public void reset()
public void add(float x, float y)
x
- y
- public void add(Coord2d p)
add(p.x, p.y);
p
- public void add(BoundingBox2d b)
add(b.xmin, b.ymin);
add(b.xmax, b.ymax);
p
- public Coord2d getCenter()
public double getRadius()
public BoundingBox2d scale(Coord3d scale)
public boolean contains(BoundingBox2d b2)
public boolean contains(Coord2d c)
public boolean intersect(BoundingBox2d b2)
public float xmin()
public float xmax()
public float ymin()
public float ymax()
public String toString(int depth)
Copyright © 2016. All rights reserved.