Add mjmNumeric, mjmText, mjmTuple, mjmKey to C API.

PiperOrigin-RevId: 606919327
Change-Id: I477f6cd8beefcb3962238722565e3b398b73446c
This commit is contained in:
Alessio Quaglino
2024-02-14 03:09:38 -08:00
committed by Copybara-Service
parent 266161ee4c
commit 2ee8a4dabd
9 changed files with 482 additions and 164 deletions
+36
View File
@@ -251,6 +251,42 @@ mjmSensor* mjm_addSensor(void* model) {
// add numeric to model
mjmNumeric* mjm_addNumeric(void* model) {
mjCModel* modelC = static_cast<mjCModel*>(model);
mjCNumeric* numeric = modelC->AddNumeric();
return &numeric->spec;
}
// add text to model
mjmText* mjm_addText(void* model) {
mjCModel* modelC = static_cast<mjCModel*>(model);
mjCText* text = modelC->AddText();
return &text->spec;
}
// add tuple to model
mjmTuple* mjm_addTuple(void* model) {
mjCModel* modelC = static_cast<mjCModel*>(model);
mjCTuple* tuple = modelC->AddTuple();
return &tuple->spec;
}
// add keyframe to model
mjmKey* mjm_addKey(void* model) {
mjCModel* modelC = static_cast<mjCModel*>(model);
mjCKey* key = modelC->AddKey();
return &key->spec;
}
// Add plugin to model.
mjElement mjm_addPlugin(void* model) {
mjCModel* modelC = static_cast<mjCModel*>(model);