Fix build warnings

This commit is contained in:
sabrina-shanman 2019-10-24 15:45:06 -07:00
parent 83229db458
commit 4e0db5d641
4 changed files with 6 additions and 6 deletions

View file

@ -28,7 +28,7 @@ AnimSkeleton::AnimSkeleton(const HFMModel& hfmModel) {
const auto& defor = hfmModel.skinDeformers[i]; const auto& defor = hfmModel.skinDeformers[i];
std::vector<HFMCluster> dummyClustersList; std::vector<HFMCluster> dummyClustersList;
for (int j = 0; j < (uint32_t) defor.clusters.size(); j++) { for (uint32_t j = 0; j < (uint32_t)defor.clusters.size(); j++) {
// cast into a non-const reference, so we can mutate the FBXCluster // cast into a non-const reference, so we can mutate the FBXCluster
HFMCluster& cluster = const_cast<HFMCluster&>(defor.clusters.at(j)); HFMCluster& cluster = const_cast<HFMCluster&>(defor.clusters.at(j));

View file

@ -1389,7 +1389,7 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
mesh.clusterWeights.reserve(newWeightsEnd); mesh.clusterWeights.reserve(newWeightsEnd);
for (int weightIndex = 0; weightIndex < clusterWeights.size(); ++weightIndex) { for (int weightIndex = 0; weightIndex < clusterWeights.size(); ++weightIndex) {
// Per the GLTF specification // Per the GLTF specification
uint16_t weight = std::round(clusterWeights[weightIndex] * 65535.0); uint16_t weight = std::round(clusterWeights[weightIndex] * 65535.0f);
mesh.clusterWeights.push_back(weight); mesh.clusterWeights.push_back(weight);
} }
mesh.clusterWeightsPerVertex = WEIGHTS_PER_VERTEX; mesh.clusterWeightsPerVertex = WEIGHTS_PER_VERTEX;
@ -1542,6 +1542,7 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
} }
// TODO: Fix skinning and remove this workaround which disables skinning // TODO: Fix skinning and remove this workaround which disables skinning
// TODO: Restore after testing
{ {
std::vector<int> meshToRootJoint; std::vector<int> meshToRootJoint;
meshToRootJoint.resize(hfmModel.meshes.size(), -1); meshToRootJoint.resize(hfmModel.meshes.size(), -1);

View file

@ -1008,8 +1008,8 @@ HFMModel::Pointer OBJSerializer::read(const hifi::ByteArray& data, const hifi::V
modelMaterial->setOpacity(hfmMaterial.opacity); modelMaterial->setOpacity(hfmMaterial.opacity);
} }
// GO over the shapes once more to assign hte material index correctly // GO over the shapes once more to assign the material index correctly
for (int i = 0; i < (uint32_t) hfmModel.shapes.size(); ++i) { for (uint32_t i = 0; i < (uint32_t)hfmModel.shapes.size(); ++i) {
auto foundMaterialIndex = materialNameToIndex.find(materialNamePerShape[i]); auto foundMaterialIndex = materialNameToIndex.find(materialNamePerShape[i]);
if (foundMaterialIndex != materialNameToIndex.end()) { if (foundMaterialIndex != materialNameToIndex.end()) {
hfmModel.shapes[i].material = foundMaterialIndex.value(); hfmModel.shapes[i].material = foundMaterialIndex.value();

View file

@ -63,9 +63,8 @@ void CauterizedModel::createRenderItemSet() {
Transform::mult(transform, transform, offset); Transform::mult(transform, transform, offset);
// Run through all of the meshes, and place them into their segregated, but unsorted buckets // Run through all of the meshes, and place them into their segregated, but unsorted buckets
int shapeID = 0;
const auto& shapes = _renderGeometry->getHFMModel().shapes; const auto& shapes = _renderGeometry->getHFMModel().shapes;
for (shapeID; shapeID < (int) shapes.size(); shapeID++) { for (int shapeID = 0; shapeID < (int) shapes.size(); shapeID++) {
const auto& shape = shapes[shapeID]; const auto& shape = shapes[shapeID];
_modelMeshRenderItems << std::make_shared<CauterizedMeshPartPayload>(shared_from_this(), shape.mesh, shape.meshPart, shapeID, transform); _modelMeshRenderItems << std::make_shared<CauterizedMeshPartPayload>(shared_from_this(), shape.mesh, shape.meshPart, shapeID, transform);