diff options
| author | Ray <[email protected]> | 2022-09-04 18:49:54 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2022-09-04 18:49:54 +0200 |
| commit | 0917290e95898ede3ae54c01988a302e0a743793 (patch) | |
| tree | d894dbf4d4eca714675ccc699389626eaf5ac8c4 /src | |
| parent | ac3420faac3b0a19403a944eebb1e110034eb4d7 (diff) | |
| download | raylib-0917290e95898ede3ae54c01988a302e0a743793.tar.gz raylib-0917290e95898ede3ae54c01988a302e0a743793.zip | |
REVIEWED: M3D model loading #2688
Diffstat (limited to 'src')
| -rw-r--r-- | src/rmodels.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rmodels.c b/src/rmodels.c index 710cfaba..3160ecf8 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -5372,9 +5372,9 @@ static Model LoadM3D(const char *fileName) { model.bones[i].parent = m3d->bone[i].parent; strncpy(model.bones[i].name, m3d->bone[i].name, sizeof(model.bones[i].name)); - model.bindPose[i].translation.x = m3d->vertex[m3d->bone[i].pos].x; - model.bindPose[i].translation.y = m3d->vertex[m3d->bone[i].pos].y; - model.bindPose[i].translation.z = m3d->vertex[m3d->bone[i].pos].z; + model.bindPose[i].translation.x = m3d->vertex[m3d->bone[i].pos].x*m3d->scale; + model.bindPose[i].translation.y = m3d->vertex[m3d->bone[i].pos].y*m3d->scale; + model.bindPose[i].translation.z = m3d->vertex[m3d->bone[i].pos].z*m3d->scale; model.bindPose[i].rotation.x = m3d->vertex[m3d->bone[i].ori].x; model.bindPose[i].rotation.y = m3d->vertex[m3d->bone[i].ori].y; model.bindPose[i].rotation.z = m3d->vertex[m3d->bone[i].ori].z; @@ -5490,9 +5490,9 @@ static ModelAnimation *LoadModelAnimationsM3D(const char *fileName, unsigned int { for (j = 0; j < m3d->numbone; j++) { - animations[a].framePoses[i][j].translation.x = m3d->vertex[pose[j].pos].x; - animations[a].framePoses[i][j].translation.y = m3d->vertex[pose[j].pos].y; - animations[a].framePoses[i][j].translation.z = m3d->vertex[pose[j].pos].z; + animations[a].framePoses[i][j].translation.x = m3d->vertex[pose[j].pos].x*m3d->scale; + animations[a].framePoses[i][j].translation.y = m3d->vertex[pose[j].pos].y*m3d->scale; + animations[a].framePoses[i][j].translation.z = m3d->vertex[pose[j].pos].z*m3d->scale; animations[a].framePoses[i][j].rotation.x = m3d->vertex[pose[j].ori].x; animations[a].framePoses[i][j].rotation.y = m3d->vertex[pose[j].ori].y; animations[a].framePoses[i][j].rotation.z = m3d->vertex[pose[j].ori].z; |
