Six-sided shape. More...
#include <Hexahedron.hpp>
Public Member Functions | |
| Hexahedron (const Tag &tag, ShapeTraits traits) | |
Protected Member Functions | |
| virtual void | updateBuffer () |
| virtual void | updateBufferPoints () |
| virtual void | updateBufferNormals () |
| virtual void | updateBufferCoords ()=0 |
Static Protected Member Functions | |
| static ShapeTraits | getTraits () |
| static void | load () |
| static void | toArray (float array[24][3], const Vector &l, const Vector &u) |
| static void | toNormals (GLfloat array[24][3]) |
Static Protected Attributes | |
| static bool | loaded = false |
| static int | indices [8][3] |
Six-sided shape.
Hexahedron is an abstract base class for a six-sided shape. It provides points and normals, but no texture coordinates.
The following diagram depicts which vertices correspond to which points and faces.
front left top
+-------+ 9-------+ 17-----16
/| /| /| /| /| /|
1-------0 | 8-------+ | 18-----19 |
| +-----|-+ | 10----|-+ | +-----|-+
|/ |/ |/ |/ |/ |/
2-------3 11------+ +-------+ back right bottom
4-------5 +------12 +-------+
/| /| /| /| /| /|
+-------+ | +------13 | +-------+ |
| 7-----|-6 | +-----|15 | 22----|23
|/ |/ |/ |/ |/ |/
+-------+ +------14 21-----20
| ShapeTraits getTraits | ( | ) | [static, protected] |
Reimplemented in BooleanAnd, and BooleanXor.
| void load | ( | ) | [static, protected] |
Maps vertex indices to points and texture coordinates.
Fills an array of points with values from two min and max bounds.
| array | Array of points to fill | |
| l | Lower corner of the shape | |
| u | Upper corner of the shape |
| void toNormals | ( | GLfloat | array[24][3] | ) | [static, protected] |
Fills an array of normals.
| array | Array of points to fill |
| void updateBuffer | ( | ) | [protected, virtual] |
| void updateBufferNormals | ( | ) | [protected, virtual] |
Initializes the normals in the vertex buffer.
Reimplemented in BooleanXor.
| void updateBufferPoints | ( | ) | [protected, virtual] |
Initializes the points in the vertex buffer.
6-------7
/| /|
2-------3 |
| 4-----|-5
|/ |/
0-------1
Reimplemented in BooleanAnd, and BooleanXor.
1.6.3