Core 1.0
|
Cuboids. More...
#include <cuboid.h>
Public Member Functions | |
Cuboid (const Box &) | |
Create a cuboid. More... | |
Cuboid (const Vector &, const Vector &, const Vector &, const Vector &, const Vector &, const Vector &, const Vector &, const Vector &) | |
Create a cuboid given vertexes. More... | |
~Cuboid () | |
Empty. | |
Vector & | operator[] (int) |
Returns either end vertex of the box. | |
Vector | operator[] (int) const |
Overloaded. | |
Vector | Vertex (int) const |
Returns the i-th vertex of the cuboid. More... | |
Vector | Vertex (int, int) const |
Returns the j-th vertex of i-th quadrangle face of the cuboid. More... | |
Vector | Normal (int) const |
Returns the normal to the i-th quadrangle face of the cuboid. More... | |
Quadrangle | GetQuadrangle (int) const |
Returns tthe i-th quadrangle. More... | |
void | Translate (const Vector &) |
Translates a cuboid. More... | |
void | Rotate (const Matrix &) |
Rotates a cuboid. More... | |
void | Scale (const Vector &) |
Scales a cuboid. More... | |
double | Area () const |
Compute the area. | |
Static Public Attributes | |
static const int | edge [24] |
Edge vertices. | |
static const int | quadrangle [24] |
Quadrangle faces. | |
Protected Attributes | |
Vector | a [8] |
Vertexes. | |
Cuboids.
Cuboids implement convex hexahedra, i.e. polyhedra with six faces.
|
explicit |
Create a cuboid.
box | The box. |
|
explicit |
Create a cuboid given vertexes.
a000,a100,a010,a110,a001,a101,a011,a111 | Vertexes. |
|
inline |
Returns tthe i-th quadrangle.
i | Quadrangle index. |
|
inline |
Returns the normal to the i-th quadrangle face of the cuboid.
i | Quadrangle index. |
void Cuboid::Rotate | ( | const Matrix & | r | ) |
Rotates a cuboid.
r | Rotation matrix. |
void Cuboid::Scale | ( | const Vector & | s | ) |
Scales a cuboid.
Note that this function handles negative coefficients in the scaling vector (by swapping coordinates if need be).
s | Scaling vector. |
void Cuboid::Translate | ( | const Vector & | t | ) |
Translates a cuboid.
t | Translation vector. |
|
inline |
Returns the i-th vertex of the cuboid.
Same as operator[].
i | Vertex. |
|
inline |
Returns the j-th vertex of i-th quadrangle face of the cuboid.
i | Quadrangle. |
j | Vertex. |