diff options
Diffstat (limited to 'src/client/content_cao.h')
-rw-r--r-- | src/client/content_cao.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/client/content_cao.h b/src/client/content_cao.h index ca1518fb2..aef1f1296 100644 --- a/src/client/content_cao.h +++ b/src/client/content_cao.h @@ -102,10 +102,14 @@ private: bool m_animation_loop = true; // stores position and rotation for each bone name std::unordered_map<std::string, core::vector2d<v3f>> m_bone_position; + + int m_attachment_parent_id = 0; + std::unordered_set<int> m_attachment_child_ids; std::string m_attachment_bone = ""; v3f m_attachment_position; v3f m_attachment_rotation; bool m_attached_to_local = false; + int m_anim_frame = 0; int m_anim_num_frames = 1; float m_anim_framelength = 0.2f; @@ -122,8 +126,6 @@ private: bool m_is_visible = false; s8 m_glow = 0; - std::vector<u16> m_children; - public: GenericCAO(Client *client, ClientEnvironment *env); @@ -199,10 +201,17 @@ public: } void setChildrenVisible(bool toset); - + void setAttachment(int parent_id, const std::string &bone, v3f position, v3f rotation); + void getAttachment(int *parent_id, std::string *bone, v3f *position, + v3f *rotation) const; + void clearChildAttachments(); + void clearParentAttachment(); + void addAttachmentChild(int child_id); + void removeAttachmentChild(int child_id); ClientActiveObject *getParent() const; - - void setAttachments(); + const std::unordered_set<int> &getAttachmentChildIds() const + { return m_attachment_child_ids; } + void updateAttachments(); void removeFromScene(bool permanent); @@ -235,8 +244,6 @@ public: void updateBonePosition(); - void updateAttachments(); - void processMessage(const std::string &data); bool directReportPunch(v3f dir, const ItemStack *punchitem=NULL, |