Go to the documentation of this file.
7 #ifndef INCLUDE_JET_BOUNDING_BOX3_H_
8 #define INCLUDE_JET_BOUNDING_BOX3_H_
120 template <
typename T>
137 #include "detail/bounding_box3-inl.h"
139 #endif // INCLUDE_JET_BOUNDING_BOX3_H_
T height() const
Returns height of the box.
T width() const
Returns width of the box.
Vector3< T > upperCorner
Upper corner of the bounding box.
Definition: bounding_box3.h:47
Point2< T > max(const Point2< T > &a, const Point2< T > &b)
Returns element-wise max point: (max(a.x, b.x), max(a.y, b.y)).
T tNear
Distance to the first intersection point.
Definition: bounding_box3.h:28
T depth() const
Returns depth of the box.
T length(size_t axis)
Returns length of the box in given axis.
T diagonalLengthSquared() const
Returns squared diagonal length of this box.
3-D axis-aligned bounding box class.
Definition: bounding_box3.h:41
BoundingBox(const Vector3< T > &point1, const Vector3< T > &point2)
Constructs a box that tightly covers two points.
3-D box-ray intersection result.
Definition: bounding_box3.h:23
bool intersects(const Ray3< T > &ray) const
Returns true if the input ray is intersecting with this box.
void merge(const BoundingBox &other)
Merges this and other box.
Definition: advection_solver2.h:18
BoundingBox3< double > BoundingBox3D
Double-type 3-D BoundingBox.
Definition: bounding_box3.h:127
void reset()
Resets this box to initial state (min=infinite, max=-infinite).
BoundingBox()
Default constructor.
BoundingBoxRayIntersection3< T > closestIntersection(const Ray3< T > &ray) const
Vector3< T > clamp(const Vector3< T > &point) const
Returns the clamped point.
bool overlaps(const BoundingBox &other) const
Returns true of this box and other box overlaps.
Vector3< T > midPoint() const
Returns the mid-point of this box.
bool isIntersecting
True if the box and ray intersects.
Definition: bounding_box3.h:25
BoundingBoxRayIntersection3< double > BoundingBoxRayIntersection3D
Double-type 3-D box-ray intersection result.
Definition: bounding_box3.h:133
BoundingBox(const BoundingBox &other)
Constructs a box with other box instance.
Class for 2-D ray.
Definition: ray3.h:21
Generic N-D axis-aligned bounding box class.
Definition: bounding_box.h:21
Vector3< T > corner(size_t idx) const
Returns corner position. Index starts from x-first order.
BoundingBox3< float > BoundingBox3F
Float-type 3-D BoundingBox.
Definition: bounding_box3.h:124
3-D vector class.
Definition: vector3.h:25
T diagonalLength() const
Returns diagonal length of this box.
Vector3< T > lowerCorner
Lower corner of the bounding box.
Definition: bounding_box3.h:44
T tFar
Distance to the second (and the last) intersection point.
Definition: bounding_box3.h:31
BoundingBoxRayIntersection3< float > BoundingBoxRayIntersection3F
Float-type 3-D box-ray intersection result.
Definition: bounding_box3.h:130
bool isEmpty() const
Returns true if the box is empty.
void merge(const Vector3< T > &point)
Merges this and other point.
bool contains(const Vector3< T > &point) const
Returns true if the input vector is inside of this box.