MuJoCo is fantastic! Here is a set of Odin bindings for MuJoCo 3.8.0.
- Use odin-c-bindgen with the
bindgen.sjsonincluded here to make a rough first pass. - Update several fields to
bit_set:
mjdata.odin : tStatemjModel.odin : tDisableBitmjModel.odin : tEnableBit
-
Convert all array pointers to multi-pointers. Search regex:
^.*\(.* x .*\) -
Remove the
mj_prefix from foreign functions inmujoco.odinand add in the linked library loading. -
Delete otherwise-empty files.
-
Change functions taking integers to
enumtypes.
- What to do with the
mju_prefix functions?
- Download MuJoCo
- Copy the dylib into the project:
cp /Volumes/MuJoCo/mujoco.framework/Versions/A/libmujoco.3.8.0.dylib ~/GitHub/sotibot/mujoco/ - Fix the tool name by running this for your directory:
install_name_tool -change @rpath/mujoco.framework/Versions/A/libmujoco.3.8.0.dylib @executable_path/libmujoco.3.8.0.dylib ~/GitHub/sotibot/mujoco/tests/prog.bin