Make mjSpec related getter/find utilities take const parameters.
PiperOrigin-RevId: 910848529 Change-Id: I1c966a6299fe47317cbf0bfb8f8b835cbcd4ed65
This commit is contained in:
committed by
Copybara-Service
parent
d249c882d5
commit
579a27e9d2
+21
-21
@@ -1774,68 +1774,68 @@ MJAPI int mjs_makeMesh(mjsMesh* mesh, mjtMeshBuiltin builtin, double* params, in
|
||||
//---------------------------------- Find and get utilities ----------------------------------------
|
||||
|
||||
// Get spec from body.
|
||||
MJAPI mjSpec* mjs_getSpec(mjsElement* element);
|
||||
MJAPI mjSpec* mjs_getSpec(const mjsElement* element);
|
||||
|
||||
// Get compiler associated with element's origin spec.
|
||||
MJAPI mjsCompiler* mjs_getCompiler(mjsElement* element);
|
||||
MJAPI mjsCompiler* mjs_getCompiler(const mjsElement* element);
|
||||
|
||||
// Find spec (model asset) by name.
|
||||
MJAPI mjSpec* mjs_findSpec(mjSpec* spec, const char* name);
|
||||
MJAPI mjSpec* mjs_findSpec(const mjSpec* spec, const char* name);
|
||||
|
||||
// Find body in spec by name.
|
||||
MJAPI mjsBody* mjs_findBody(mjSpec* s, const char* name);
|
||||
MJAPI mjsBody* mjs_findBody(const mjSpec* s, const char* name);
|
||||
|
||||
// Find element in spec by name.
|
||||
MJAPI mjsElement* mjs_findElement(mjSpec* s, mjtObj type, const char* name);
|
||||
MJAPI mjsElement* mjs_findElement(const mjSpec* s, mjtObj type, const char* name);
|
||||
|
||||
// Find child body by name.
|
||||
MJAPI mjsBody* mjs_findChild(mjsBody* body, const char* name);
|
||||
MJAPI mjsBody* mjs_findChild(const mjsBody* body, const char* name);
|
||||
|
||||
// Get parent body.
|
||||
MJAPI mjsBody* mjs_getParent(mjsElement* element);
|
||||
MJAPI mjsBody* mjs_getParent(const mjsElement* element);
|
||||
|
||||
// Get parent frame.
|
||||
MJAPI mjsFrame* mjs_getFrame(mjsElement* element);
|
||||
MJAPI mjsFrame* mjs_getFrame(const mjsElement* element);
|
||||
|
||||
// Find frame by name.
|
||||
MJAPI mjsFrame* mjs_findFrame(mjSpec* s, const char* name);
|
||||
MJAPI mjsFrame* mjs_findFrame(const mjSpec* s, const char* name);
|
||||
|
||||
// Get default corresponding to an element.
|
||||
MJAPI mjsDefault* mjs_getDefault(mjsElement* element);
|
||||
MJAPI mjsDefault* mjs_getDefault(const mjsElement* element);
|
||||
|
||||
// Find default in model by class name.
|
||||
MJAPI mjsDefault* mjs_findDefault(mjSpec* s, const char* classname);
|
||||
MJAPI mjsDefault* mjs_findDefault(const mjSpec* s, const char* classname);
|
||||
|
||||
// Get global default from model.
|
||||
MJAPI mjsDefault* mjs_getSpecDefault(mjSpec* s);
|
||||
MJAPI mjsDefault* mjs_getSpecDefault(const mjSpec* s);
|
||||
|
||||
// Get element id.
|
||||
MJAPI int mjs_getId(mjsElement* element);
|
||||
MJAPI int mjs_getId(const mjsElement* element);
|
||||
|
||||
// Return body's first child of given type. If recurse is nonzero, also search the body's subtree.
|
||||
MJAPI mjsElement* mjs_firstChild(mjsBody* body, mjtObj type, int recurse);
|
||||
MJAPI mjsElement* mjs_firstChild(const mjsBody* body, mjtObj type, int recurse);
|
||||
|
||||
// Return body's next child of the same type; return NULL if child is last.
|
||||
// If recurse is nonzero, also search the body's subtree.
|
||||
MJAPI mjsElement* mjs_nextChild(mjsBody* body, mjsElement* child, int recurse);
|
||||
MJAPI mjsElement* mjs_nextChild(const mjsBody* body, const mjsElement* child, int recurse);
|
||||
|
||||
// Return spec's first element of selected type.
|
||||
MJAPI mjsElement* mjs_firstElement(mjSpec* s, mjtObj type);
|
||||
MJAPI mjsElement* mjs_firstElement(const mjSpec* s, mjtObj type);
|
||||
|
||||
// Return spec's next element; return NULL if element is last.
|
||||
MJAPI mjsElement* mjs_nextElement(mjSpec* s, mjsElement* element);
|
||||
MJAPI mjsElement* mjs_nextElement(const mjSpec* s, const mjsElement* element);
|
||||
|
||||
// Get wrapped element in tendon path.
|
||||
MJAPI mjsElement* mjs_getWrapTarget(mjsWrap* wrap);
|
||||
MJAPI mjsElement* mjs_getWrapTarget(const mjsWrap* wrap);
|
||||
|
||||
// Get wrapped element side site in tendon path if it has one, nullptr otherwise.
|
||||
MJAPI mjsSite* mjs_getWrapSideSite(mjsWrap* wrap);
|
||||
MJAPI mjsSite* mjs_getWrapSideSite(const mjsWrap* wrap);
|
||||
|
||||
// Get divisor of mjsWrap wrapping a puller.
|
||||
MJAPI double mjs_getWrapDivisor(mjsWrap* wrap);
|
||||
MJAPI double mjs_getWrapDivisor(const mjsWrap* wrap);
|
||||
|
||||
// Get coefficient of mjsWrap wrapping a joint.
|
||||
MJAPI double mjs_getWrapCoef(mjsWrap* wrap);
|
||||
MJAPI double mjs_getWrapCoef(const mjsWrap* wrap);
|
||||
|
||||
//---------------------------------- Attribute setters ---------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user