Improve error text when a mesh face references an invalid vertex.

PiperOrigin-RevId: 618715730
Change-Id: I28fae1e1570d359db4be98e9c5b7713169eaf34f
This commit is contained in:
Matthew Bennice
2024-03-24 20:58:08 -07:00
committed by Copybara-Service
parent bb42ff1657
commit 7875e93fea
2 changed files with 27 additions and 1 deletions
+2 -1
View File
@@ -549,7 +549,8 @@ void mjCMesh::Compile(const mjVFS* vfs) {
// check vertices exist
for (int i=0; i<userface_.size(); i++) {
if (userface_[i] >= nvert_ || userface_[i] < 0) {
throw mjCError(this, "index in face does not exist in vertex array");
throw mjCError(this, "in face %d, vertex index %d does not exist",
nullptr, i / 3, userface_[i]);
}
}