3 Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
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 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser 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.
23 #include "irrlichttypes_extrabloated.h"
25 #include "constants.h"
26 #include "cloudparams.h"
30 extern Clouds *g_menuclouds;
32 // Scene manager used for menu clouds
33 namespace irr{namespace scene{class ISceneManager;}}
34 extern irr::scene::ISceneManager *g_menucloudsmgr;
36 class Clouds : public scene::ISceneNode
39 Clouds(scene::ISceneManager* mgr,
51 virtual void OnRegisterSceneNode();
53 virtual void render();
55 virtual const aabb3f &getBoundingBox() const
60 virtual u32 getMaterialCount() const
65 virtual video::SMaterial& getMaterial(u32 i)
74 void step(float dtime);
76 void update(v2f camera_p, video::SColorf color);
78 void updateCameraOffset(v3s16 camera_offset)
80 m_camera_offset = camera_offset;
86 void setDensity(float density)
88 m_params.density = density;
89 // currently does not need bounding
92 void setColorBright(const video::SColor &color_bright)
94 m_params.color_bright = color_bright;
97 void setColorAmbient(const video::SColor &color_ambient)
99 m_params.color_ambient = color_ambient;
102 void setHeight(float height)
104 m_params.height = height; // add bounding when necessary
108 void setSpeed(v2f speed)
110 m_params.speed = speed;
113 void setThickness(float thickness)
115 m_params.thickness = thickness;
122 float height_bs = m_params.height * BS;
123 float thickness_bs = m_params.thickness * BS;
124 m_box = aabb3f(-BS * 1000000.0f, height_bs - BS * m_camera_offset.Y, -BS * 1000000.0f,
125 BS * 1000000.0f, height_bs + thickness_bs - BS * m_camera_offset.Y, BS * 1000000.0f);
128 video::SMaterial m_material;
130 s16 m_passed_cloud_y;
131 u16 m_cloud_radius_i;
136 v3s16 m_camera_offset;
137 video::SColorf m_color = video::SColorf(1.0f, 1.0f, 1.0f, 1.0f);
138 CloudParams m_params;