Skip to content

Commit 3aced1f

Browse files
committed
Update rmodels.c
1 parent 48ec41f commit 3aced1f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/rmodels.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2358,11 +2358,12 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame)
23582358
Mesh mesh = model.meshes[m];
23592359
Vector3 animVertex = { 0 };
23602360
Vector3 animNormal = { 0 };
2361+
const int vValues = mesh.vertexCount*3;
2362+
23612363
int boneId = 0;
23622364
int boneCounter = 0;
2363-
float boneWeight = 0.0;
2365+
float boneWeight = 0.0f;
23642366
bool updated = false; // Flag to check when anim vertex information is updated
2365-
const int vValues = mesh.vertexCount*3;
23662367

23672368
// Skip if missing bone data, causes segfault without on some models
23682369
if ((mesh.boneWeights == NULL) || (mesh.boneIds == NULL)) continue;
@@ -2388,7 +2389,7 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame)
23882389
// Early stop when no transformation will be applied
23892390
if (boneWeight == 0.0f) continue;
23902391
animVertex = (Vector3){ mesh.vertices[vCounter], mesh.vertices[vCounter + 1], mesh.vertices[vCounter + 2] };
2391-
animVertex = Vector3Transform(animVertex,model.meshes[m].boneMatrices[boneId]);
2392+
animVertex = Vector3Transform(animVertex, model.meshes[m].boneMatrices[boneId]);
23922393
mesh.animVertices[vCounter] += animVertex.x*boneWeight;
23932394
mesh.animVertices[vCounter+1] += animVertex.y*boneWeight;
23942395
mesh.animVertices[vCounter+2] += animVertex.z*boneWeight;

0 commit comments

Comments
 (0)