le3d - LightEngine 3D
A straightforward C++ 3D software engine for real-time graphics
mesh.h
Go to the documentation of this file.
1 
33 #ifndef LE_MESH_H
34 #define LE_MESH_H
35 
36 #include "global.h"
37 #include "config.h"
38 
39 #include "color.h"
40 #include "geometry.h"
41 
42 /*****************************************************************************/
47 class LeMesh
48 {
49 public:
50  LeMesh();
52  int vertexesList[], int texCoordsList[],
53  LeColor colors[], int noTriangles);
54  virtual ~LeMesh();
55 
56  void shadowCopy(LeMesh * copy) const;
57  void copy(LeMesh * copy) const;
58 
59  void allocate(int noVertexes, int noTexCoords, int noTriangles);
60  void deallocate();
61 
62  void transform(const LeMatrix &matrix);
63  void setMatrix(const LeMatrix &matrix);
64  void updateMatrix();
65 
66  void computeNormals();
67  void allocateNormals();
68  void allocateShades();
69 
70 // Overall positioning
76 // Static mesh data
79  int noVertexes;
80  float * texCoords;
82  int * vertexesList;
83  int * texCoordsList;
84  int * texSlotList;
88 // Computed mesh data
92  bool allocated;
93 };
94 
95 #endif // LE_MESH_H
int noTexCoords
Definition: mesh.h:81
LeVertex scale
Definition: mesh.h:73
int * vertexesList
Definition: mesh.h:82
void transform(const LeMatrix &matrix)
Apply a transformation matrix to the mesh view matrix.
Definition: mesh.cpp:210
void updateMatrix()
Update the mesh view matrix with position, scaling and angle vectors.
Definition: mesh.cpp:230
void allocate(int noVertexes, int noTexCoords, int noTriangles)
Allocate mesh memory.
Definition: mesh.cpp:86
LeMatrix view
Definition: mesh.h:71
float * texCoords
Definition: mesh.h:80
void deallocate()
Deallocate mesh memory.
Definition: mesh.cpp:115
LeVertex * vertexes
Definition: mesh.h:78
LightEngine 3D: General engine configuration file.
LightEngine 3D: Global helpers and definitions.
void copy(LeMesh *copy) const
Duplicate the mesh.
Definition: mesh.cpp:181
void computeNormals()
Compute mesh normals.
Definition: mesh.cpp:243
void allocateNormals()
Allocate mesh normals memory.
Definition: mesh.cpp:263
bool allocated
Definition: mesh.h:92
void setMatrix(const LeMatrix &matrix)
Set the mesh view matrix.
Definition: mesh.cpp:221
int * texCoordsList
Definition: mesh.h:83
LeMesh()
Definition: mesh.cpp:42
virtual ~LeMesh()
Definition: mesh.cpp:73
void shadowCopy(LeMesh *copy) const
Duplicate the mesh without copying its static data.
Definition: mesh.cpp:151
void allocateShades()
Allocate mesh shades memory.
Definition: mesh.cpp:275
Represent an RGBA color.
Definition: color.h:42
int * texSlotList
Definition: mesh.h:84
Represent a vertex in 3D space.
Definition: geometry_scalar.h:46
Represent a 4x4 matrix to handle 3D transforms.
Definition: geometry_scalar.h:346
int noVertexes
Definition: mesh.h:79
LightEngine 3D: Color implementation.
LeColor * shades
Definition: mesh.h:90
LeVertex angle
Definition: mesh.h:74
LeColor * colors
Definition: mesh.h:85
#define LE_OBJ_MAX_NAME
Definition: config.h:51
LeVertex pos
Definition: mesh.h:72
int noTriangles
Definition: mesh.h:86
LightEngine 3D: Vertex / axis / plane / matrix objects.
LeVertex * normals
Definition: mesh.h:89
Contain and manage a 3D mesh.
Definition: mesh.h:47
char name[LE_OBJ_MAX_NAME+1]
Definition: mesh.h:77