+enum HandIndex { MAINHAND = 0, OFFHAND = 1 };
+
+class WieldNode
+{
+public:
+ WieldNode(HandIndex index, Client *client, scene::ISceneManager *mgr);
+ void step(f32 dtime);
+ void addArmInertia(f32 player_yaw, v3f camera_direction);
+ void update(video::SColor player_light_color, f32 view_bobbing_anim, f32 tool_reload_ratio);
+ void setDigging(s32 button);
+ void wield(const ItemStack &item);
+
+private:
+ HandIndex m_index;
+ int m_direction;
+
+ Client *m_client;
+ WieldMeshSceneNode *m_meshnode = nullptr;
+
+ // Digging animation frame (0 <= m_digging_anim < 1)
+ f32 m_digging_anim = 0.0f;
+
+ // If -1, no digging animation
+ // If 0, left-click digging animation
+ // If 1, right-click digging animation
+ s32 m_digging_button = -1;
+
+ // Animation when changing wielded item
+ f32 m_change_timer = 0.125f;
+ ItemStack m_item_next;
+ bool m_item_old = false;
+
+ // Last known light color of the player
+ video::SColor m_player_light_color;
+
+ // Arm inertia
+ v2f m_offset = v2f(55.0f, -35.0f);
+ v2f m_arm_dir;
+ v2f m_cam_vel;
+ v2f m_cam_vel_old;
+ v2f m_last_cam_pos;
+};
+