Nazara Engine
0.4
A fast, complete, cross-platform API designed for game development
|
Math class that represents an oriented three dimensional box. More...
Public Member Functions | |
OrientedBox (T X, T Y, T Z, T Width, T Height, T Depth) | |
Constructs a OrientedBox object from its position and sizes. More... | |
OrientedBox (const Box< T > &box) | |
Constructs a OrientedBox object from a box. More... | |
OrientedBox (const Vector3< T > &vec1, const Vector3< T > &vec2) | |
Constructs a OrientedBox 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 > | |
OrientedBox (const OrientedBox< U > &orientedBox) | |
Constructs a OrientedBox object from another type of OrientedBox. More... | |
OrientedBox (const OrientedBox &orientedBox)=default | |
const Vector3< T > & | GetCorner (BoxCorner corner) const |
Gets the Vector3 for the corner. More... | |
bool | IsValid () const |
Checks whether this oriented box is valid. More... | |
OrientedBox & | MakeZero () |
Makes the oriented box position (0, 0, 0) and lengths (0, 0, 0) More... | |
OrientedBox & | Set (T X, T Y, T Z, T Width, T Height, T Depth) |
Sets the components of the oriented box. More... | |
OrientedBox & | Set (const Box< T > &box) |
Sets the components of the oriented box from a box. More... | |
OrientedBox & | Set (const OrientedBox &orientedBox) |
Sets the components of the oriented box with components from another. More... | |
OrientedBox & | Set (const Vector3< T > &vec1, const Vector3< T > &vec2) |
Sets a OrientedBox 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 > | |
OrientedBox & | Set (const OrientedBox< U > &orientedBox) |
String | ToString () const |
Gives a string representation. More... | |
void | Update (const Matrix4< T > &transformMatrix) |
Updates the corners of the box. More... | |
void | Update (const Vector3< T > &transformMatrix) |
Updates the corners of the box. More... | |
operator Vector3< T > * () | |
Converts oriented box to pointer of Vector3 to its own corners. More... | |
operator const Vector3< T > * () const | |
Converts oriented box to pointer of Vector3 to its own corners. More... | |
Vector3< T > & | operator() (unsigned int i) |
Gets the ith corner of the oriented box. More... | |
Vector3< T > | operator() (unsigned int i) const |
Gets the ith corner of the oriented box. More... | |
OrientedBox | operator* (T scalar) const |
Multiplies the lengths with the scalar. More... | |
OrientedBox & | operator= (const OrientedBox &other)=default |
OrientedBox & | operator*= (T scalar) |
Multiplies the lengths of this oriented box with the scalar. More... | |
bool | operator== (const OrientedBox &box) const |
Compares the oriented box to other one. More... | |
bool | operator!= (const OrientedBox &box) const |
Compares the oriented box to other one. More... | |
template<typename U > | |
OrientedBox< T > & | Set (const OrientedBox< U > &orientedBox) |
Sets the components of the orientedBox from another type of OrientedBox. More... | |
Static Public Member Functions | |
static OrientedBox | Lerp (const OrientedBox &from, const OrientedBox &to, T interpolation) |
Interpolates the oriented box to other one with a factor of interpolation. More... | |
static OrientedBox | Zero () |
Shorthand for the oriented box (0, 0, 0, 0, 0, 0) More... | |
Public Attributes | |
Box< T > | localBox |
Math class that represents an oriented three dimensional box.
Nz::OrientedBox< T >::OrientedBox | ( | T | X, |
T | Y, | ||
T | Z, | ||
T | Width, | ||
T | Height, | ||
T | Depth | ||
) |
Constructs a OrientedBox 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::OrientedBox< T >::OrientedBox | ( | const Box< T > & | box | ) |
Constructs a OrientedBox object from a box.
box | Box<T> object |
Nz::OrientedBox< T >::OrientedBox | ( | const Vector3< T > & | vec1, |
const Vector3< T > & | vec2 | ||
) |
Constructs a OrientedBox 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 OrientedBox object from another type of OrientedBox.
orientedBox | OrientedBox of type U to convert to type T |
const Vector3< T > & Nz::OrientedBox< T >::GetCorner | ( | BoxCorner | corner | ) | const |
bool Nz::OrientedBox< T >::IsValid | ( | ) | const |
Checks whether this oriented box is valid.
|
static |
Interpolates the oriented box to other one with a factor of interpolation.
from | Initial oriented box |
to | Target oriented box |
interpolation | Factor of interpolation |
OrientedBox< T > & Nz::OrientedBox< T >::MakeZero | ( | ) |
Makes the oriented box position (0, 0, 0) and lengths (0, 0, 0)
Nz::OrientedBox< T >::operator const Vector3< T > * | ( | ) | const |
Converts oriented box to pointer of Vector3 to its own corners.
Nz::OrientedBox< T >::operator Vector3< T > * | ( | ) |
Converts oriented box to pointer of Vector3 to its own corners.
bool Nz::OrientedBox< T >::operator!= | ( | const OrientedBox< T > & | box | ) | const |
Compares the oriented box to other one.
box | Other oriented box to compare with |
Vector3< T > & Nz::OrientedBox< T >::operator() | ( | unsigned int | i | ) |
Gets the ith corner of the oriented box.
std::out_of_range | if NAZARA_MATH_SAFE is defined and you try to acces to index greather than BoxCorner_Max |
Vector3< T > Nz::OrientedBox< T >::operator() | ( | unsigned int | i | ) | const |
Gets the ith corner of the oriented box.
std::out_of_range | if NAZARA_MATH_SAFE is defined and you try to acces to index greather than BoxCorner_Max |
OrientedBox< T > Nz::OrientedBox< T >::operator* | ( | T | scalar | ) | const |
Multiplies the lengths with the scalar.
scalar | The scalar to multiply width, height and depth with |
OrientedBox< T > & Nz::OrientedBox< T >::operator*= | ( | T | scalar | ) |
Multiplies the lengths of this oriented box with the scalar.
scalar | The scalar to multiply width, height and depth with |
bool Nz::OrientedBox< T >::operator== | ( | const OrientedBox< T > & | box | ) | const |
Compares the oriented box to other one.
box | Other oriented box to compare with |
OrientedBox< T > & Nz::OrientedBox< T >::Set | ( | T | X, |
T | Y, | ||
T | Z, | ||
T | Width, | ||
T | Height, | ||
T | Depth | ||
) |
Sets the components of the oriented box.
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) |
OrientedBox< T > & Nz::OrientedBox< T >::Set | ( | const Box< T > & | box | ) |
Sets the components of the oriented box from a box.
box | Box<T> object |
OrientedBox< T > & Nz::OrientedBox< T >::Set | ( | const OrientedBox< T > & | orientedBox | ) |
Sets the components of the oriented box with components from another.
orientedBox | The other OrientedBox |
OrientedBox< T > & Nz::OrientedBox< T >::Set | ( | const Vector3< T > & | vec1, |
const Vector3< T > & | vec2 | ||
) |
Sets a OrientedBox 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 |
OrientedBox<T>& Nz::OrientedBox< T >::Set | ( | const OrientedBox< U > & | orientedBox | ) |
Sets the components of the orientedBox from another type of OrientedBox.
orientedBox | OrientedBox of type U to convert its components |
String Nz::OrientedBox< T >::ToString | ( | ) | const |
Gives a string representation.
void Nz::OrientedBox< T >::Update | ( | const Matrix4< T > & | transformMatrix | ) |
Updates the corners of the box.
transformMatrix | Matrix4 which represents the transformation to apply on the local box |
void Nz::OrientedBox< T >::Update | ( | const Vector3< T > & | translation | ) |
Updates the corners of the box.
translation | Vector3 which represents the translation to apply on the local box |
|
static |
Shorthand for the oriented box (0, 0, 0, 0, 0, 0)