Skip to content

Commit

Permalink
Length of polylist <p> is not the number of inputs (i.e. VERTEX and N…
Browse files Browse the repository at this point in the history
…ORMAL) * vcount.size() * 3. If both VERTEX and NORMAL have offset 0, then the length of polylist <p> is vcount.size() * 3. So use length of set(offset) as inputSize. This fix for cases where VERTEX and NROMAL share same vcounts, see gazebosim#2682 (comment)
  • Loading branch information
k-okada committed Aug 4, 2020
1 parent b344fd9 commit e070098
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gazebo/common/ColladaLoader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1595,8 +1595,11 @@ void ColladaLoader::LoadPolylist(TiXmlElement *_polylistXml,
polylistInputXml = polylistInputXml->NextSiblingElement("input");
}

for (const auto &input : inputs)
inputSize += input.second.size();
std::set<int> total_inputs;
for (const auto &input : inputs) {
total_inputs.insert(input.second.begin(), input.second.end());
}
inputSize += total_inputs.size();

// read vcount
// break poly into triangles
Expand Down

0 comments on commit e070098

Please sign in to comment.