Minetest  5.4.0
Clouds Class Reference

#include <clouds.h>

+ Inheritance diagram for Clouds:
+ Collaboration diagram for Clouds:

Public Member Functions

 Clouds (scene::ISceneManager *mgr, s32 id, u32 seed)
 
 ~Clouds ()
 
virtual void OnRegisterSceneNode ()
 
virtual void render ()
 
virtual const aabb3fgetBoundingBox () const
 
virtual u32 getMaterialCount () const
 
virtual video::SMaterial & getMaterial (u32 i)
 
void step (float dtime)
 
void update (const v3f &camera_p, const video::SColorf &color)
 
void updateCameraOffset (const v3s16 &camera_offset)
 
void readSettings ()
 
void setDensity (float density)
 
void setColorBright (const video::SColor &color_bright)
 
void setColorAmbient (const video::SColor &color_ambient)
 
void setHeight (float height)
 
void setSpeed (v2f speed)
 
void setThickness (float thickness)
 
bool isCameraInsideCloud () const
 
const video::SColor getColor () const
 

Private Member Functions

void updateBox ()
 
bool gridFilled (int x, int y) const
 

Private Attributes

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
 

Constructor & Destructor Documentation

◆ Clouds()

Clouds::Clouds ( scene::ISceneManager *  mgr,
s32  id,
u32  seed 
)

References cloud_3d_setting_changed(), CloudParams::color_ambient, CloudParams::color_bright, CloudParams::density, g_settings, CloudParams::height, m_material, m_params, readSettings(), Settings::registerChangedCallback(), CloudParams::speed, CloudParams::thickness, and updateBox().

+ Here is the call graph for this function:

◆ ~Clouds()

Clouds::~Clouds ( )

References cloud_3d_setting_changed(), Settings::deregisterChangedCallback(), and g_settings.

+ Here is the call graph for this function:

Member Function Documentation

◆ getBoundingBox()

virtual const aabb3f& Clouds::getBoundingBox ( ) const
inlinevirtual

References m_box.

◆ getColor()

const video::SColor Clouds::getColor ( ) const
inline

References m_color.

Referenced by Game::updateFrame().

+ Here is the caller graph for this function:

◆ getMaterial()

virtual video::SMaterial& Clouds::getMaterial ( u32  i)
inlinevirtual

References m_material.

◆ getMaterialCount()

virtual u32 Clouds::getMaterialCount ( ) const
inlinevirtual

◆ gridFilled()

bool Clouds::gridFilled ( int  x,
int  y 
) const
private

References BS, cloud_size, CloudParams::density, m_params, m_seed, and noise2d_perlin().

Referenced by render(), and update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isCameraInsideCloud()

bool Clouds::isCameraInsideCloud ( ) const
inline

References m_camera_inside_cloud.

Referenced by Game::updateFrame().

+ Here is the caller graph for this function:

◆ OnRegisterSceneNode()

void Clouds::OnRegisterSceneNode ( )
virtual

◆ readSettings()

void Clouds::readSettings ( )

References g_settings, Settings::getBool(), Settings::getU16(), m_cloud_radius_i, and m_enable_3d.

Referenced by Clouds().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ render()

void Clouds::render ( )
virtual

References BS, cloud_size, CloudParams::density, g_profiler, GETINDEX, gridFilled(), CloudParams::height, INAREA, intToFloat(), m_camera_offset, m_camera_pos, m_cloud_radius_i, m_color, m_enable_3d, m_material, m_origin, m_params, SPT_AVG, and CloudParams::thickness.

Referenced by RenderingEngine::_draw_load_screen(), RenderingEngine::_draw_menu_scene(), and GUIEngine::cloudPreProcess().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setColorAmbient()

void Clouds::setColorAmbient ( const video::SColor &  color_ambient)
inline

References CloudParams::color_ambient, and m_params.

Referenced by Game::handleClientEvent_CloudParams().

+ Here is the caller graph for this function:

◆ setColorBright()

void Clouds::setColorBright ( const video::SColor &  color_bright)
inline

References CloudParams::color_bright, and m_params.

Referenced by Game::handleClientEvent_CloudParams().

+ Here is the caller graph for this function:

◆ setDensity()

void Clouds::setDensity ( float  density)
inline

References CloudParams::density, and m_params.

Referenced by Game::handleClientEvent_CloudParams().

+ Here is the caller graph for this function:

◆ setHeight()

void Clouds::setHeight ( float  height)
inline

References CloudParams::height, m_params, and updateBox().

Referenced by GUIEngine::cloudInit(), Game::handleClientEvent_CloudParams(), and ClientLauncher::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSpeed()

void Clouds::setSpeed ( v2f  speed)
inline

References m_params, and CloudParams::speed.

Referenced by Game::handleClientEvent_CloudParams().

+ Here is the caller graph for this function:

◆ setThickness()

void Clouds::setThickness ( float  thickness)
inline

References m_params, CloudParams::thickness, and updateBox().

Referenced by Game::handleClientEvent_CloudParams().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ step()

void Clouds::step ( float  dtime)

References BS, m_origin, m_params, and CloudParams::speed.

Referenced by RenderingEngine::_draw_load_screen(), RenderingEngine::_draw_menu_scene(), GUIEngine::cloudPreProcess(), and Game::updateFrame().

+ Here is the caller graph for this function:

◆ update()

void Clouds::update ( const v3f camera_p,
const video::SColorf &  color 
)

References cloud_size, CloudParams::color_ambient, CloudParams::color_bright, gridFilled(), m_box, m_camera_inside_cloud, m_camera_pos, m_color, m_enable_3d, m_origin, and m_params.

Referenced by GUIEngine::cloudInit(), ClientLauncher::run(), and Game::updateFrame().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateBox()

void Clouds::updateBox ( )
inlineprivate

References BS, CloudParams::height, m_box, m_camera_offset, m_params, and CloudParams::thickness.

Referenced by Clouds(), setHeight(), setThickness(), and updateCameraOffset().

+ Here is the caller graph for this function:

◆ updateCameraOffset()

void Clouds::updateCameraOffset ( const v3s16 camera_offset)
inline

References m_camera_offset, and updateBox().

Referenced by Game::updateCamera().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_box

aabb3f Clouds::m_box
private

Referenced by getBoundingBox(), update(), and updateBox().

◆ m_camera_inside_cloud

bool Clouds::m_camera_inside_cloud = false
private

Referenced by isCameraInsideCloud(), and update().

◆ m_camera_offset

v3s16 Clouds::m_camera_offset
private

◆ m_camera_pos

v3f Clouds::m_camera_pos
private

Referenced by render(), and update().

◆ m_cloud_radius_i

u16 Clouds::m_cloud_radius_i
private

Referenced by readSettings(), and render().

◆ m_color

video::SColorf Clouds::m_color = video::SColorf(1.0f, 1.0f, 1.0f, 1.0f)
private

Referenced by getColor(), render(), and update().

◆ m_enable_3d

bool Clouds::m_enable_3d
private

Referenced by readSettings(), render(), and update().

◆ m_material

video::SMaterial Clouds::m_material
private

Referenced by Clouds(), getMaterial(), and render().

◆ m_origin

v2f Clouds::m_origin
private

Referenced by render(), step(), and update().

◆ m_params

◆ m_seed

u32 Clouds::m_seed
private

Referenced by gridFilled().


The documentation for this class was generated from the following files: