mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-06 11:28:17 +00:00
Minor tweaks
This commit is contained in:
@@ -5289,19 +5289,18 @@ static Model LoadGLTF(const char *fileName)
|
|||||||
if (result != cgltf_result_success) TRACELOG(LOG_INFO, "MODEL: [%s] Failed to load mesh/material buffers", fileName);
|
if (result != cgltf_result_success) TRACELOG(LOG_INFO, "MODEL: [%s] Failed to load mesh/material buffers", fileName);
|
||||||
|
|
||||||
int primitivesCount = 0;
|
int primitivesCount = 0;
|
||||||
|
|
||||||
// NOTE: We will load every primitive in the glTF as a separate raylib Mesh.
|
// NOTE: We will load every primitive in the glTF as a separate raylib Mesh.
|
||||||
// Determine total number of meshes needed from the node hierarchy.
|
// Determine total number of meshes needed from the node hierarchy.
|
||||||
for (unsigned int i = 0; i < data->nodes_count; i++)
|
for (unsigned int i = 0; i < data->nodes_count; i++)
|
||||||
{
|
{
|
||||||
cgltf_node *node = &(data->nodes[i]);
|
cgltf_node *node = &(data->nodes[i]);
|
||||||
cgltf_mesh *mesh = node->mesh;
|
cgltf_mesh *mesh = node->mesh;
|
||||||
if (!mesh)
|
if (!mesh) continue;
|
||||||
continue;
|
|
||||||
|
|
||||||
for (unsigned int p = 0; p < mesh->primitives_count; p++)
|
for (unsigned int p = 0; p < mesh->primitives_count; p++)
|
||||||
{
|
{
|
||||||
if (mesh->primitives[p].type == cgltf_primitive_type_triangles)
|
if (mesh->primitives[p].type == cgltf_primitive_type_triangles) primitivesCount++;
|
||||||
primitivesCount++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TRACELOG(LOG_DEBUG, " > Primitives (triangles only) count based on hierarchy : %i", primitivesCount);
|
TRACELOG(LOG_DEBUG, " > Primitives (triangles only) count based on hierarchy : %i", primitivesCount);
|
||||||
|
Reference in New Issue
Block a user