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
40 scene::ISceneNode* parent,
41 scene::ISceneManager* mgr,
53 virtual void OnRegisterSceneNode();
55 virtual void render();
57 virtual const aabb3f &getBoundingBox() const
62 virtual u32 getMaterialCount() const
67 virtual video::SMaterial& getMaterial(u32 i)
76 void step(float dtime);
78 void update(v2f camera_p, video::SColorf color);
80 void updateCameraOffset(v3s16 camera_offset)
82 m_camera_offset = camera_offset;
88 void setDensity(float density)
90 m_params.density = density;
91 // currently does not need bounding
94 void setColorBright(const video::SColor &color_bright)
96 m_params.color_bright = color_bright;
99 void setColorAmbient(const video::SColor &color_ambient)
101 m_params.color_ambient = color_ambient;
104 void setHeight(float height)
106 m_params.height = height; // add bounding when necessary
110 void setSpeed(v2f speed)
112 m_params.speed = speed;
115 void setThickness(float thickness)
117 m_params.thickness = thickness;
124 float height_bs = m_params.height * BS;
125 float thickness_bs = m_params.thickness * BS;
126 m_box = aabb3f(-BS * 1000000.0f, height_bs - BS * m_camera_offset.Y, -BS * 1000000.0f,
127 BS * 1000000.0f, height_bs + thickness_bs - BS * m_camera_offset.Y, BS * 1000000.0f);
130 video::SMaterial m_material;
132 s16 m_passed_cloud_y;
133 u16 m_cloud_radius_i;
139 v3s16 m_camera_offset;
140 video::SColorf m_color;
141 CloudParams m_params;