Always generate a BVH in flex.

The BVH is used also for computing normalized vertex coordinates in the trilinear interpolation, so we need to compute it also when the flex cannot collide.

PiperOrigin-RevId: 756349244
Change-Id: Ib397c472e31251df5a7ea85850d83a62f3b2c949
This commit is contained in:
Alessio Quaglino
2025-05-08 09:45:43 -07:00
committed by Copybara-Service
parent f4774a5449
commit ad80a4625b
2 changed files with 23 additions and 1 deletions
+2 -1
View File
@@ -3624,8 +3624,9 @@ void mjCFlex::CreateBVH() {
elemaabb_[6*e+5] = 0.5*(xmax[2]-xmin[2]) + radius;
// add bounding volume for this element
// contype and conaffinity are set to nonzero to force bvh generation
const double* aabb = elemaabb_.data() + 6*e;
tree.AddBoundingVolume(e, contype, conaffinity, aabb, nullptr, aabb);
tree.AddBoundingVolume(e, 1, 1, aabb, nullptr, aabb);
nbvh++;
}