#include "irrlichttypes_extrabloated.h"
#include <ISceneNode.h>
-#include "localplayer.h"
+#include "camera.h"
#ifndef SKY_HEADER
#define SKY_HEADER
-#define SKY_MATERIAL_COUNT 3
+#define SKY_MATERIAL_COUNT 5
#define SKY_STAR_COUNT 200
+class ITextureSource;
+
// Skybox, rendered with zbuffer turned off, before all other nodes.
class Sky : public scene::ISceneNode
{
public:
//! constructor
- Sky(scene::ISceneNode* parent, scene::ISceneManager* mgr, s32 id, LocalPlayer* player);
+ Sky(scene::ISceneNode* parent, scene::ISceneManager* mgr, s32 id,
+ ITextureSource *tsrc);
virtual void OnRegisterSceneNode();
{ return SKY_MATERIAL_COUNT; }
void update(float m_time_of_day, float time_brightness,
- float direct_brightness, bool sunlight_seen);
+ float direct_brightness, bool sunlight_seen, CameraMode cam_mode,
+ float yaw, float pitch);
float getBrightness(){ return m_brightness; }
{
if (!m_sunlight_seen)
return 0;
- float x; m_time_of_day >= 0.5 ? x = (1 - m_time_of_day) * 2 : x = m_time_of_day * 2;
+ float x = m_time_of_day >= 0.5 ? (1 - m_time_of_day) * 2 : m_time_of_day * 2;
+
if (x <= 0.3)
return 0;
if (x <= 0.4) // when the sun and moon are aligned
video::SColorf m_cloudcolor_f;
v3f m_stars[SKY_STAR_COUNT];
video::S3DVertex m_star_vertices[SKY_STAR_COUNT*4];
- LocalPlayer* m_player;
+ video::ITexture* m_sun_texture;
+ video::ITexture* m_moon_texture;
+ video::ITexture* m_sun_tonemap;
+ video::ITexture* m_moon_tonemap;
};
#endif