46 mMax = center + radius;
47 mMin = center - radius;
125 return v ==
clip(t, clipx, clipy, clipz);
143 if (
mMax.
x() < v.
x() + radius)
mMax.
x() = v.
x() + radius;
144 if (
mMax.
y() < v.
y() + radius)
mMax.
y() = v.
y() + radius;
145 if (
mMax.
z() < v.
z() + radius)
mMax.
z() = v.
z() + radius;
146 if (
mMin.
x() > v.
x() - radius)
mMin.
x() = v.
x() - radius;
147 if (
mMin.
y() > v.
y() - radius)
mMin.
y() = v.
y() - radius;
148 if (
mMin.
z() > v.
z() - radius)
mMin.
z() = v.
z() - radius;
AABB()
Constructs a null AABB.
bool isNull() const
Returns true if the AABB is null.
const T_Scalar & z() const
vec3 center() const
Returns the center of the AABB.
void setNull()
Sets ths AABB as null, that is, empty.
void enlarge(real displace)
Enlarges the AABB in all directions by displace amount.
Visualization Library main namespace.
vec3 clip(const vec3 &p, bool clipx=true, bool clipy=true, bool clipz=true) const
Clips the position of the given p point to be inside an AABB.
The AABB class implements an axis-aligned bounding box using vl::real precision.
real width() const
Returns the width of the AABB computed as max.x - min.x.
const vec3 & maxCorner() const
Returns the corner of the AABB with the maximum x y z coordinates.
bool intersects(const AABB &bb) const
Returns true if an AABB intersects with the given AABB.
void addPoint(const vec3 &p, real radius)
Updates the AABB to contain the given point.
const T_Scalar & y() const
real depth() const
Returns the depth of the AABB computed as max.z - min.z.
const vec3 & minCorner() const
Returns the corner of the AABB with the minimum x y z coordinates.
bool isInside(const vec3 &p, bool clipx, bool clipy, bool clipz) const
Returns true if the given point is inside the AABB.
const T_Scalar & x() const
AABB operator+(const AABB &aabb) const
Returns an AABB which contains the two source AABB.
real height() const
Returns the height of the AABB computed as max.y - min.y.