From e1a68786ae18a6de852771588d4e0adb28fbac8e Mon Sep 17 00:00:00 2001 From: OTHGMars Date: Sun, 24 Mar 2019 07:08:24 -0400 Subject: [PATCH] Fixes indexing for vertex weights. --- Engine/source/ts/assimp/assimpAppMesh.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/source/ts/assimp/assimpAppMesh.cpp b/Engine/source/ts/assimp/assimpAppMesh.cpp index 96703c271..073c50721 100644 --- a/Engine/source/ts/assimp/assimpAppMesh.cpp +++ b/Engine/source/ts/assimp/assimpAppMesh.cpp @@ -218,7 +218,7 @@ void AssimpAppMesh::lockMesh(F32 t, const MatrixF& objOffset) boneTransform.setRow(3, Point4F(mMeshData->mBones[b]->mOffsetMatrix.d1, mMeshData->mBones[b]->mOffsetMatrix.d2, mMeshData->mBones[b]->mOffsetMatrix.d3, mMeshData->mBones[b]->mOffsetMatrix.d4)); //boneTransform.inverse(); - //AssimpAppNode::convertMat(boneTransform); // Will need a better animated reference shape to determine if this is needed. + //AssimpAppNode::convertMat(boneTransform); //boneTransform.inverse(); initialTransforms.push_back(boneTransform); @@ -231,7 +231,7 @@ void AssimpAppMesh::lockMesh(F32 t, const MatrixF& objOffset) for (U32 w = 0; w < numWeights; ++w) { - aiVertexWeight* aiWeight = mMeshData->mBones[b]->mWeights; + aiVertexWeight* aiWeight = &mMeshData->mBones[b]->mWeights[w]; weight[w] = aiWeight->mWeight; vertexIndex[w] = aiWeight->mVertexId;