mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-14 05:45:57 +08:00
Merge pull request #6 from lukesanantonio/master
Only use valid (triangle) primitive sets
This commit is contained in:
commit
7b91552bb1
@ -1343,10 +1343,12 @@ static bool ParseMesh(Mesh *mesh, std::string *err, const picojson::object &o) {
|
||||
(primObject->second).get<picojson::array>();
|
||||
for (size_t i = 0; i < primArray.size(); i++) {
|
||||
Primitive primitive;
|
||||
ParsePrimitive(&primitive, err, primArray[i].get<picojson::object>());
|
||||
if(ParsePrimitive(&primitive, err, primArray[i].get<picojson::object>())){
|
||||
// Only add the primitive if the parsing succeeds.
|
||||
mesh->primitives.push_back(primitive);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user