Change local variable in TestFbx for clarity

This commit is contained in:
sabrina-shanman 2018-10-31 14:15:30 -07:00
parent 0b7ddca5f6
commit 643026abd6

View file

@ -100,12 +100,12 @@ bool TestFbx::isReady() const {
void TestFbx::parseFbx(const QByteArray& fbxData) { void TestFbx::parseFbx(const QByteArray& fbxData) {
QVariantHash mapping; QVariantHash mapping;
HFMGeometry* fbx = readFBX(fbxData, mapping); HFMGeometry* geometry = readFBX(fbxData, mapping);
size_t totalVertexCount = 0; size_t totalVertexCount = 0;
size_t totalIndexCount = 0; size_t totalIndexCount = 0;
size_t totalPartCount = 0; size_t totalPartCount = 0;
size_t highestIndex = 0; size_t highestIndex = 0;
for (const auto& mesh : fbx->meshes) { for (const auto& mesh : geometry->meshes) {
size_t vertexCount = mesh.vertices.size(); size_t vertexCount = mesh.vertices.size();
totalVertexCount += mesh.vertices.size(); totalVertexCount += mesh.vertices.size();
highestIndex = std::max(highestIndex, vertexCount); highestIndex = std::max(highestIndex, vertexCount);
@ -123,7 +123,7 @@ void TestFbx::parseFbx(const QByteArray& fbxData) {
std::vector<DrawElementsIndirectCommand> parts; std::vector<DrawElementsIndirectCommand> parts;
parts.reserve(totalPartCount); parts.reserve(totalPartCount);
_partCount = totalPartCount; _partCount = totalPartCount;
for (const auto& mesh : fbx->meshes) { for (const auto& mesh : geometry->meshes) {
baseVertex = vertices.size(); baseVertex = vertices.size();
vec3 color; vec3 color;
@ -133,7 +133,7 @@ void TestFbx::parseFbx(const QByteArray& fbxData) {
partIndirect.firstIndex = (uint)indices.size(); partIndirect.firstIndex = (uint)indices.size();
partIndirect.baseInstance = (uint)parts.size(); partIndirect.baseInstance = (uint)parts.size();
_partTransforms.push_back(mesh.modelTransform); _partTransforms.push_back(mesh.modelTransform);
auto material = fbx->materials[part.materialID]; auto material = geometry->materials[part.materialID];
color = material.diffuseColor; color = material.diffuseColor;
for (auto index : part.quadTrianglesIndices) { for (auto index : part.quadTrianglesIndices) {
indices.push_back(index); indices.push_back(index);
@ -163,7 +163,7 @@ void TestFbx::parseFbx(const QByteArray& fbxData) {
_vertexBuffer->append(vertices); _vertexBuffer->append(vertices);
_indexBuffer->append(indices); _indexBuffer->append(indices);
_indirectBuffer->append(parts); _indirectBuffer->append(parts);
delete fbx; delete geometry;
} }
void TestFbx::renderTest(size_t testId, RenderArgs* args) { void TestFbx::renderTest(size_t testId, RenderArgs* args) {