Luanti 5.16.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 {{0.0f, 0.0f, 0.0f}}
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_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 )

References cloud_3d_setting_changed(), g_settings, SkyboxDefaults::getCloudDefaults(), IShaderSource::getShaderInfo(), IShaderSource::getShaderRaw(), m_material, m_meshbuffer, m_params, m_seed, ShaderInfo::material, readSettings(), and updateBox().

Here is the call graph for this function:

◆ ~Clouds()

Clouds::~Clouds ( )

References g_settings.

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, m_params, m_seed, noise2d_fractal(), x, and y.

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, and m_params.

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, invalidateMesh(), m_cloud_radius_i, m_enable_3d, and rangelim().

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, FOG_RANGE_ALL, intToFloat(), is3D(), m_box, m_camera_offset, m_cloud_radius_i, m_color, 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

References m_params.

◆ setColorBright()

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

References m_params.

◆ setColorShadow()

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

References invalidateMesh(), and m_params.

Here is the call graph for this function:

◆ setDensity()

void Clouds::setDensity ( float density)
inline

References invalidateMesh(), and m_params.

Here is the call graph for this function:

◆ setHeight()

void Clouds::setHeight ( float height)
inline

References invalidateMesh(), m_params, and updateBox().

Here is the call graph for this function:

◆ setSpeed()

void Clouds::setSpeed ( v2f speed)
inline

References m_params.

◆ setThickness()

void Clouds::setThickness ( float thickness)
inline

References invalidateMesh(), m_params, and updateBox().

Here is the call graph for this function:

◆ step()

void Clouds::step ( float dtime)

References BS, m_origin, and m_params.

◆ update()

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

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

Here is the call graph for this function:

◆ updateBox()

void Clouds::updateBox ( )
inlineprivate

References BS, m_box, m_camera_offset, and m_params.

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, g_settings, GETINDEX, gridFilled(), INAREA, is3D(), m_camera_pos, m_cloud_radius_i, m_last_noise_center, m_mesh_origin, m_mesh_valid, m_meshbuffer, m_origin, m_params, 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 {{0.0f, 0.0f, 0.0f}}
private

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

◆ m_enable_3d

bool Clouds::m_enable_3d
private

Referenced by is3D(), and readSettings().

◆ 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 Clouds(), and gridFilled().


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