Fix assertion failure when rendering mesh with degenerate transform

It isn't enough to check the top-level mesh, because attached meshes also
get a transformation from script. At least cotton branches sometimes do
that.

So check the matrix directly before using it and skip rendering.
epoxy
Günther Brammer 2016-01-31 21:50:39 +01:00
parent 6e251832b8
commit a6b1ee79e9
1 changed files with 3 additions and 0 deletions

View File

@ -655,6 +655,9 @@ namespace
}
}
// Don't render with degenerate matrix
if (fabs(modelviewMatrix.Determinant()) < 1e-6)
return;
// Modelview matrix does not change between passes, so cache it here
const StdMeshMatrix normalMatrixTranspose = StdMeshMatrix::Inverse(modelviewMatrix);