1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Fog effect when camera is inside cloud

Fixes issue #3576

* Clouds now take camera position as 3D, not 2D

* Cloud grid filling extracted to gridFilled method

* Clouds detect whether camera is inside cloud

* Camera in cloud changes fog by overriding sky colors
  with cloud color

* Sun, moon and stars can be temporarily disabled
  with setBodiesVisible

* Disabling fog also disables all "inside cloud" behaviors
This commit is contained in:
Ben Deutsch 2017-05-07 18:41:47 +02:00 committed by SmallJoker
parent 61a3de42fd
commit 6bedb6de40
7 changed files with 84 additions and 30 deletions

View file

@ -129,7 +129,7 @@ bool ClientLauncher::run(GameParams &game_params, const Settings &cmd_args)
g_menucloudsmgr = RenderingEngine::get_scene_manager()->createNewSceneManager();
if (!g_menuclouds)
g_menuclouds = new Clouds(g_menucloudsmgr, -1, rand(), 100);
g_menuclouds->update(v2f(0, 0), video::SColor(255, 200, 200, 255));
g_menuclouds->update(v3f(0, 0, 0), video::SColor(255, 200, 200, 255));
scene::ICameraSceneNode* camera;
camera = g_menucloudsmgr->addCameraSceneNode(0,
v3f(0, 0, 0), v3f(0, 60, 100));