Hexahedron Class Reference
[Basic]

Six-sided shape. More...

#include <Hexahedron.hpp>

Inheritance diagram for Hexahedron:
Shape SimpleDrawable SimpleTransformable Drawable Node Transformable NodeListener Identifiable Boolean Box Cube BooleanAnd BooleanXor

List of all members.

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]

Detailed Description

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
 

Member Function Documentation

ShapeTraits getTraits (  )  [static, protected]
Returns:
list of attributes used in the shape.

Reimplemented in BooleanAnd, and BooleanXor.

void load (  )  [static, protected]

Maps vertex indices to points and texture coordinates.

void toArray ( float  array[24][3],
const Vector l,
const Vector u 
) [static, protected]

Fills an array of points with values from two min and max bounds.

Parameters:
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.

Parameters:
array Array of points to fill
void updateBuffer (  )  [protected, virtual]

Initializes the points, normals, and coordinates.

Implements Shape.

Reimplemented in Boolean.

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.


The documentation for this class was generated from the following files:
Generated on Wed Jun 9 01:36:36 2010 for Gander by  doxygen 1.6.3