summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/raylib.h12
-rw-r--r--src/rlgl.h5
2 files changed, 15 insertions, 2 deletions
diff --git a/src/raylib.h b/src/raylib.h
index bc8745c6..251dd020 100644
--- a/src/raylib.h
+++ b/src/raylib.h
@@ -461,6 +461,7 @@ typedef struct Mesh {
int vertexCount; // Number of vertices stored in arrays
int triangleCount; // Number of triangles stored (indexed or not)
+ // Default vertex data
float *vertices; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
float *texcoords; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
float *texcoords2; // Vertex second texture coordinates (useful for lightmaps) (shader-location = 5)
@@ -468,9 +469,16 @@ typedef struct Mesh {
float *tangents; // Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)
unsigned char *colors; // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
unsigned short *indices;// Vertex indices (in case vertex data comes indexed)
-
+
+ // Animation vertex data
+ float *baseVertices; // Vertex base position (required to apply bones transformations)
+ float *baseNormals; // Vertex base normals (required to apply bones transformations)
+ float *weightBias; // Vertex weight bias
+ int *weightId; // Vertex weight id
+
+ // OpenGL identifiers
unsigned int vaoId; // OpenGL Vertex Array Object id
- unsigned int vboId[7]; // OpenGL Vertex Buffer Objects id (7 types of vertex data)
+ unsigned int vboId[7]; // OpenGL Vertex Buffer Objects id (default vertex data)
} Mesh;
// Shader type (generic)
diff --git a/src/rlgl.h b/src/rlgl.h
index 927dbc85..b98b4d7f 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -2652,6 +2652,11 @@ void rlUnloadMesh(Mesh *mesh)
if (mesh->tangents != NULL) free(mesh->tangents);
if (mesh->texcoords2 != NULL) free(mesh->texcoords2);
if (mesh->indices != NULL) free(mesh->indices);
+
+ if (mesh->baseVertices != NULL) free(mesh->baseVertices);
+ if (mesh->baseNormals != NULL) free(mesh->baseNormals);
+ if (mesh->weightBias != NULL) free(mesh->weightBias);
+ if (mesh->weightId != NULL) free(mesh->weightId);
rlDeleteBuffers(mesh->vboId[0]); // vertex
rlDeleteBuffers(mesh->vboId[1]); // texcoords