From 60874e6041bd584962bf4e1b85022274061ca694 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Mon, 20 Mar 2017 16:31:38 -0700 Subject: [PATCH] remove unused cruft --- libraries/fbx/src/FBXReader.cpp | 20 +------------------- libraries/fbx/src/FBXReader.h | 2 -- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/libraries/fbx/src/FBXReader.cpp b/libraries/fbx/src/FBXReader.cpp index 718793fefa..f4af39fdf4 100644 --- a/libraries/fbx/src/FBXReader.cpp +++ b/libraries/fbx/src/FBXReader.cpp @@ -1631,13 +1631,11 @@ FBXGeometry* FBXReader::extractFBXGeometry(const QVariantHash& mapping, const QS // whether we're skinned depends on how many clusters are attached const FBXCluster& firstFBXCluster = extracted.mesh.clusters.at(0); - int maxJointIndex = firstFBXCluster.jointIndex; glm::mat4 inverseModelTransform = glm::inverse(modelTransform); if (clusterIDs.size() > 1) { // this is a multi-mesh joint extracted.mesh.clusterIndices.resize(extracted.mesh.vertices.size()); extracted.mesh.clusterWeights.resize(extracted.mesh.vertices.size()); - float maxWeight = 0.0f; for (int i = 0; i < clusterIDs.size(); i++) { QString clusterID = clusterIDs.at(i); const Cluster& cluster = clusters[clusterID]; @@ -1662,11 +1660,9 @@ FBXGeometry* FBXReader::extractFBXGeometry(const QVariantHash& mapping, const QS glm::mat4 meshToJoint = glm::inverse(joint.bindTransform) * modelTransform; ShapeVertices& points = shapeVertices.at(jointIndex); - float totalWeight = 0.0f; for (int j = 0; j < cluster.indices.size(); j++) { int oldIndex = cluster.indices.at(j); float weight = cluster.weights.at(j); - totalWeight += weight; for (QMultiHash::const_iterator it = extracted.newIndices.constFind(oldIndex); it != extracted.newIndices.end() && it.key() == oldIndex; it++) { @@ -1701,10 +1697,6 @@ FBXGeometry* FBXReader::extractFBXGeometry(const QVariantHash& mapping, const QS } } } - if (totalWeight > maxWeight) { - maxWeight = totalWeight; - maxJointIndex = jointIndex; - } } // normalize the weights if they don't add up to one for (int i = 0; i < extracted.mesh.clusterWeights.size(); i++) { @@ -1716,7 +1708,7 @@ FBXGeometry* FBXReader::extractFBXGeometry(const QVariantHash& mapping, const QS } } else { // this is a single-mesh joint - int jointIndex = maxJointIndex; + int jointIndex = firstFBXCluster.jointIndex; FBXJoint& joint = geometry.joints[jointIndex]; // transform cluster vertices to joint-frame and save for later @@ -1736,18 +1728,8 @@ FBXGeometry* FBXReader::extractFBXGeometry(const QVariantHash& mapping, const QS } } } - extracted.mesh.isEye = (maxJointIndex == geometry.leftEyeJointIndex || maxJointIndex == geometry.rightEyeJointIndex); - buildModelMesh(extracted.mesh, url); - if (extracted.mesh.isEye) { - if (maxJointIndex == geometry.leftEyeJointIndex) { - geometry.leftEyeSize = extracted.mesh.meshExtents.largestDimension() * offsetScale; - } else { - geometry.rightEyeSize = extracted.mesh.meshExtents.largestDimension() * offsetScale; - } - } - geometry.meshes.append(extracted.mesh); int meshIndex = geometry.meshes.size() - 1; meshIDsToMeshIndices.insert(it.key(), meshIndex); diff --git a/libraries/fbx/src/FBXReader.h b/libraries/fbx/src/FBXReader.h index fa047e512f..3e38de74d6 100644 --- a/libraries/fbx/src/FBXReader.h +++ b/libraries/fbx/src/FBXReader.h @@ -219,8 +219,6 @@ public: Extents meshExtents; glm::mat4 modelTransform; - bool isEye; - QVector blendshapes; unsigned int meshIndex; // the order the meshes appeared in the object file