work save : glTF scene support
This commit is contained in:
parent
3c359ff4bc
commit
b265ded584
1 changed files with 5881 additions and 556 deletions
|
|
@ -4649,6 +4649,7 @@ static Model LoadGLTF(const char *fileName)
|
|||
TRACELOG(LOG_DEBUG, " > Buffers count: %i", data->buffers_count);
|
||||
TRACELOG(LOG_DEBUG, " > Images count: %i", data->images_count);
|
||||
TRACELOG(LOG_DEBUG, " > Textures count: %i", data->textures_count);
|
||||
TRACELOG(LOG_DEBUG, " > Scenes count: %1", data->scenes_count);
|
||||
|
||||
// Force reading data buffers (fills buffer_view->buffer->data)
|
||||
// NOTE: If an uri is defined to base64 data or external path, it's automatically loaded -> TODO: Verify this assumption
|
||||
|
|
@ -4943,6 +4944,22 @@ static Model LoadGLTF(const char *fileName)
|
|||
}
|
||||
}
|
||||
|
||||
// Load scene data
|
||||
if (data->scenes_count > 0) {
|
||||
model.scene = data->scene_id;
|
||||
model.scenes = (Scene *)malloc(sizeof(Scene) * data->scenes_count);
|
||||
memset(model.scenes, 0, sizeof(Scene) * data->scenes_count);
|
||||
for (unsigned int i = 0; i < data->scenes_count; i++) {
|
||||
// TODO: for each nodes, find
|
||||
if (data->scenes[i].nodes_count>0) {
|
||||
for (unsigned int j = 0; j < data->scenes[i].nodes_count; j++) {
|
||||
scenes
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
// TODO: Load glTF meshes animation data
|
||||
// REF: https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#skins
|
||||
|
|
|
|||
Loading…
Reference in a new issue