Nazara Engine
0.4
A fast, complete, cross-platform API designed for game development
|
Math class that represents a bounding volume, a combination of a box and an oriented box. More...
Public Member Functions | |
BoundingVolume () | |
Constructs a BoundingVolume object by default. More... | |
BoundingVolume (Extend Extend) | |
Constructs a BoundingVolume object from Extend. More... | |
BoundingVolume (T X, T Y, T Z, T Width, T Height, T Depth) | |
Constructs a BoundingVolume object from its position and sizes. More... | |
BoundingVolume (const Box< T > &box) | |
Constructs a BoundingVolume object from a box. More... | |
BoundingVolume (const OrientedBox< T > &orientedBox) | |
Constructs a BoundingVolume object from an oriented box. More... | |
BoundingVolume (const Vector3< T > &vec1, const Vector3< T > &vec2) | |
Constructs a BoundingVolume object from two vectors representing point of the space (X, Y, Z) will be the components minimum of the two vectors and the (width, height, depth) will be the components maximum - minimum. More... | |
template<typename U > | |
BoundingVolume (const BoundingVolume< U > &volume) | |
Constructs a BoundingVolume object from another type of BoundingVolume. More... | |
BoundingVolume (const BoundingVolume &volume)=default | |
BoundingVolume & | ExtendTo (const BoundingVolume &volume) |
Extends the bounding volume to contain another bounding volume. More... | |
bool | IsFinite () const |
Checks whether the volume is finite. More... | |
bool | IsInfinite () const |
Checks whether the volume is infinite. More... | |
bool | IsNull () const |
Checks whether the volume is null. More... | |
BoundingVolume & | MakeInfinite () |
Makes the bounding volume infinite. More... | |
BoundingVolume & | MakeNull () |
Makes the bounding volume null. More... | |
BoundingVolume & | Set (Extend Extend) |
Sets the extend of the bounding volume from Extend. More... | |
BoundingVolume & | Set (T X, T Y, T Z, T Width, T Height, T Depth) |
Sets the components of the bounding volume. More... | |
BoundingVolume & | Set (const BoundingVolume< T > &volume) |
Sets the components of the bounding volume from another bounding volume. More... | |
BoundingVolume & | Set (const Box< T > &box) |
Sets the components of the bounding volume from a box. More... | |
BoundingVolume & | Set (const OrientedBox< T > &orientedBox) |
Sets the components of the bounding volume from an oriented box. More... | |
BoundingVolume & | Set (const Vector3< T > &vec1, const Vector3< T > &vec2) |
Sets a BoundingVolume object from two vectors representing point of the space (X, Y, Z) will be the components minimum of the two vectors and the (width, height, depth) will be the components maximum - minimum. More... | |
template<typename U > | |
BoundingVolume & | Set (const BoundingVolume< U > &volume) |
String | ToString () const |
Gives a string representation. More... | |
void | Update (const Matrix4< T > &transformMatrix) |
Updates the obb and the aabb of the bounding volume. More... | |
void | Update (const Vector3< T > &translation) |
Updates the obb and the aabb of the bounding volume. More... | |
BoundingVolume | operator* (T scalar) const |
Multiplies the lengths of the obb with the scalar. More... | |
BoundingVolume & | operator= (const BoundingVolume &other)=default |
BoundingVolume & | operator*= (T scalar) |
Multiplies the lengths of this bounding volume with the scalar. More... | |
bool | operator== (const BoundingVolume &volume) const |
Compares the bounding volume to other one. More... | |
bool | operator!= (const BoundingVolume &volume) const |
Compares the bounding volume to other one. More... | |
template<typename U > | |
BoundingVolume< T > & | Set (const BoundingVolume< U > &volume) |
Sets the components of the bounding volume from another type of BoundingVolume. More... | |
Static Public Member Functions | |
static BoundingVolume | Infinite () |
Shorthand for the bounding volume (Extend_Infinite) More... | |
static BoundingVolume | Lerp (const BoundingVolume &from, const BoundingVolume &to, T interpolation) |
Interpolates the bounding volume to other one with a factor of interpolation. More... | |
static BoundingVolume | Null () |
Shorthand for the bounding volume (Extend_Null) More... | |
Public Attributes | |
Extend | extend |
Box< T > | aabb |
OrientedBox< T > | obb |
Math class that represents a bounding volume, a combination of a box and an oriented box.
Nz::BoundingVolume< T >::BoundingVolume | ( | ) |
Constructs a BoundingVolume object by default.
Nz::BoundingVolume< T >::BoundingVolume | ( | Extend | Extend | ) |
Constructs a BoundingVolume object from Extend.
Extend | Extend of the volume part of enumeration Extend |
Nz::BoundingVolume< T >::BoundingVolume | ( | T | X, |
T | Y, | ||
T | Z, | ||
T | Width, | ||
T | Height, | ||
T | Depth | ||
) |
Constructs a BoundingVolume object from its position and sizes.
X | X component of position |
Y | Y component of position |
Z | Z component of position |
Width | Width of the box (following X) |
Height | Height of the box (following Y) |
Depth | Depth of the box (following Z) |
Nz::BoundingVolume< T >::BoundingVolume | ( | const Box< T > & | box | ) |
Constructs a BoundingVolume object from a box.
box | Box<T> object |
Nz::BoundingVolume< T >::BoundingVolume | ( | const OrientedBox< T > & | orientedBox | ) |
Constructs a BoundingVolume object from an oriented box.
orientedBox | OrientedBox<T> object |
Nz::BoundingVolume< T >::BoundingVolume | ( | const Vector3< T > & | vec1, |
const Vector3< T > & | vec2 | ||
) |
Constructs a BoundingVolume object from two vectors representing point of the space (X, Y, Z) will be the components minimum of the two vectors and the (width, height, depth) will be the components maximum - minimum.
vec1 | First point |
vec2 | Second point |
|
explicit |
Constructs a BoundingVolume object from another type of BoundingVolume.
volume | BoundingVolume of type U to convert to type T |
BoundingVolume< T > & Nz::BoundingVolume< T >::ExtendTo | ( | const BoundingVolume< T > & | volume | ) |
Extends the bounding volume to contain another bounding volume.
volume | Other volume to contain |
|
static |
Shorthand for the bounding volume (Extend_Infinite)
bool Nz::BoundingVolume< T >::IsFinite | ( | ) | const |
Checks whether the volume is finite.
bool Nz::BoundingVolume< T >::IsInfinite | ( | ) | const |
Checks whether the volume is infinite.
bool Nz::BoundingVolume< T >::IsNull | ( | ) | const |
Checks whether the volume is null.
|
static |
Interpolates the bounding volume to other one with a factor of interpolation.
from | Initial bounding volume |
to | Target bounding volume |
interpolation | Factor of interpolation |
BoundingVolume< T > & Nz::BoundingVolume< T >::MakeInfinite | ( | ) |
Makes the bounding volume infinite.
BoundingVolume< T > & Nz::BoundingVolume< T >::MakeNull | ( | ) |
Makes the bounding volume null.
|
static |
Shorthand for the bounding volume (Extend_Null)
bool Nz::BoundingVolume< T >::operator!= | ( | const BoundingVolume< T > & | volume | ) | const |
Compares the bounding volume to other one.
volume | Other bounding volume to compare with |
BoundingVolume< T > Nz::BoundingVolume< T >::operator* | ( | T | scalar | ) | const |
Multiplies the lengths of the obb with the scalar.
scale | The scalar to multiply width, height and depth with |
BoundingVolume< T > & Nz::BoundingVolume< T >::operator*= | ( | T | scalar | ) |
Multiplies the lengths of this bounding volume with the scalar.
scalar | The scalar to multiply width, height and depth with |
bool Nz::BoundingVolume< T >::operator== | ( | const BoundingVolume< T > & | volume | ) | const |
Compares the bounding volume to other one.
volume | Other bounding volume to compare with |
BoundingVolume< T > & Nz::BoundingVolume< T >::Set | ( | Extend | Extend | ) |
Sets the extend of the bounding volume from Extend.
Extend | New extend |
BoundingVolume< T > & Nz::BoundingVolume< T >::Set | ( | T | X, |
T | Y, | ||
T | Z, | ||
T | Width, | ||
T | Height, | ||
T | Depth | ||
) |
Sets the components of the bounding volume.
X | X position |
Y | Y position |
Z | Z position |
Width | Width of the oriented box (following X) |
Height | Height of the oriented box (following Y) |
Depth | Depth of the oriented box (following Z) |
BoundingVolume< T > & Nz::BoundingVolume< T >::Set | ( | const BoundingVolume< T > & | volume | ) |
Sets the components of the bounding volume from another bounding volume.
volume | The other bounding volume |
BoundingVolume< T > & Nz::BoundingVolume< T >::Set | ( | const Box< T > & | box | ) |
Sets the components of the bounding volume from a box.
box | Box<T> object |
BoundingVolume< T > & Nz::BoundingVolume< T >::Set | ( | const OrientedBox< T > & | orientedBox | ) |
Sets the components of the bounding volume from an oriented box.
orientedBox | OrientedBox<T> object |
BoundingVolume< T > & Nz::BoundingVolume< T >::Set | ( | const Vector3< T > & | vec1, |
const Vector3< T > & | vec2 | ||
) |
Sets a BoundingVolume object from two vectors representing point of the space (X, Y, Z) will be the components minimum of the two vectors and the (width, height, depth) will be the components maximum - minimum.
vec1 | First point |
vec2 | Second point |
BoundingVolume<T>& Nz::BoundingVolume< T >::Set | ( | const BoundingVolume< U > & | volume | ) |
Sets the components of the bounding volume from another type of BoundingVolume.
volume | BoundingVolume of type U to convert its components |
String Nz::BoundingVolume< T >::ToString | ( | ) | const |
Gives a string representation.
void Nz::BoundingVolume< T >::Update | ( | const Matrix4< T > & | transformMatrix | ) |
Updates the obb and the aabb of the bounding volume.
transformMatrix | Matrix4 which represents the transformation to apply |
void Nz::BoundingVolume< T >::Update | ( | const Vector3< T > & | translation | ) |
Updates the obb and the aabb of the bounding volume.
translation | Vector3 which represents the translation to apply |