Move missing translations warnings to verbosestream (#8156)
[oweals/minetest.git] / src / content_sao.h
index 6583f31d659c82a3b4ef04ddf465a1bb4818307f..6d2f55b70bf7fee0f2d1c826343e9d99c135b958 100644 (file)
@@ -32,17 +32,20 @@ public:
        UnitSAO(ServerEnvironment *env, v3f pos);
        virtual ~UnitSAO() = default;
 
-       virtual void setYaw(const float yaw) { m_yaw = yaw; }
-       float getYaw() const { return m_yaw; };
-       f32 getRadYaw() const { return m_yaw * core::DEGTORAD; }
+       void setRotation(v3f rotation) { m_rotation = rotation; }
+       const v3f &getRotation() const { return m_rotation; }
+       v3f getRadRotation() { return m_rotation * core::DEGTORAD; }
+
        // Deprecated
-       f32 getRadYawDep() const { return (m_yaw + 90.) * core::DEGTORAD; }
+       f32 getRadYawDep() const { return (m_rotation.Y + 90.) * core::DEGTORAD; }
 
        s16 getHP() const { return m_hp; }
        // Use a function, if isDead can be defined by other conditions
        bool isDead() const { return m_hp == 0; }
 
-       bool isAttached() const;
+       inline bool isAttached() const
+       { return getParent(); }
+
        void setArmorGroups(const ItemGroupList &armor_groups);
        const ItemGroupList &getArmorGroups();
        void setAnimation(v2f frame_range, float frame_speed, float frame_blend, bool frame_loop);
@@ -52,17 +55,21 @@ public:
        void getBonePosition(const std::string &bone, v3f *position, v3f *rotation);
        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);
+       void clearChildAttachments();
+       void clearParentAttachment();
        void addAttachmentChild(int child_id);
        void removeAttachmentChild(int child_id);
        const std::unordered_set<int> &getAttachmentChildIds();
+       ServerActiveObject *getParent() const;
        ObjectProperties* accessObjectProperties();
        void notifyObjectPropertiesModified();
 protected:
        s16 m_hp = -1;
-       float m_yaw = 0.0f;
+
+       v3f m_rotation;
 
        bool m_properties_sent = true;
-       struct ObjectProperties m_prop;
+       ObjectProperties m_prop;
 
        ItemGroupList m_armor_groups;
        bool m_armor_groups_sent = false;
@@ -72,7 +79,7 @@ protected:
        float m_animation_blend = 0.0f;
        bool m_animation_loop = true;
        bool m_animation_sent = false;
-        bool m_animation_speed_sent = false;
+       bool m_animation_speed_sent = false;
 
        // Stores position and rotation for each bone name
        std::unordered_map<std::string, core::vector2d<v3f>> m_bone_position;
@@ -84,6 +91,9 @@ protected:
        v3f m_attachment_position;
        v3f m_attachment_rotation;
        bool m_attachment_sent = false;
+private:
+       void onAttach(int parent_id);
+       void onDetach(int parent_id);
 };
 
 /*
@@ -148,9 +158,9 @@ private:
        v3f m_velocity;
        v3f m_acceleration;
 
-       float m_last_sent_yaw = 0.0f;
        v3f m_last_sent_position;
        v3f m_last_sent_velocity;
+       v3f m_last_sent_rotation;
        float m_last_sent_position_timer = 0.0f;
        float m_last_sent_move_precision = 0.0f;
        std::string m_current_texture_modifier = "";
@@ -224,16 +234,16 @@ public:
        void setBasePosition(const v3f &position);
        void setPos(const v3f &pos);
        void moveTo(v3f pos, bool continuous);
-       void setYaw(const float yaw);
+       void setPlayerYaw(const float yaw);
        // Data should not be sent at player initialization
-       void setYawAndSend(const float yaw);
-       void setPitch(const float pitch);
+       void setPlayerYawAndSend(const float yaw);
+       void setLookPitch(const float pitch);
        // Data should not be sent at player initialization
-       void setPitchAndSend(const float pitch);
-       f32 getPitch() const { return m_pitch; }
-       f32 getRadPitch() const { return m_pitch * core::DEGTORAD; }
+       void setLookPitchAndSend(const float pitch);
+       f32 getLookPitch() const { return m_pitch; }
+       f32 getRadLookPitch() const { return m_pitch * core::DEGTORAD; }
        // Deprecated
-       f32 getRadPitchDep() const { return -1.0 * m_pitch * core::DEGTORAD; }
+       f32 getRadLookPitchDep() const { return -1.0 * m_pitch * core::DEGTORAD; }
        void setFov(const float pitch);
        f32 getFov() const { return m_fov; }
        void setWantedRange(const s16 range);
@@ -330,6 +340,7 @@ public:
 
        v3f getEyePosition() const { return m_base_position + getEyeOffset(); }
        v3f getEyeOffset() const;
+       float getZoomFOV() const;
 
        inline Metadata &getMeta() { return m_meta; }