| 
    Jet
    v1.3.3
    
   | 
 
2-D axis-aligned bounding box class. More...
#include <jet/bounding_box2.h>
Public Member Functions | |
| BoundingBox () | |
| Default constructor.  More... | |
| BoundingBox (const Vector2< T > &point1, const Vector2< T > &point2) | |
| Constructs a box that tightly covers two points.  More... | |
| BoundingBox (const BoundingBox &other) | |
| Constructs a box with other box instance.  More... | |
| T | width () const | 
| Returns width of the box.  More... | |
| T | height () const | 
| Returns height of the box.  More... | |
| T | length (size_t axis) | 
| Returns length of the box in given axis.  More... | |
| bool | overlaps (const BoundingBox &other) const | 
| Returns true of this box and other box overlaps.  More... | |
| bool | contains (const Vector2< T > &point) const | 
| Returns true if the input point is inside of this box.  More... | |
| bool | intersects (const Ray2< T > &ray) const | 
| Returns true if the input ray is intersecting with this box.  More... | |
| BoundingBoxRayIntersection2< T > | closestIntersection (const Ray2< T > &ray) const | 
| Vector2< T > | midPoint () const | 
| Returns the mid-point of this box.  More... | |
| T | diagonalLength () const | 
| Returns diagonal length of this box.  More... | |
| T | diagonalLengthSquared () const | 
| Returns squared diagonal length of this box.  More... | |
| void | reset () | 
| Resets this box to initial state (min=infinite, max=-infinite).  More... | |
| void | merge (const Vector2< T > &point) | 
| Merges this and other point.  More... | |
| void | merge (const BoundingBox &other) | 
| Merges this and other box.  More... | |
| void | expand (T delta) | 
| Vector2< T > | corner (size_t idx) const | 
| Returns corner position. Index starts from x-first order.  More... | |
| Vector2< T > | clamp (const Vector2< T > &pt) const | 
| Returns the clamped point.  More... | |
| bool | isEmpty () const | 
| Returns true if the box is empty.  More... | |
Public Attributes | |
| Vector2< T > | lowerCorner | 
| Lower corner of the bounding box.  More... | |
| Vector2< T > | upperCorner | 
| Upper corner of the bounding box.  More... | |
2-D axis-aligned bounding box class.
| T | - Real number type. | 
| N | - Dimension. | 
| jet::BoundingBox< T, 2 >::BoundingBox | ( | ) | 
Default constructor.
| jet::BoundingBox< T, 2 >::BoundingBox | ( | const Vector2< T > & | point1, | 
| const Vector2< T > & | point2 | ||
| ) | 
Constructs a box that tightly covers two points.
| jet::BoundingBox< T, 2 >::BoundingBox | ( | const BoundingBox< T, 2 > & | other | ) | 
Constructs a box with other box instance.
| Vector2<T> jet::BoundingBox< T, 2 >::clamp | ( | const Vector2< T > & | pt | ) | const | 
Returns the clamped point.
| BoundingBoxRayIntersection2<T> jet::BoundingBox< T, 2 >::closestIntersection | ( | const Ray2< T > & | ray | ) | const | 
Returns intersection.isIntersecting = true if the input ray is intersecting with this box. If interesects, intersection.tNear is assigned with distant to the closest intersecting point, and intersection.tFar with furthest.
| bool jet::BoundingBox< T, 2 >::contains | ( | const Vector2< T > & | point | ) | const | 
Returns true if the input point is inside of this box.
| Vector2<T> jet::BoundingBox< T, 2 >::corner | ( | size_t | idx | ) | const | 
Returns corner position. Index starts from x-first order.
| T jet::BoundingBox< T, 2 >::diagonalLength | ( | ) | const | 
Returns diagonal length of this box.
| T jet::BoundingBox< T, 2 >::diagonalLengthSquared | ( | ) | const | 
Returns squared diagonal length of this box.
| void jet::BoundingBox< T, 2 >::expand | ( | T | delta | ) | 
Expands this box by given delta to all direction. If the width of the box was x, expand(y) will result a box with x+y+y width.
| T jet::BoundingBox< T, 2 >::height | ( | ) | const | 
Returns height of the box.
| bool jet::BoundingBox< T, 2 >::intersects | ( | const Ray2< T > & | ray | ) | const | 
Returns true if the input ray is intersecting with this box.
| bool jet::BoundingBox< T, 2 >::isEmpty | ( | ) | const | 
Returns true if the box is empty.
| T jet::BoundingBox< T, 2 >::length | ( | size_t | axis | ) | 
Returns length of the box in given axis.
| void jet::BoundingBox< T, 2 >::merge | ( | const BoundingBox< T, 2 > & | other | ) | 
Merges this and other box.
| void jet::BoundingBox< T, 2 >::merge | ( | const Vector2< T > & | point | ) | 
Merges this and other point.
| Vector2<T> jet::BoundingBox< T, 2 >::midPoint | ( | ) | const | 
Returns the mid-point of this box.
| bool jet::BoundingBox< T, 2 >::overlaps | ( | const BoundingBox< T, 2 > & | other | ) | const | 
Returns true of this box and other box overlaps.
| void jet::BoundingBox< T, 2 >::reset | ( | ) | 
Resets this box to initial state (min=infinite, max=-infinite).
| T jet::BoundingBox< T, 2 >::width | ( | ) | const | 
Returns width of the box.
| Vector2<T> jet::BoundingBox< T, 2 >::lowerCorner | 
Lower corner of the bounding box.
| Vector2<T> jet::BoundingBox< T, 2 >::upperCorner | 
Upper corner of the bounding box.
 1.8.18