le3d - LightEngine 3D
A straightforward C++ 3D software engine for real-time graphics
|
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] |
LeVertex * | vertexes |
int | noVertexes |
float * | texCoords |
int | noTexCoords |
int * | vertexesList |
int * | texCoordsList |
int * | texSlotList |
LeColor * | colors |
int | noTriangles |
LeVertex * | normals |
LeColor * | shades |
bool | allocated |
Contain and manage a 3D mesh.
LeMesh::LeMesh | ( | ) |
LeMesh::LeMesh | ( | LeVertex | vertexes[], |
int | noVertexes, | ||
float | texCoords[], | ||
int | noTexCoords, | ||
int | vertexesList[], | ||
int | texCoordsList[], | ||
LeColor | colors[], | ||
int | noTriangles | ||
) |
|
virtual |
void LeMesh::allocate | ( | int | noVertexes, |
int | noTexCoords, | ||
int | noTriangles | ||
) |
Allocate mesh memory.
[in] | noVertexes | number of vertexes |
[in] | noTexCoords | number of texture coordinates |
[in] | noTriangles | number 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.
[out] | copy | pointer to the copy mesh |
void LeMesh::deallocate | ( | ) |
Deallocate mesh memory.
void LeMesh::setMatrix | ( | const LeMatrix & | matrix | ) |
Set the mesh view matrix.
[in] | matrix | view matrix |
void LeMesh::shadowCopy | ( | LeMesh * | copy | ) | const |
Duplicate the mesh without copying its static data.
[out] | copy | pointer to the copy mesh |
void LeMesh::transform | ( | const LeMatrix & | matrix | ) |
Apply a transformation matrix to the mesh view matrix.
[in] | matrix | transformation matrix |
void LeMesh::updateMatrix | ( | ) |
Update the mesh view matrix with position, scaling and angle vectors.
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