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
+4 -4
View File
@@ -28,7 +28,7 @@
#include <mujoco/mjplugin.h>
typedef std::function<void(const void*)> mjCDataFunc;
typedef std::function<bool(const void*)> mjCDataFunc;
typedef void (*mjCDeallocFunc)(const void*);
// A class container for a thread-safe asset cache
@@ -57,9 +57,9 @@ class mjCAsset {
std::size_t InsertNum() const { return insert_num_; }
std::size_t AccessCount() const { return access_count_; }
// pass data in the cache to the given function
void PopulateData(mjCDataFunc fn) const {
fn(data_.get());
// pass data in the cache to the given function, return true if data was copied
bool PopulateData(mjCDataFunc fn) const {
return fn(data_.get());
}
private: