Fix bug in cached meshes where convex hull was missing. Previously if a mesh was copied from the cache it would not have its convex hull if the original mesh that was cached didn't previously compute it.

Fixes #2609

PiperOrigin-RevId: 756223337
Change-Id: I54705456636c270607a17340b249047e0df75d0b
This commit is contained in:
Kyle Bayes
2025-05-08 02:41:06 -07:00
committed by Copybara-Service
parent 6cfea71985
commit f4774a5449
6 changed files with 88 additions and 57 deletions
+3 -3
View File
@@ -102,7 +102,8 @@ bool mjCCache::Insert(const std::string& modelname, const mjResource *resource,
// populate data from the cache into the given function
// populate data from the cache into the given function, return true if data was
// copied
bool mjCCache::PopulateData(const mjResource* resource, mjCDataFunc fn) {
std::lock_guard<std::mutex> lock(mutex_);
auto it = lookup_.find(resource->name);
@@ -121,8 +122,7 @@ bool mjCCache::PopulateData(const mjResource* resource, mjCDataFunc fn) {
entries_.erase(asset);
entries_.insert(asset);
asset->PopulateData(fn);
return true;
return asset->PopulateData(fn);
}