summaryrefslogtreecommitdiffhomepage
path: root/src/models.c
diff options
context:
space:
mode:
authorRay <[email protected]>2021-05-20 19:25:09 +0200
committerRay <[email protected]>2021-05-20 19:25:09 +0200
commitf33cec64aac2cae70bda939a988c8dc32e491c99 (patch)
tree422315b5725d59f0b3d80970b2cd0bb8fa03ce74 /src/models.c
parente401d5c48e05efdd8b2cd9857df1f26b03299154 (diff)
downloadraylib-f33cec64aac2cae70bda939a988c8dc32e491c99.tar.gz
raylib-f33cec64aac2cae70bda939a988c8dc32e491c99.zip
Use output->boneCount instead of nodes_count
Diffstat (limited to 'src/models.c')
-rw-r--r--src/models.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/models.c b/src/models.c
index f21c930d..b9d24e10 100644
--- a/src/models.c
+++ b/src/models.c
@@ -4718,7 +4718,7 @@ static ModelAnimation *LoadGLTFModelAnimations(const char *fileName, int *animCo
// output->framerate = // TODO: Use framerate instead of const timestep
// Name and parent bones
- for (unsigned int j = 0; j < data->nodes_count; j++)
+ for (unsigned int j = 0; j < output->boneCount; j++)
{
strcpy(output->bones[j].name, data->nodes[j].name == 0 ? "ANIMJOINT" : data->nodes[j].name);
output->bones[j].parent = (data->nodes[j].parent != NULL) ? (int)(data->nodes[j].parent - data->nodes) : -1;
@@ -4728,9 +4728,9 @@ static ModelAnimation *LoadGLTFModelAnimations(const char *fileName, int *animCo
// Initiate with zero bone translations
for (int frame = 0; frame < output->frameCount; frame++)
{
- output->framePoses[frame] = RL_MALLOC(data->nodes_count*sizeof(Transform));
+ output->framePoses[frame] = RL_MALLOC(output->boneCount*sizeof(Transform));
- for (unsigned int i = 0; i < data->nodes_count; i++)
+ for (unsigned int i = 0; i < output->boneCount; i++)
{
output->framePoses[frame][i].translation = Vector3Zero();
output->framePoses[frame][i].rotation = QuaternionIdentity();