Override inertia of body with visual geoms if discardvisual is true.

Fixes #2546.

PiperOrigin-RevId: 742650702
Change-Id: I753c1e1c89da732ece100676644bbecf9d6373bb
This commit is contained in:
Alessio Quaglino
2025-04-01 05:20:59 -07:00
committed by Copybara-Service
parent 86c970bc23
commit 648a03c2cf
3 changed files with 27 additions and 17 deletions
-10
View File
@@ -1976,16 +1976,6 @@ void mjCBody::Compile(void) {
}
}
// if discarding visual geoms, use explicit inertias
if (compiler->discardvisual) {
for (int j=0; j < geoms.size(); j++) {
if (geoms[j]->IsVisual()) {
explicitinertial = true;
break;
}
}
}
// free joint alignment, phase 2 (transform sites, cameras and lights)
if (align_free) {
// frames have already been compiled and applied to children