Pārlūkot izejas kodu

add 16-bit unsigned short vec4 format for gltf joint loading (#3821)

pull/3839/head
Gary M pirms 1 gada
committed by GitHub
vecāks
revīzija
bd6c0bab44
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: B5690EEEBB952194
1 mainītis faili ar 7 papildinājumiem un 0 dzēšanām
  1. +7
    -0
      src/rmodels.c

+ 7
- 0
src/rmodels.c Parādīt failu

@ -5287,6 +5287,13 @@ static Model LoadGLTF(const char *fileName)
unsigned short* ptr = (unsigned short*)model.meshes[meshIndex].boneIds;
LOAD_ATTRIBUTE(attribute, 2, unsigned short, ptr)
}
else if ((attribute->component_type == cgltf_component_type_r_16u) && (attribute->type == cgltf_type_vec4))
{
// Handle 16-bit unsigned short, vec4 format
model.meshes[meshIndex].boneIds = RL_CALLOC(model.meshes[meshIndex].vertexCount*4, sizeof(unsigned short));
unsigned short* ptr = (unsigned short*)model.meshes[meshIndex].boneIds;
LOAD_ATTRIBUTE(attribute, 4, unsigned short, ptr)
}
else if ((attribute->component_type == cgltf_component_type_r_32u) && (attribute->type == cgltf_type_vec4))
{
// Handle 32-bit unsigned int, vec4 format

Notiek ielāde…
Atcelt
Saglabāt