|
Core 1.0
|
Cuboids. More...
#include <cuboid.h>
Public Member Functions | |
| Cuboid (const Box &) | |
| Create a cuboid. | |
| Cuboid (const Vector &, const Vector &, const Vector &, const Vector &, const Vector &, const Vector &, const Vector &, const Vector &) | |
| Create a cuboid given vertexes. | |
| ~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. | |
| Vector | Vertex (int, int) const |
| Returns the j-th vertex of i-th quadrangle face of the cuboid. | |
| Vector | Normal (int) const |
| Returns the normal to the i-th quadrangle face of the cuboid. | |
| Quadrangle | GetQuadrangle (int) const |
| Returns tthe i-th quadrangle. | |
| void | Translate (const Vector &) |
| Translates a cuboid. | |
| void | Rotate (const Matrix &) |
| Rotates a cuboid. | |
| void | Scale (const Vector &) |
| Scales a cuboid. | |
| 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. |