Kaim::Box2f Class Reference
#include <box2f.h>
This class represents a two-dimensional axis-aligned bounding box whose dimensions are stored using floating-point numbers.
Creates a new Box2f with invalid extents: you must call Set() before using it.
Kaim::Box2f::Box2f |
( |
const Vec2f & |
_min, |
|
|
const Vec2f & |
_max |
|
) |
| |
|
inline |
Creates a new Box2f with the provided extents.
- Parameters
-
_min | The minima of the bounding box. |
_max | The maxima of the bounding box. |
Creates a new Box2f with the provided extents.
- Parameters
-
min_x | The minimum position of the bounding box on the X axis. |
min_y | The minimum position of the bounding box on the Y axis. |
max_x | The maximum position of the bounding box on the X axis. |
max_y | The maximum position of the bounding box on the Y axis. |
void Kaim::Box2f::Clear |
( |
| ) |
|
|
inline |
Clears all information maintained by this object.
This method sets the extents of the box to invalid values; you must follow this method with a call to Set() before you can use the box.
void Kaim::Box2f::Enlarge |
( |
KyFloat32 |
enlargement | ) |
|
|
inline |
Enlarges the extents of the bounding box by the specified amount in all directions.
void Kaim::Box2f::ExpandByBox2 |
( |
const Box2f & |
box | ) |
|
|
inline |
Enlarges the extents of the bounding box to include the area covered by the specified bounding box.
If the bounding box already encompasses the area of box, the bounding box is not modified.
void Kaim::Box2f::ExpandByBox3 |
( |
const Box3f & |
box | ) |
|
|
inline |
Enlarges the extents of the bounding box to include the area covered by the specified bounding box on the plane of the (X,Y) axes.
If the bounding box already encompasses the area of box, the box is not modified.
void Kaim::Box2f::ExpandByVec2 |
( |
const Vec2f & |
pos | ) |
|
|
inline |
Enlarges the extents of the bounding box to include the specified two-dimensional point.
If the point is already contained within the bounding box, the box is not modified.
void Kaim::Box2f::ExpandByVec3 |
( |
const Vec3f & |
pos | ) |
|
|
inline |
Enlarges the extents of the bounding box to include the (X,Y) coordinates of the specified three-dimensional point.
If the (X,Y) coordinates of the point are already contained within the bounding box, the box is not modified.
bool Kaim::Box2f::IsPoint2DInside |
( |
const Vec2f & |
p | ) |
const |
|
inline |
Indicates whether or not the specified two-dimensional point is inside the area covered by the bounding box.
bool Kaim::Box2f::IsPoint3DInside |
( |
const Vec3f & |
p | ) |
const |
|
inline |
Indicates whether or not the (X,Y) coordinates of the specified three-dimensional point are inside the area covered by the bounding box.
bool Kaim::Box2f::IsValid |
( |
| ) |
|
|
inline |
Return true if m_min.x <= m_max.x && m_min.y <= m_max.y.
bool Kaim::Box2f::operator!= |
( |
const Box2f & |
other | ) |
const |
|
inline |
Returns true if either the minima and maxima of other is different from the minima or maxima of this object.
bool Kaim::Box2f::operator== |
( |
const Box2f & |
other | ) |
const |
|
inline |
Returns true if both the minima and maxima of other are the same as the minima and maxima of this object.
void Kaim::Box2f::Set |
( |
const Vec2f & |
min_, |
|
|
const Vec2f & |
max_ |
|
) |
| |
|
inline |
Sets the extents of the bounding box to the specified values.
- Parameters
-
min_ | The minima of the bounding box. |
max_ | The maxima of the bounding box. |
Retrieves the extents of the box along the X axis.
Retrieves the extents of the box along the Y axis.
The documentation for this class was generated from the following file: