Commit 8a863e16 authored by Ilya Prokhorov's avatar Ilya Prokhorov

Model validation

parent cc3d650c
......@@ -89,6 +89,10 @@ bool FSGLModel::isValid()
cout << "No material for mesh - not valid" << endl;
return false;
}
if (mesh->verticesObjects->size() < 1) {
cout << "No vertices in mesh - not valid" << endl;
return false;
}
}
return true;
......
......@@ -510,6 +510,9 @@ void OGLNewAgeRenderer::renderObject(shared_ptr<FSGLObject> object)
cout << "Render object" << endl;
auto model = object->model;
if (model->isValid() != true) {
throwRuntimeException("Can't render - model self validation return false. Malformed model data?");
}
for (unsigned int meshIndex = 0; meshIndex < model->meshes.size(); meshIndex++)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment