diff options
| author | Gary M <[email protected]> | 2024-02-26 01:48:19 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-02-26 10:48:19 +0100 |
| commit | bd6c0bab44549f0ca69cddfa3f9101ccce3728a2 (patch) | |
| tree | 2cdd5e6e8e30e1fb5ee991780a9c69320ed5fe5d /src | |
| parent | d919d457d396f41a01ff5ea0ea13fa802688be1f (diff) | |
| download | raylib-bd6c0bab44549f0ca69cddfa3f9101ccce3728a2.tar.gz raylib-bd6c0bab44549f0ca69cddfa3f9101ccce3728a2.zip | |
add 16-bit unsigned short vec4 format for gltf joint loading (#3821)
Diffstat (limited to 'src')
| -rw-r--r-- | src/rmodels.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rmodels.c b/src/rmodels.c index 166f51a6..1a4374a3 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -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 |
