mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Add player:set_sky() with simple skybox support
This commit is contained in:
parent
e258675eab
commit
86a6cca3cf
11 changed files with 181 additions and 5 deletions
18
src/sky.h
18
src/sky.h
|
@ -53,12 +53,22 @@ public:
|
|||
float direct_brightness, bool sunlight_seen);
|
||||
|
||||
float getBrightness(){ return m_brightness; }
|
||||
video::SColor getBgColor(){ return m_bgcolor; }
|
||||
video::SColor getSkyColor(){ return m_skycolor; }
|
||||
|
||||
video::SColor getBgColor(){
|
||||
return m_visible ? m_bgcolor : m_fallback_bg_color;
|
||||
}
|
||||
video::SColor getSkyColor(){
|
||||
return m_visible ? m_skycolor : m_fallback_bg_color;
|
||||
}
|
||||
|
||||
bool getCloudsVisible(){ return m_clouds_visible; }
|
||||
bool getCloudsVisible(){ return m_clouds_visible && m_visible; }
|
||||
video::SColorf getCloudColor(){ return m_cloudcolor_f; }
|
||||
|
||||
void setVisible(bool visible){ m_visible = visible; }
|
||||
void setFallbackBgColor(const video::SColor &fallback_bg_color){
|
||||
m_fallback_bg_color = fallback_bg_color;
|
||||
}
|
||||
|
||||
private:
|
||||
core::aabbox3d<f32> Box;
|
||||
video::SMaterial m_materials[SKY_MATERIAL_COUNT];
|
||||
|
@ -98,6 +108,8 @@ private:
|
|||
return result;
|
||||
}
|
||||
|
||||
bool m_visible;
|
||||
video::SColor m_fallback_bg_color; // Used when m_visible=false
|
||||
bool m_first_update;
|
||||
float m_time_of_day;
|
||||
float m_time_brightness;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue