summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRay <[email protected]>2022-07-05 00:50:23 +0200
committerRay <[email protected]>2022-07-05 00:50:23 +0200
commitcd53531050ebbfaffdb70b089dda08e6c827f703 (patch)
treeef4d5157fbc88b43a1baf26c07a5178b743e5e49
parentbf07d17cece1421af6227a3e8c823aec58131b36 (diff)
downloadraylib-cd53531050ebbfaffdb70b089dda08e6c827f703.tar.gz
raylib-cd53531050ebbfaffdb70b089dda08e6c827f703.zip
Added some comments
-rw-r--r--src/rmodels.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rmodels.c b/src/rmodels.c
index 8b75f639..e63d2767 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);