Clean up mj_id2name and mj_name2id.

PiperOrigin-RevId: 514340647
Change-Id: Idf895b2d7a4a8833725afbe5c71c777081b42d9e
This commit is contained in:
Kyle Bayes
2023-03-06 01:58:51 -08:00
committed by Copybara-Service
parent 222ee00a66
commit 49dd6b4193
5 changed files with 23 additions and 22 deletions
+2 -2
View File
@@ -81,10 +81,10 @@ MJAPI int mj_jacDifPair(const mjModel* m, const mjData* d, int* chain,
// get string hash, see http://www.cse.yorku.ca/~oz/hash.html
uint64_t mj_hashdjb2(const char* s, uint64_t n);
// get id of object with specified name; -1: not found; type is mjtObj
// get id of object with the specified mjtObj type and name, returns -1 if id not found
MJAPI int mj_name2id(const mjModel* m, int type, const char* name);
// get name of object with specified id; 0: invalid type or id; type is mjtObj
// get name of object with the specified mjtObj type and id, returns NULL if name not found
MJAPI const char* mj_id2name(const mjModel* m, int type, int id);