Add mjs_getOriginSpec to retrieve the original spec of an element.
The new function mjs_getOriginSpec returns the mjSpec that was used to define a given mjsElement. Unlike mjs_getSpec, this value remains constant even after the element has been attached to a different model. PiperOrigin-RevId: 911930951 Change-Id: Ia9cd79d9dfabc513d6121eadcffc5d41075224c9
This commit is contained in:
committed by
Copybara-Service
parent
8b06fe4c16
commit
ec50260e26
@@ -224,6 +224,10 @@ MJAPI int mjs_makeMesh(mjsMesh* mesh, mjtMeshBuiltin builtin, double* params, in
|
||||
// Get spec from body.
|
||||
MJAPI mjSpec* mjs_getSpec(const mjsElement* element);
|
||||
|
||||
// get spec that originally defined an element
|
||||
// contrary to mjs_getSpec, this does not change after attachment
|
||||
MJAPI mjSpec* mjs_getOriginSpec(const mjsElement* element);
|
||||
|
||||
// Find spec (model asset) by name.
|
||||
MJAPI mjSpec* mjs_findSpec(const mjSpec* spec, const char* name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user