MarSTDv2004: CGeomBuilder Class Reference
From MarSTDv2004
Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members
CGeomBuilder Class Reference
Collaboration diagram for CGeomBuilder:
Detailed Description
The geometry builder provides methods to dynamically generate geometry like cubes, spheres and cilinders. All generated geometry is transformed by the geometry builder's matrix. Unlike other classes the geometry builder cannot be instantiated by the programmer. The geometry builder class is a so called singleton, which means only one instance exists of which a reference is acquired by called the I() method.// Example: CMesh mesh; CGeomBuilder::I().matrix.push(); { // Create a (4, 6, 2) sized box with center at (0, 0, 0). CGeomBuilder::I().matrix.identity(); CGeomBuilder::I().matrix.scale(2.0, 3.0, 1.0); CGeomBuilder::I().cube(mesh); } CGeomBuilder::I().matrix.pop();
Definition at line 47 of file CGeomBuilder.h.
Public Member Functions | |
| void | cube (CMesh &mesh) |
| void | cilinder (CMesh &mesh, int sides) |
| void | circle (CMesh &mesh, int sides) |
| void | cone (CMesh &mesh, int sides) |
| void | sphere (CMesh &mesh, int div1, int div2) |
| void | donut (CMesh &mesh, int sides, int slices, float r1, float r2) |
Static Public Member Functions | |
| static CGeomBuilder & | I () |
Public Attributes | |
| CMatrix | matrix |
| Generates geometric primitives are transformed by this matrix before being outputted. | |
Member Function Documentation
|
|
Get interface method. Call this to acquire an instace of the geometry builder object. Definition at line 65 of file CGeomBuilder.h. |
|
|
Generate a cube from (-1, -1, -1) to (1, 1, 1). |
|
||||||||||||
|
Circles are at z = -1 and z = +1 Cilinder is oriented along the z axis.
|
|
||||||||||||
|
Generate a circle with radius 1, in the XY plane.
|
|
||||||||||||
|
Generate a cone shape. Cone converges in (0, 0, 1).
|
|
||||||||||||||||
|
Generate a sphere with radius 1.
|
The documentation for this class was generated from the following file:
Generated on Tue Feb 8 21:59:38 2005 for MarSTDv2004 by