ofs | hex dump | ascii |
---|
0000 | 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 01 00 00 00 01 00 08 06 00 00 00 5c 72 a8 | .PNG........IHDR.............\r. |
0020 | 66 00 00 00 06 62 4b 47 44 00 ff 00 ff 00 ff a0 bd a7 93 00 00 00 09 70 48 59 73 00 00 0e c3 00 | f....bKGD..............pHYs..... |
0040 | 00 0e c3 01 c7 6f a8 64 00 00 00 07 74 49 4d 45 07 e0 06 09 13 13 34 76 e3 a3 06 00 00 20 00 49 | .....o.d....tIME......4v.......I |
0060 | 44 41 54 78 da ec bd 69 94 5d e7 59 26 fa 7c d3 9e ce 50 55 a7 06 cd 52 55 69 b4 64 c9 83 64 9b | DATx...i.].Y&.|...PU...RUi.d..d. |
0080 | 28 b6 93 38 b1 89 21 40 47 31 61 c8 8d 3b ac 40 e8 0b 84 6e ba ef 5d b9 eb 76 37 69 58 ac 06 3a | (..8..!@G1a..;.@...n..]..v7iX..: |
00a0 | ac 6e 20 74 26 9a d0 04 72 49 c7 40 80 0c 24 74 4c 70 70 06 0f b2 3c c4 92 27 a9 4a b6 64 4b aa | .n.t&...rI.@..$tLpp...<..'.J.dK. |
00c0 | e1 9c aa 3a 67 9f bd f7 37 dd 1f fb 7c bb 4e 95 25 8f 72 82 9d fd 7a 9d 55 52 e9 c8 a5 b3 f7 7e | ...:g...7...|.N.%.r...z.UR.....~ |
00e0 | de ef 1d 9e f7 79 81 d2 4a 2b ad b4 d2 4a 2b ad b4 d2 4a 2b ad b4 d2 4a 2b ad b4 d2 4a 2b ad b4 | .....y..J+...J+...J+...J+...J+.. |
0100 | d2 4a 2b ad b4 d2 4a 2b ad b4 d2 4a 2b ad b4 d2 4a 2b ad b4 d2 4a 2b ad b4 d2 4a 2b ad b4 d2 4a | .J+...J+...J+...J+...J+...J+...J |
0120 | 2b ad b4 d2 5e 8b 46 ae be fa 6a 5e 5e 86 d7 d8 4d 2d 2f 41 69 2f c0 d8 35 d7 5c 3e e9 79 d1 a5 | +...^.F...j^^...M-/Ai/..5.\>.y.. |
0140 | 46 9a 6f 49 63 e6 00 d0 bb ef be 3b 2d 2f cd ab fc c6 96 97 a0 b4 e7 7b 46 ae be fc f2 9d dc 0f | F.oIc......;-/.........{F....... |
0160 | 7e c2 5a fc 58 26 b3 ab bb ed ce 91 28 0c 3b 63 f5 3a 7f 66 66 46 97 97 a8 74 00 a5 bd 46 9f 8f | ~.Z.X&......(.;c.:.ffF...t...F.. |
0180 | bd 7b 77 6e f3 7c ef 1d 20 f8 f1 2c 53 7b b2 2c 1b a3 8c 6f 27 94 de d5 4d d3 85 91 d1 51 6f 76 | .{wn.|.....,S{.,...o'...M....Qov |
01a0 | 76 b6 74 02 a5 03 28 ed b5 f6 6c ec dc b9 73 9b e7 89 43 20 e4 1d 4a 99 5d 52 ea 0a a5 2c ac 54 | v.t...(...l...s...C...J.]R...,.T |
01c0 | 2a 83 61 18 ee 18 1e 19 b9 c7 18 d3 de bc 79 73 78 ea d4 29 05 c0 96 97 ad 74 00 a5 bd 16 c0 3f | *.a...........ysx..).....t.....? |
01e0 | 3e be 4d 84 fe 21 4a c8 2d c6 d8 dd c6 20 e0 5c 90 28 8a 58 18 86 61 14 45 83 8d 46 63 fb e6 cd | >.M..!J.-......\.(.X..a.E..Fc... |
0200 | 9b 0f 67 59 46 f6 ed db 17 1d 3b 76 ac 5b 3a 81 d2 01 94 f6 2a 7f 26 c6 c7 c/*
Minetest
Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
#include "irrlichttypes_extrabloated.h"
#include <iostream>
#include "constants.h"
#include "cloudparams.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
{
public:
Clouds(scene::ISceneManager* mgr,
s32 id,
u32 seed
);
~Clouds();
/*
ISceneNode methods
*/
virtual void OnRegisterSceneNode();
virtual void render();
virtual const aabb3f &getBoundingBox() const
{
return m_box;
}
virtual u32 getMaterialCount() const
{
return 1;
}
virtual video::SMaterial& getMaterial(u32 i)
{
return m_material;
}
/*
Other stuff
*/
void step(float dtime);
void update(const v3f &camera_p, const video::SColorf &color);
void updateCameraOffset(const v3s16 &camera_offset)
{
m_camera_offset = camera_offset;
updateBox();
}
void readSettings();
void setDensity(float density)
{
m_params.density = density;
// currently does not need bounding
}
void setColorBright(const video::SColor &color_bright)
{
m_params.color_bright = color_bright;
}
void setColorAmbient(const video::SColor &color_ambient)
{
m_params.color_ambient = color_ambient;
}
void setHeight(float height)
{
m_params.height = height; // add bounding when necessary
updateBox();
}
void setSpeed(v2f speed)
{
m_params.speed = speed;
}
void setThickness(float thickness)
{
m_params.thickness = thickness;
updateBox();
}
bool isCameraInsideCloud() const { return m_camera_inside_cloud; }
const video::SColor getColor() const { return m_color.toSColor(); }
private:
void updateBox()
{
float height_bs = m_params.height * BS;
float thickness_bs = m_params.thickness * BS;
m_box = aabb3f(-BS * 1000000.0f, height_bs - BS * m_camera_offset.Y, -BS * 1000000.0f,
BS * 1000000.0f, height_bs + thickness_bs - BS * m_camera_offset.Y, BS * 1000000.0f);
}
bool gridFilled(int x, int y) const;
video::SMaterial m_material;
aabb3f m_box;
u16 m_cloud_radius_i;
bool m_enable_3d;
u32 m_seed;
v3f m_camera_pos;
v2f m_origin;
v3s16 m_camera_offset;
video::SColorf m_color = video::SColorf(1.0f, 1.0f, 1.0f, 1.0f);
CloudParams m_params;
bool m_camera_inside_cloud = false;
};
|