Public Member Functions | Public Attributes

prism_base_t< Size > Struct Template Reference
[Core Geometry Objects]

a prism is a 3D object, basically a polygon in some plane with some extent in the plane normal direction. More...

#include <prism.h>

Collaboration diagram for prism_base_t< Size >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 prism_base_t (void) throw ()
void clear (void) throw ()
bool isValid (void) const throw ()
void setVertexCount (int N)

Public Attributes

point3d_t points [Size::eMaxCount]
int nVertices

Detailed Description

template<class Size>
struct prism_base_t< Size >

a prism is a 3D object, basically a polygon in some plane with some extent in the plane normal direction.

See wikipedia for the general definition: http://en.wikipedia.org/wiki/Prism_(geometry) In particular, this is a right prism. This class (prism_base_t) is templated, so that the client can decide the max size of the vertex array. Given a polygonal base of N points, you will need 2N vertices. The array of points has a specific convention: point[2 * i] is the vertex on the "floor" (y = 0) point[(2 * i) + 1] is the vertex on the ceiling (y = height above the point[2 * i] vertex) So for instance, any consecutive sequence of 4 points starting with even index is guaranteed to be a planar rectangle. This is a very helpful property of prisms. WARNING: the xz-plane, y-extent convention is recommended for basic prisms. However, prisms can be transformed by arbitrary 3D transformations (see matrix4_t). So you can't assume that an odd-indexed point is only translated in the y-direction from its even-indexed base, for instance. However, consecutive sequences of 4 points starting with even index will always be a planar rectangle, even when transformed.

Definition at line 68 of file prism.h.


Constructor & Destructor Documentation

template<class Size >
prism_base_t< Size >::prism_base_t ( void   )  throw () [inline]

Definition at line 70 of file prism.h.


Member Function Documentation

template<class Size >
void prism_base_t< Size >::clear ( void   )  throw () [inline]

Definition at line 71 of file prism.h.

template<class Size >
bool prism_base_t< Size >::isValid ( void   )  const throw () [inline]

Definition at line 74 of file prism.h.

template<class Size >
void prism_base_t< Size >::setVertexCount ( int  N  )  [inline]

Definition at line 78 of file prism.h.


Member Data Documentation

template<class Size >
point3d_t prism_base_t< Size >::points[Size::eMaxCount]

Definition at line 87 of file prism.h.

template<class Size >
int prism_base_t< Size >::nVertices

Definition at line 88 of file prism.h.


The documentation for this struct was generated from the following file: