#include <BoundingBoxOriented.h>
|
| CBoundingBoxOriented () |
| Empty constructor; creates an empty box. More...
|
|
| CBoundingBoxOriented (const CVector3D ¢er, const CVector3D &u, const CVector3D &v, const CVector3D &w, const CVector3D &halfSizes) |
| Constructs a new oriented box centered at center and with normalized side vectors u , v and w . More...
|
|
| CBoundingBoxOriented (const CBoundingBoxAligned &bound) |
| Constructs a new box from an axis-aligned bounding box (AABB). More...
|
|
bool | RayIntersect (const CVector3D &origin, const CVector3D &dir, float &tMin, float &tMax) const |
| Check if a given ray intersects this box. More...
|
|
void | GetCorner (int u, int v, int w, CVector3D &out) const |
| Returns the corner at coordinate (u , v , w ). More...
|
|
void | SetEmpty () |
|
bool | IsEmpty () const |
|
◆ CBoundingBoxOriented() [1/3]
CBoundingBoxOriented::CBoundingBoxOriented |
( |
| ) |
|
|
inline |
Empty constructor; creates an empty box.
◆ CBoundingBoxOriented() [2/3]
Constructs a new oriented box centered at center
and with normalized side vectors u
, v
and w
.
These vectors should be mutually orthonormal for a proper rectangular box. The half-widths of the box in each dimension are given by the corresponding components of halfSizes
.
◆ CBoundingBoxOriented() [3/3]
Constructs a new box from an axis-aligned bounding box (AABB).
◆ GetCorner()
void CBoundingBoxOriented::GetCorner |
( |
int |
u, |
|
|
int |
v, |
|
|
int |
w, |
|
|
CVector3D & |
out |
|
) |
| const |
|
inline |
Returns the corner at coordinate (u
, v
, w
).
Each of u
, v
and w
must be exactly 1 or -1. Must not be used if IsEmpty() is true.
◆ IsEmpty()
bool CBoundingBoxOriented::IsEmpty |
( |
| ) |
const |
|
inline |
◆ RayIntersect()
bool CBoundingBoxOriented::RayIntersect |
( |
const CVector3D & |
origin, |
|
|
const CVector3D & |
dir, |
|
|
float & |
tMin, |
|
|
float & |
tMax |
|
) |
| const |
Check if a given ray intersects this box.
Must not be used if IsEmpty() is true. See Real-Time Rendering, Third Edition by T. Akenine-Moller, p. 741–744.
- Parameters
-
[in] | origin | Origin of the ray. |
[in] | dir | Direction vector of the ray, defining the positive direction of the ray. Must be of unit length. |
[out] | tMin,tMax | Distance in the positive direction from the origin of the ray to the entry and exit points in the box, provided that the ray intersects the box. if the ray does not intersect the box, no values are written to these variables. If the origin is inside the box, then this is counted as an intersection and one of tMin and tMax may be negative. |
- Returns
- true If the ray originating in
origin
and with unit direction vector dir
intersects this box, false otherwise.
◆ SetEmpty()
void CBoundingBoxOriented::SetEmpty |
( |
| ) |
|
|
inline |
◆ EMPTY
◆ m_Basis
Basis vectors (u,v,w) of the sides.
Must always be normalized, and should be orthogonal for a proper rectangular cuboid.
◆ m_Center
Centroid location of the box.
◆ m_HalfSizes
Half the sizes of the box in each dimension (u,v,w).
Positive values are expected.
The documentation for this class was generated from the following files: