Raytracer
|
Public Member Functions | |
AxisAlignedBBox (const Interval &x, const Interval &y, const Interval &z) | |
Construct a new AxisAlignedBBox object. | |
AxisAlignedBBox (const Point3 &a, const Point3 &b) | |
Construct a new AxisAlignedBBox object. | |
AxisAlignedBBox (const AxisAlignedBBox &a, const AxisAlignedBBox &b) | |
Construct a new AxisAlignedBBox object. | |
const Interval & | axisInterval (int n) const |
Get the interval along the x-axis. | |
bool | hit (const Core::Ray &ray, Interval interval) const |
Check if the ray hits the AxisAlignedBBox. | |
int | longestAxis () const |
Get the longest axis of the AxisAlignedBBox. | |
void | padToMinimum () |
Pad the AxisAlignedBBox to the minimum size. | |
Static Public Attributes | |
static const AxisAlignedBBox | Empty |
Empty AxisAlignedBBox. | |
static const AxisAlignedBBox | Universe |
Universe AxisAlignedBBox. | |
Raytracer::Utils::AxisAlignedBBox::AxisAlignedBBox | ( | const Interval & | x, |
const Interval & | y, | ||
const Interval & | z ) |
Construct a new AxisAlignedBBox object.
This function constructs a new AxisAlignedBBox object with the given x, y, and z intervals. The AxisAlignedBBox is an axis-aligned bounding box that represents a box in 3D space. The x, y, and z intervals represent the intervals of the box along the x, y, and z axes.
x | The interval along the x-axis. |
y | The interval along the y-axis. |
z | The interval along the z-axis. |
Construct a new AxisAlignedBBox object.
This function constructs a new AxisAlignedBBox object with the given points. The AxisAlignedBBox is an axis-aligned bounding box that represents a box in 3D space. The box is defined by the two points.
a | The first point of the box. |
b | The second point of the box. |
Raytracer::Utils::AxisAlignedBBox::AxisAlignedBBox | ( | const AxisAlignedBBox & | a, |
const AxisAlignedBBox & | b ) |
Construct a new AxisAlignedBBox object.
This function constructs a new AxisAlignedBBox object by combining the given AxisAlignedBBoxes. The new AxisAlignedBBox is the smallest AxisAlignedBBox that contains both of the given AxisAlignedBBoxes.
a | The first AxisAlignedBBox. |
b | The second AxisAlignedBBox. |
const Raytracer::Utils::Interval & Raytracer::Utils::AxisAlignedBBox::axisInterval | ( | int | n | ) | const |
Get the interval along the x-axis.
This function returns the interval along the x-axis.
n | The axis to get the interval for. |
Check if the ray hits the AxisAlignedBBox.
This function checks if the ray hits the AxisAlignedBBox. The function returns true if the ray hits the AxisAlignedBBox. The function returns false if the ray does not hit the AxisAlignedBBox.
ray | The ray to check for hits. |
interval | The interval to check for hits. |
int Raytracer::Utils::AxisAlignedBBox::longestAxis | ( | ) | const |
Get the longest axis of the AxisAlignedBBox.
This function returns the index of the longest axis of the AxisAlignedBBox. The function returns 0 if the x-axis is the longest axis. The function returns 1 if the y-axis is the longest axis. The function returns 2 if the z-axis is the longest axis.
void Raytracer::Utils::AxisAlignedBBox::padToMinimum | ( | ) |
Pad the AxisAlignedBBox to the minimum size.
This function pads the AxisAlignedBBox to the minimum size. The function expands the intervals of the AxisAlignedBBox to the minimum size if the intervals are smaller than the minimum size.
|
static |
Empty AxisAlignedBBox.
This constant represents an empty AxisAlignedBBox.
|
static |
Universe AxisAlignedBBox.
This constant represents the universe AxisAlignedBBox.