From cd53531050ebbfaffdb70b089dda08e6c827f703 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 5 Jul 2022 00:50:23 +0200 Subject: [PATCH] Added some comments --- src/rmodels.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/rmodels.c b/src/rmodels.c index 8b75f6397..e63d27674 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -4966,6 +4966,10 @@ static Model LoadGLTF(const char *fileName) model.meshes[meshIndex].boneIds = RL_CALLOC(model.meshes[meshIndex].vertexCount*4, sizeof(unsigned char)); // Load 4 components of unsigned char data type into mesh.boneIds + // TODO: It seems LOAD_ATTRIBUTE() macro does not work as expected in some cases, + // for cgltf_attribute_type_joints we have: + // - data.meshes[0] (256 vertices) + // - 256 values, provided as cgltf_type_vec4 of bytes (4 byte per joint, stride 4) LOAD_ATTRIBUTE(attribute, 4, unsigned char, model.meshes[meshIndex].boneIds) } else TRACELOG(LOG_WARNING, "MODEL: [%s] Joint attribute data format not supported, use vec4 u8", fileName); @@ -4980,6 +4984,9 @@ static Model LoadGLTF(const char *fileName) model.meshes[meshIndex].boneWeights = RL_CALLOC(model.meshes[meshIndex].vertexCount*4, sizeof(float)); // Load 4 components of float data type into mesh.boneWeights + // for cgltf_attribute_type_weights we have: + // - data.meshes[0] (256 vertices) + // - 256 values, provided as cgltf_type_vec4 of float (4 byte per joint, stride 16) LOAD_ATTRIBUTE(attribute, 4, float, model.meshes[meshIndex].boneWeights) } else TRACELOG(LOG_WARNING, "MODEL: [%s] Joint weight attribute data format not supported, use vec4 float", fileName);