浏览代码

Added some comments

pull/2570/head
Ray 2 年前
父节点
当前提交
cd53531050
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. +7
    -0
      src/rmodels.c

+ 7
- 0
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);

正在加载...
取消
保存