Use OnePlugin for parsing Composite and Flexcomp plugins.

PiperOrigin-RevId: 608265172
Change-Id: I053441a9e534d81c4847ad60fe4a3f7dce87350c
This commit is contained in:
Alessio Quaglino
2024-02-19 02:01:13 -08:00
committed by Copybara-Service
parent 55e2c76c01
commit b77dfc683a
9 changed files with 76 additions and 58 deletions
+3 -2
View File
@@ -315,10 +315,11 @@ mjmKey* mjm_addKey(mjmModel* model) {
// add plugin to model
mjElement mjm_addPlugin(mjmModel* model) {
mjmPlugin* mjm_addPlugin(mjmModel* model) {
mjCModel* modelC = reinterpret_cast<mjCModel*>(model->element);
mjCPlugin* plugin = modelC->AddPlugin();
return (mjElement)plugin;
plugin->plugin.instance = (mjElement)plugin;
return &plugin->plugin;
}