]> git.lizzy.rs Git - minetest.git/blob - src/farmesh.h
Added an experimental "far view" thing. Doesn't work exactly like it should and not...
[minetest.git] / src / farmesh.h
1 /*
2 Part of Minetest-c55
3 Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #ifndef FARMESH_HEADER
21 #define FARMESH_HEADER
22
23 /*
24         A quick messy implementation of terrain rendering for a long
25         distance according to map seed
26 */
27
28 #include "common_irrlicht.h"
29
30 class FarMesh : public scene::ISceneNode
31 {
32 public:
33         FarMesh(
34                         scene::ISceneNode* parent,
35                         scene::ISceneManager* mgr,
36                         s32 id,
37                         u64 seed
38         );
39
40         ~FarMesh();
41
42         /*
43                 ISceneNode methods
44         */
45
46         virtual void OnRegisterSceneNode();
47
48         virtual void render();
49         
50         virtual const core::aabbox3d<f32>& getBoundingBox() const
51         {
52                 return m_box;
53         }
54
55         virtual u32 getMaterialCount() const
56         {
57                 return 1;
58         }
59
60         virtual video::SMaterial& getMaterial(u32 i)
61         {
62                 return m_material;
63         }
64         
65         /*
66                 Other stuff
67         */
68
69         void step(float dtime);
70
71         void update(v2f camera_p, float brightness);
72
73 private:
74         video::SMaterial m_material;
75         core::aabbox3d<f32> m_box;
76         float m_cloud_y;
77         float m_brightness;
78         u32 m_seed;
79         v2f m_camera_pos;
80         float m_time;
81 };
82
83 #endif
84