Do not rely on global object lists in mjCBody::NextChild().
PiperOrigin-RevId: 782963753 Change-Id: I0afecbab4b7796f077963ba66eb7140d8f83ad89
This commit is contained in:
committed by
Copybara-Service
parent
5187a712be
commit
6e7aaacb85
@@ -505,6 +505,10 @@ class mjCBody : public mjCBody_, private mjsBody {
|
||||
// getters
|
||||
std::vector<mjCBody*> Bodies() const { return bodies; }
|
||||
|
||||
// get list of a given type
|
||||
template <class T>
|
||||
const std::vector<T*>& GetList() const;
|
||||
|
||||
// accumulate inertia of another body into this body, if `result` is not nullptr, the accumulated
|
||||
// inertia will be stored in `result`, otherwise the body's private spec will be used.
|
||||
void AccumulateInertia(const mjsBody* other, mjsBody* result = nullptr);
|
||||
@@ -534,12 +538,6 @@ class mjCBody : public mjCBody_, private mjsBody {
|
||||
template <typename T>
|
||||
void CopyList(std::vector<T*>& dst, const std::vector<T*>& src,
|
||||
std::map<mjCFrame*, int>& fmap, const mjCFrame* pframe = nullptr);
|
||||
|
||||
// gets next child of the same type in this body
|
||||
template <class T>
|
||||
mjsElement* GetNext(const std::vector<T*>& list, const mjsElement* child);
|
||||
|
||||
bool IsAncestor(const mjCBody* child) const; // true if child is a descendant of this body
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user