Copy only referenced plugins.

Fixes #2111.

PiperOrigin-RevId: 681486400
Change-Id: I384ac63fa76b27d6e84d91fa857127c42ff52e34
This commit is contained in:
Alessio Quaglino
2024-10-02 09:39:41 -07:00
committed by Copybara-Service
parent 1a9d307042
commit 36ee89d6da
4 changed files with 52 additions and 30 deletions
+5
View File
@@ -364,6 +364,11 @@ class mjCModel : public mjCModel_, private mjSpec {
template <class T> void CopyList(std::vector<T*>& dest,
const std::vector<T*>& sources);
// copy vector of plugins to this model
template <class T> void CopyPlugin(std::vector<mjCPlugin*>& dest,
const std::vector<mjCPlugin*>& sources,
const std::vector<T*>& list);
// delete from list the elements that cause an error
template <class T> void RemoveFromList(std::vector<T*>& list, const mjCModel& other);