22 #ifndef TETRAEDGE_TE_TE_MESH_H 23 #define TETRAEDGE_TE_TE_MESH_H 25 #include "common/array.h" 26 #include "common/ptr.h" 28 #include "tetraedge/te/te_3d_object2.h" 29 #include "tetraedge/te/te_3d_texture.h" 30 #include "tetraedge/te/te_color.h" 31 #include "tetraedge/te/te_intrusive_ptr.h" 32 #include "tetraedge/te/te_vector2f32.h" 33 #include "tetraedge/te/te_vector3f32.h" 34 #include "tetraedge/te/te_matrix4x4.h" 35 #include "tetraedge/te/te_material.h" 36 #include "tetraedge/te/te_model_vertex_animation.h" 41 class TeModelVertexAnimation;
56 MeshMode_TriangleStrip,
60 void attachMaterial(uint idx,
const TeMaterial &material);
62 void checkArrays() {};
63 void clearColors() { _colors.clear(); }
64 TeColor color(uint idx)
const {
return _colors[idx]; }
65 void copy(
const TeMesh &other);
69 void facesPerMaterial(uint idx,
unsigned short value);
70 unsigned short facesPerMaterial(uint idx)
const {
return _faceCounts[idx]; }
72 byte getFaceMaterial(uint idx);
73 virtual uint32 getTexEnvMode()
const = 0;
74 virtual TeMesh::Mode getMode()
const = 0;
75 virtual void setMode(
enum Mode mode) = 0;
76 bool hasAlpha(uint idx);
77 bool hasColor()
const {
return !_colors.empty(); }
78 bool hasUvs()
const {
return !_uvs.empty(); }
79 unsigned short index(uint num)
const {
return _indexes[num]; }
82 void materialIndex(uint idx, byte val);
83 byte materialIndex(uint idx)
const {
return _materialIndexes[idx]; }
84 void matrixIndex(uint num,
unsigned short val);
85 unsigned short matrixIndex(uint num)
const {
return _matricies[num]; }
88 void optimizeVerticies();
89 void resizeUpdatedTables(uint newSize);
91 void setColor(
const TeColor &col)
override;
92 void setColor(uint idx,
const TeColor &col);
93 void setConf(uint vertexCount, uint indexCount,
enum Mode mode, uint materialCount, uint materialIndexCount);
94 void setIndex(uint idx, uint val);
105 TeVector2f32 textureUV(uint idx)
const {
return _uvs[idx]; }
108 uint numIndexes()
const {
return _indexes.
size(); }
109 uint numVerticies()
const {
return _verticies.size(); }
110 bool shouldDrawMaybe()
const {
return _shouldDraw; }
112 void setShouldDraw(
bool val) { _shouldDraw = val; }
113 virtual void setglTexEnvBlend() = 0;
114 void setHasAlpha(
bool val) { _hasAlpha = val; }
117 void setUpdatedVertex(uint idx,
const TeVector3f32 &val) { _updatedVerticies[idx] = val; }
118 void setUpdatedNormal(uint idx,
const TeVector3f32 &val) { _updatedNormals[idx] = val; }
120 const TeVector3f32 &preUpdatedVertex(uint idx)
const {
return _verticies[idx]; }
121 const TeVector3f32 &preUpdatedNormal(uint idx)
const {
return _normals[idx]; }
123 static TeMesh *makeInstance();
141 uint _initialMaterialIndexCount;
149 #endif // TETRAEDGE_TE_TE_MESH_H Definition: detection.h:27
Definition: te_color.h:30
Definition: te_matrix4x4.h:37
Definition: te_3d_object2.h:36
Definition: te_material.h:35
size_type size() const
Definition: array.h:315
Definition: te_intrusive_ptr.h:31
Definition: te_vector3f32.h:33
Definition: te_vector2f32.h:32