From ffca553f645b5c2fcfdfffc7eb3f462b271f5368 Mon Sep 17 00:00:00 2001 From: Alessio Quaglino Date: Tue, 14 Nov 2023 07:45:46 -0800 Subject: [PATCH] Do not use the inertia box for volume computation. PiperOrigin-RevId: 582319067 Change-Id: I347d820f48faab15b609bcfc8295b07bd2d0f7ed --- src/user/user_objects.cc | 7 +------ src/user/user_objects.h | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/user/user_objects.cc b/src/user/user_objects.cc index a392d13d..9f95e37b 100644 --- a/src/user/user_objects.cc +++ b/src/user/user_objects.cc @@ -1332,12 +1332,7 @@ double mjCGeom::GetVolume(void) { } mjCMesh* pmesh = model->meshes[meshid]; - if (model->exactmeshinertia || typeinertia==mjSHELL_MESH) { - return pmesh->GetVolumeRef(typeinertia); - } else { - const double* boxsz_volume = pmesh->boxsz_volume(); - return boxsz_volume[0]*boxsz_volume[1]*boxsz_volume[2]*8; - } + return pmesh->GetVolumeRef(typeinertia); } // compute from geom shape diff --git a/src/user/user_objects.h b/src/user/user_objects.h index 564a3a88..0488f403 100644 --- a/src/user/user_objects.h +++ b/src/user/user_objects.h @@ -615,7 +615,6 @@ class mjCMesh: public mjCBase { const std::vector& userface() const { return userface_; } // mesh properites computed by Compile - const double* boxsz_volume() const { return boxsz_volume_; } const double* aamm() const { return aamm_; } // number of vertices, normals, texture coordinates, and faces