GeometricMesh Class Reference

Generic class for creating geometric meshes. More...

#include <GeometricMesh.h>

Inheritance diagram for GeometricMesh:

Mesh_Cube Mesh_GeoEllipse Mesh_Geosphere Mesh_Icosa Mesh_Sphere List of all members.

Public Member Functions

 GeometricMesh (Real radius)
 Constructor.
void createMesh (String MeshName)
 This function generates a Manual Ogre Mesh.

Protected Member Functions

void setTriangleNumber (int triangleNumber)
 Use this function to set the number of triangles of the mesh.
void setVertexNumber (int vertexNumber)
 Use this function to set the number of vertices of the mesh.
void addVertexUV (Real radius, Real Vx, Real Vy, Real Vz, Real U=AUTO, Real V=AUTO)
 This function adds a vertex in the Meshbuffer.
void addVertex (Real radius, Real Vx, Real Vy, Real Vz)
 This function adds a vertex in the Meshbuffer.
void addTriangle (int I0, int I1, int I2, bool CCW=true, bool detectborder=false)
 This function adds 3 vertices in the buffer, making a triangle.
void initializeMesh (String MeshName, int vertexNB, int edgesNB)
 This function initialize all the structures and buffers, for creating a manual mesh.
void finalizeMesh ()
 This fucntion finalizes the creation of a mesh.

Detailed Description

Generic class for creating geometric meshes.

This class has to be derived for creating the mesh. In your derived class constructor, call the functions setEdgeNumber() and setVertexNumber() to set the topology of your mesh. Then create a function fillMesh() where you will define all the vertices and all the triangles of the mesh.

See also:
Mesh_Cube Mesh_Sphere Mesh_Icosa


Member Function Documentation

void GeometricMesh::addTriangle int  I0,
int  I1,
int  I2,
bool  CCW = true,
bool  detectborder = false
[protected]
 

This function adds 3 vertices in the buffer, making a triangle.

Parameters:
I0 The index of one corner vertex.
I1 The index of one corner vertex.
I2 The index of one corner vertex.
CCW If FALSE the 3 vertices are inserted in that order: I0, I2, I1. This changes the direction of the face normal and the side where the texture will appear.
detectborder If TRUE, the function tries to detect of a border of the texture is crossing this triangle. If yes the U coordinates are re-ajusted.

void GeometricMesh::addVertex Real  radius,
Real  Vx,
Real  Vy,
Real  Vz
[protected]
 

This function adds a vertex in the Meshbuffer.

The vertex is defined by its Position + Normal and UV coordinates. Spherical UV mapping is always applied.

Parameters:
radius The radius. You can set it to 1, and use real XYZ positions, or set it to a real value and use XYZ value in the rang [0..1].
Vx The X position of the vertex.
Vy The Y position of the vertex.
Vz The Z position of the vertex (vertical axis).

void GeometricMesh::addVertexUV Real  radius,
Real  Vx,
Real  Vy,
Real  Vz,
Real  U = AUTO,
Real  V = AUTO
[protected]
 

This function adds a vertex in the Meshbuffer.

The vertex is defined by its Position + Normal and UV coordinates.

Parameters:
radius The radius. You can set it to 1, and use real XYZ positions, or set it to a real value and use XYZ value in the rang [0..1].
Vx The X position of the vertex.
Vy The Y position of the vertex.
Vz The Z position of the vertex (vertical axis).
U The U coordinate (optional). If undefined, spherical UV mapping is automaticaly applied.
V The V coordinate (optional). If undefined, spherical UV mapping is automaticaly applied.
See also:
addVertex

void GeometricMesh::createMesh String  MeshName  ) 
 

This function generates a Manual Ogre Mesh.

Parameters:
MeshName The name that will be given to the new created mesh.

void GeometricMesh::initializeMesh String  MeshName,
int  vertexNB,
int  triangleNB
[protected]
 

This function initialize all the structures and buffers, for creating a manual mesh.

Parameters:
MeshName The name that will be given to the mesh.
vertexNB The number of vertices needed for the mesh.
triangleNB The number of triangles of the mesh.


The documentation for this class was generated from the following files:
Generated on Sun May 7 22:53:51 2006 for Geometrik by  doxygen 1.4.6-NO