1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-12 16:15:20 +02: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

@@ -314,7 +314,7 @@ GUIEngine::~GUIEngine()
void GUIEngine::cloudInit()
{
m_cloud.clouds = new Clouds(m_smgr, -1, rand(), 100);
m_cloud.clouds->update(v2f(0, 0), video::SColor(255,200,200,255));
m_cloud.clouds->update(v3f(0, 0, 0), video::SColor(255,200,200,255));
m_cloud.camera = m_smgr->addCameraSceneNode(0,
v3f(0,0,0), v3f(0, 60, 100));