mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-09-13 05:03:14 +08:00
Fixed small error if node has no mesh.
This commit is contained in:
parent
ec45334d3d
commit
ff48fa0ff4
@ -194,7 +194,9 @@ void drawMesh(tinygltf::Model &model, tinygltf::Mesh &mesh) {
|
|||||||
|
|
||||||
// recursively draw node and children nodes of model
|
// recursively draw node and children nodes of model
|
||||||
void drawModelNodes(tinygltf::Model &model, tinygltf::Node &node) {
|
void drawModelNodes(tinygltf::Model &model, tinygltf::Node &node) {
|
||||||
drawMesh(model, model.meshes[node.mesh]);
|
if ((node.mesh >= 0) && (node.mesh < model.meshes.size())) {
|
||||||
|
drawMesh(model, model.meshes[node.mesh]);
|
||||||
|
}
|
||||||
for (size_t i = 0; i < node.children.size(); i++) {
|
for (size_t i = 0; i < node.children.size(); i++) {
|
||||||
drawModelNodes(model, model.nodes[node.children[i]]);
|
drawModelNodes(model, model.nodes[node.children[i]]);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user