]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/clouds.h
Fix occlusing counting (#4922)
[dragonfireclient.git] / src / clouds.h
index 72923c2c5e9e19e3f0967039c4a984bbd2f31c03..9c6b417866cafd8546164f194f5f1a6b271e80dc 100644 (file)
@@ -22,6 +22,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #include "irrlichttypes_extrabloated.h"
 #include <iostream>
+#include "constants.h"
+
+// Menu clouds
+class Clouds;
+extern Clouds *g_menuclouds;
+
+// Scene manager used for menu clouds
+namespace irr{namespace scene{class ISceneManager;}}
+extern irr::scene::ISceneManager *g_menucloudsmgr;
 
 class Clouds : public scene::ISceneNode
 {
@@ -30,7 +39,8 @@ class Clouds : public scene::ISceneNode
                        scene::ISceneNode* parent,
                        scene::ISceneManager* mgr,
                        s32 id,
-                       u32 seed
+                       u32 seed,
+                       s16 cloudheight=0
        );
 
        ~Clouds();
@@ -43,7 +53,7 @@ class Clouds : public scene::ISceneNode
 
        virtual void render();
        
-       virtual const core::aabbox3d<f32>& getBoundingBox() const
+       virtual const aabb3f &getBoundingBox() const
        {
                return m_box;
        }
@@ -65,16 +75,28 @@ class Clouds : public scene::ISceneNode
        void step(float dtime);
 
        void update(v2f camera_p, video::SColorf color);
+       
+       void updateCameraOffset(v3s16 camera_offset)
+       {
+               m_camera_offset = camera_offset;
+               m_box = aabb3f(-BS * 1000000, m_cloud_y - BS - BS * camera_offset.Y, -BS * 1000000,
+                       BS * 1000000, m_cloud_y + BS - BS * camera_offset.Y, BS * 1000000);
+       }
+
+       void readSettings();
 
 private:
        video::SMaterial m_material;
-       core::aabbox3d<f32> m_box;
+       aabb3f m_box;
+       s16 m_passed_cloud_y;
        float m_cloud_y;
-       float m_brightness;
+       u16 m_cloud_radius_i;
+       bool m_enable_3d;
        video::SColorf m_color;
        u32 m_seed;
        v2f m_camera_pos;
        float m_time;
+       v3s16 m_camera_offset;
 };