Merge pull request #15490 from raveenajain/stuckAvatars

Case 22424: gltf avatars break all other available avatars when used
This commit is contained in:
Shannon Romano 2019-05-06 12:39:43 -07:00 committed by GitHub
commit d206c9c87f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -874,6 +874,7 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
joint.isSkeletonJoint = false;
hfmModel.joints.push_back(joint);
}
hfmModel.shapeVertices.resize(hfmModel.joints.size());
// Build skeleton
@ -1243,6 +1244,13 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
}
}
for (int clusterIndex = 0; clusterIndex < mesh.clusters.size() - 1; clusterIndex++) {
ShapeVertices& points = hfmModel.shapeVertices.at(clusterIndex);
for (glm::vec3 vertex : mesh.vertices) {
points.push_back(vertex);
}
}
mesh.meshExtents.reset();
foreach(const glm::vec3& vertex, mesh.vertices) {
mesh.meshExtents.addPoint(vertex);