Noise: Prevent unittest crash caused by division by zero
[oweals/minetest.git] / src / camera.h
index 8d213ede7dbe238e90368063eaf56146868542a4..620e316de676c0c75c8451b29bbfc313daf63640 100644 (file)
@@ -60,8 +60,7 @@ enum CameraMode {CAMERA_MODE_FIRST, CAMERA_MODE_THIRD, CAMERA_MODE_THIRD_FRONT};
 class Camera
 {
 public:
-       Camera(scene::ISceneManager* smgr, MapDrawControl& draw_control,
-                       Client *client);
+       Camera(MapDrawControl &draw_control, Client *client);
        ~Camera();
 
        // Get camera scene node.
@@ -166,6 +165,8 @@ public:
 
        void drawNametags();
 
+       inline void addArmInertia(f32 player_yaw);
+
 private:
        // Nodes
        scene::ISceneNode *m_playernode = nullptr;
@@ -179,7 +180,6 @@ private:
        MapDrawControl& m_draw_control;
 
        Client *m_client;
-       video::IVideoDriver *m_driver;
 
        // Absolute camera position
        v3f m_camera_position;
@@ -188,6 +188,12 @@ private:
        // Camera offset
        v3s16 m_camera_offset;
 
+       v2f m_wieldmesh_offset = v2f(55.0f, -35.0f);
+       v2f m_arm_dir;
+       v2f m_cam_vel;
+       v2f m_cam_vel_old;
+       v2f m_last_cam_pos;
+
        // Field of view and aspect ratio stuff
        f32 m_aspect = 1.0f;
        f32 m_fov_x = 1.0f;
@@ -221,6 +227,7 @@ private:
        f32 m_cache_view_bobbing_amount;
        f32 m_cache_fov;
        f32 m_cache_zoom_fov;
+       bool m_arm_inertia;
 
        std::list<Nametag *> m_nametags;
 };