le3d - LightEngine 3D
A straightforward C++ 3D software engine for real-time graphics
Public Member Functions | Public Attributes | List of all members
LeMesh Class Reference

Contain and manage a 3D mesh. More...

#include <mesh.h>

Public Member Functions

 LeMesh ()
 
 LeMesh (LeVertex vertexes[], int noVertexes, float texCoords[], int noTexCoords, int vertexesList[], int texCoordsList[], LeColor colors[], int noTriangles)
 
virtual ~LeMesh ()
 
void shadowCopy (LeMesh *copy) const
 Duplicate the mesh without copying its static data. More...
 
void copy (LeMesh *copy) const
 Duplicate the mesh. More...
 
void allocate (int noVertexes, int noTexCoords, int noTriangles)
 Allocate mesh memory. More...
 
void deallocate ()
 Deallocate mesh memory. More...
 
void transform (const LeMatrix &matrix)
 Apply a transformation matrix to the mesh view matrix. More...
 
void setMatrix (const LeMatrix &matrix)
 Set the mesh view matrix. More...
 
void updateMatrix ()
 Update the mesh view matrix with position, scaling and angle vectors. More...
 
void computeNormals ()
 Compute mesh normals. More...
 
void allocateNormals ()
 Allocate mesh normals memory. More...
 
void allocateShades ()
 Allocate mesh shades memory. More...
 

Public Attributes

LeMatrix view
 
LeVertex pos
 
LeVertex scale
 
LeVertex angle
 
char name [LE_OBJ_MAX_NAME+1]
 
LeVertexvertexes
 
int noVertexes
 
float * texCoords
 
int noTexCoords
 
int * vertexesList
 
int * texCoordsList
 
int * texSlotList
 
LeColorcolors
 
int noTriangles
 
LeVertexnormals
 
LeColorshades
 
bool allocated
 

Detailed Description

Contain and manage a 3D mesh.

Constructor & Destructor Documentation

LeMesh::LeMesh ( )
LeMesh::LeMesh ( LeVertex  vertexes[],
int  noVertexes,
float  texCoords[],
int  noTexCoords,
int  vertexesList[],
int  texCoordsList[],
LeColor  colors[],
int  noTriangles 
)
LeMesh::~LeMesh ( )
virtual

Member Function Documentation

void LeMesh::allocate ( int  noVertexes,
int  noTexCoords,
int  noTriangles 
)

Allocate mesh memory.

Parameters
[in]noVertexesnumber of vertexes
[in]noTexCoordsnumber of texture coordinates
[in]noTrianglesnumber of triangles
void LeMesh::allocateNormals ( )

Allocate mesh normals memory.

void LeMesh::allocateShades ( )

Allocate mesh shades memory.

void LeMesh::computeNormals ( )

Compute mesh normals.

void LeMesh::copy ( LeMesh copy) const

Duplicate the mesh.

Parameters
[out]copypointer to the copy mesh
void LeMesh::deallocate ( )

Deallocate mesh memory.

void LeMesh::setMatrix ( const LeMatrix matrix)

Set the mesh view matrix.

Parameters
[in]matrixview matrix
void LeMesh::shadowCopy ( LeMesh copy) const

Duplicate the mesh without copying its static data.

Parameters
[out]copypointer to the copy mesh
void LeMesh::transform ( const LeMatrix matrix)

Apply a transformation matrix to the mesh view matrix.

Parameters
[in]matrixtransformation matrix
void LeMesh::updateMatrix ( )

Update the mesh view matrix with position, scaling and angle vectors.

Member Data Documentation

bool LeMesh::allocated

Shade color per triangle (lighting)

LeVertex LeMesh::angle

Absolute angle of the mesh (in degrees)

LeColor* LeMesh::colors

Triangles - colors

char LeMesh::name[LE_OBJ_MAX_NAME+1]

Mesh name

LeVertex* LeMesh::normals
int LeMesh::noTexCoords

Number of texture coordinates in the mesh

int LeMesh::noTriangles

Number of triangles in the mesh

int LeMesh::noVertexes

Number of vertexes in the mesh

LeVertex LeMesh::pos

Position of the mesh

LeVertex LeMesh::scale

Scaling of the mesh

LeColor* LeMesh::shades

Normal vector per triangle

float* LeMesh::texCoords

Texture coordinates (u, v) of the mesh

int* LeMesh::texCoordsList

Triangles - texture coordinate indexes tripplets

int* LeMesh::texSlotList

Triangles - texture slots

LeVertex* LeMesh::vertexes

Vertex positions (x, y, z) of the mesh

int* LeMesh::vertexesList

Triangles - vertex indexes tripplets

LeMatrix LeMesh::view

View matrix of the mesh


The documentation for this class was generated from the following files: