Fix: Waning implicite cast

pull/5265/head^2
Kim Kulling 2023-10-08 15:20:44 +02:00
parent 2f78d48d6b
commit 5d60cf228a
1 changed files with 3 additions and 3 deletions

View File

@ -582,15 +582,15 @@ void checkSkinnedSceneLimited(const aiScene *scene){
{0.000f, 0.000f, 0.000f, 0.111f}, {0.000f, 0.000f, 0.000f, 0.111f},
{0.000f, 0.000f, 0.000f, 0.000f}, {0.000f, 0.000f, 0.000f, 0.000f},
{0.000f, 0.000f, 0.000f, 0.000f}}; {0.000f, 0.000f, 0.000f, 0.000f}};
for (size_t boneIndex = 0; boneIndex < 10u; ++boneIndex) { for (unsigned int boneIndex = 0; boneIndex < 10u; ++boneIndex) {
EXPECT_EQ(scene->mMeshes[0]->mBones[boneIndex]->mNumWeights, numWeights[boneIndex]); EXPECT_EQ(scene->mMeshes[0]->mBones[boneIndex]->mNumWeights, numWeights[boneIndex]);
std::map<unsigned int, float> map; std::map<unsigned int, float> map;
for (size_t jointIndex = 0; jointIndex < scene->mMeshes[0]->mBones[boneIndex]->mNumWeights; ++jointIndex){ for (unsigned int jointIndex = 0; jointIndex < scene->mMeshes[0]->mBones[boneIndex]->mNumWeights; ++jointIndex){
auto key = scene->mMeshes[0]->mBones[boneIndex]->mWeights[jointIndex].mVertexId; auto key = scene->mMeshes[0]->mBones[boneIndex]->mWeights[jointIndex].mVertexId;
auto weight = scene->mMeshes[0]->mBones[boneIndex]->mWeights[jointIndex].mWeight; auto weight = scene->mMeshes[0]->mBones[boneIndex]->mWeights[jointIndex].mWeight;
map[key] = weight; map[key] = weight;
} }
for (size_t jointIndex = 0; jointIndex < scene->mMeshes[0]->mBones[boneIndex]->mNumWeights; ++jointIndex) { for (unsigned int jointIndex = 0; jointIndex < scene->mMeshes[0]->mBones[boneIndex]->mNumWeights; ++jointIndex) {
auto weight = map[jointIndex]; auto weight = map[jointIndex];
EXPECT_LT(std::abs(ai_real(weight) - ai_real(weights[boneIndex][jointIndex])), 0.002); EXPECT_LT(std::abs(ai_real(weight) - ai_real(weights[boneIndex][jointIndex])), 0.002);
} }