Allow passing a null pointer in mj_recompile.

Fixes #1819.

PiperOrigin-RevId: 653242587
Change-Id: I36dbd6ed54abdf21abeb62cf41ee88f159008d01
This commit is contained in:
Alessio Quaglino
2024-07-17 08:28:13 -07:00
committed by Copybara-Service
parent a2fd34caee
commit 2664cc1391
4 changed files with 38 additions and 24 deletions
+3 -2
View File
@@ -273,8 +273,9 @@ class mjCModel : public mjCModel_, private mjSpec {
std::string_view name = "");
// save/restore the current state
void SaveState(const mjData* d);
void RestoreState(const mjModel* m, mjData** dest);
void SaveState(const mjtNum* qpos, const mjtNum* qvel, const mjtNum* act);
void MakeData(const mjModel* m, mjData** dest);
void RestoreState(mjtNum* qpos, mjtNum* qvel, mjtNum* act);
// map from default class name to default class pointer
std::unordered_map<std::string, mjCDef*> def_map;