Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
Clouds Class Reference

#include <clouds.h>

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

Public Member Functions

 Clouds (scene::ISceneManager *mgr, IShaderSource *ssrc, 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 (v3s16 camera_offset)
 
void readSettings ()
 
void setDensity (float density)
 
void setColorBright (video::SColor color_bright)
 
void setColorAmbient (video::SColor color_ambient)
 
void setColorShadow (video::SColor color_shadow)
 
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 ()
 
void updateMesh ()
 
void invalidateMesh ()
 
bool gridFilled (int x, int y) const
 
bool is3D () const
 

Private Attributes

video::SMaterial m_material
 
irr_ptr< scene::SMeshBuffer > m_meshbuffer
 
v2f m_mesh_origin
 
v2s16 m_last_noise_center
 
bool m_mesh_valid = false
 
aabb3f m_box
 
v2f m_origin
 
u16 m_cloud_radius_i
 
u32 m_seed
 
v3f m_camera_pos
 
v3s16 m_camera_offset
 
bool m_camera_inside_cloud = false
 
bool m_enable_shaders
 
bool m_enable_3d
 
video::SColorf m_color = video::SColorf(1.0f, 1.0f, 1.0f, 1.0f)
 
CloudParams m_params
 

Constructor & Destructor Documentation

◆ Clouds()

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

◆ ~Clouds()

Clouds::~Clouds ( )

References Settings::deregisterAllChangedCallbacks(), 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.

◆ 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 update(), and updateMesh().

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

◆ invalidateMesh()

void Clouds::invalidateMesh ( )
inlineprivate

References m_mesh_valid.

Referenced by readSettings(), setColorShadow(), setDensity(), setHeight(), and setThickness().

+ Here is the caller graph for this function:

◆ is3D()

bool Clouds::is3D ( ) const
inlineprivate

References m_enable_3d, m_params, and CloudParams::thickness.

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

+ Here is the caller graph for this function:

◆ isCameraInsideCloud()

bool Clouds::isCameraInsideCloud ( ) const
inline

References m_camera_inside_cloud.

◆ OnRegisterSceneNode()

void Clouds::OnRegisterSceneNode ( )
virtual

◆ readSettings()

void Clouds::readSettings ( )

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

Referenced by Clouds(), and cloud_3d_setting_changed().

+ 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, FOG_RANGE_ALL, intToFloat(), is3D(), m_camera_offset, m_cloud_radius_i, m_color, m_enable_shaders, m_material, m_mesh_origin, m_meshbuffer, m_origin, m_params, and updateMesh().

+ Here is the call graph for this function:

◆ setColorAmbient()

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

◆ setColorBright()

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

◆ setColorShadow()

void Clouds::setColorShadow ( video::SColor color_shadow)
inline

References CloudParams::color_shadow, invalidateMesh(), and m_params.

+ Here is the call graph for this function:

◆ setDensity()

void Clouds::setDensity ( float density)
inline

References CloudParams::density, invalidateMesh(), and m_params.

+ Here is the call graph for this function:

◆ setHeight()

void Clouds::setHeight ( float height)
inline

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

Referenced by 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.

◆ setThickness()

void Clouds::setThickness ( float thickness)
inline

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

+ Here is the call 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(), and GUIEngine::drawClouds().

+ Here is the caller graph for this function:

◆ update()

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

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

Referenced by ClientLauncher::run().

+ 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_params, and CloudParams::thickness.

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

+ Here is the caller graph for this function:

◆ updateCameraOffset()

void Clouds::updateCameraOffset ( v3s16 camera_offset)
inline

References m_camera_offset, and updateBox().

+ Here is the call graph for this function:

◆ updateMesh()

void Clouds::updateMesh ( )
private

References BS, cloud_size, CloudParams::color_shadow, g_profiler, g_settings, Settings::getBool(), GETINDEX, gridFilled(), CloudParams::height, INAREA, is3D(), m_camera_pos, m_cloud_radius_i, m_color, m_enable_shaders, m_last_noise_center, m_mesh_origin, m_mesh_valid, m_meshbuffer, m_origin, m_params, SPT_AVG, CloudParams::thickness, and tracestream.

Referenced by render().

+ 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

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

◆ m_camera_pos

v3f Clouds::m_camera_pos
private

Referenced by update(), and updateMesh().

◆ m_cloud_radius_i

u16 Clouds::m_cloud_radius_i
private

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

◆ m_color

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

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

◆ m_enable_3d

bool Clouds::m_enable_3d
private

Referenced by is3D(), and readSettings().

◆ m_enable_shaders

bool Clouds::m_enable_shaders
private

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

◆ m_last_noise_center

v2s16 Clouds::m_last_noise_center
private

Referenced by updateMesh().

◆ m_material

video::SMaterial Clouds::m_material
private

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

◆ m_mesh_origin

v2f Clouds::m_mesh_origin
private

Referenced by render(), and updateMesh().

◆ m_mesh_valid

bool Clouds::m_mesh_valid = false
private

Referenced by invalidateMesh(), and updateMesh().

◆ m_meshbuffer

irr_ptr<scene::SMeshBuffer> Clouds::m_meshbuffer
private

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

◆ m_origin

v2f Clouds::m_origin
private

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

◆ m_params

◆ m_seed

u32 Clouds::m_seed
private

Referenced by gridFilled().


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