Loading...
Searching...
No Matches
Gfx::CCloud Class Reference

Cloud layer renderer. More...

`#include <src/graphics/engine/cloud.h>`

## Classes

struct | CloudLine
| Cloud strip. More...

## Public Member Functions

| CCloud (CEngine *engine)
bool | EventProcess (const Event &event)
void | Flush ()
| Removes all the clouds.
void | Create (const std::string &fileName, const Color &diffuse, const Color &ambient, float level)
| Creates all areas of cloud.
void | Draw ()
| Draw the clouds.
void | SetLevel (float level)
| Management of cloud level.
float | GetLevel ()
void | SetEnabled (bool enabled)
| Management of clouds.
bool | GetEnabled ()

## Protected Member Functions

bool | EventFrame (const Event &event)
| Makes the clouds evolve.
void | AdjustLevel (Math::Vector &pos, Math::Vector &eye, float deep, Math::Point &uv1, Math::Point &uv2)
| Adjusts the position to normal, to imitate the clouds at movement.
void | CreateLine (int x, int y, int len)
| Updates the positions, relative to the ground.

## Protected Attributes

CEngine * | m_engine = nullptr
CTerrain * | m_terrain = nullptr
bool | m_enabled = true
float | m_level = 0.0f
| Overall level.
std::string | m_fileName
| Texture.
Math::Point | m_speed
| Feedrate (wind).
Color | m_diffuse
| Diffuse color.
Color | m_ambient
| Ambient color.
float | m_time = 0.0f
float | m_lastTest = 0.0f
int | m_subdiv = 8
Math::Vector | m_wind
| Wind speed.
int | m_brickCount = 0
| Brick mosaic.
float | m_brickSize = 0
| Size of a brick element.
std::vector< CloudLine > | m_lines

## Detailed Description

Cloud layer renderer.

Renders the cloud layer as fog. Cloud layer is similar to water layer

- it occurs only at specified level of terrain. Cloud map is created the same way water is created. CloudLine structs are used to specify lines in X direction in XY terrain coordinates.

## Member Function Documentation

## Flush()

void Gfx::CCloud::Flush | ( |  | ) |

Removes all the clouds.

## Create()

void Gfx::CCloud::Create | ( | const std::string & | fileName,
|  | const Color & | diffuse,
|  | const Color & | ambient,
|  | float | level )

Creates all areas of cloud.

## Draw()

void Gfx::CCloud::Draw | ( |  | ) |

Draw the clouds.

## SetLevel()

void Gfx::CCloud::SetLevel | ( | float | level | ) |

Management of cloud level.

## SetEnabled()

void Gfx::CCloud::SetEnabled | ( | bool | enabled | ) |

Management of clouds.

## EventFrame()

bool Gfx::CCloud::EventFrame | ( | const Event & | event | ) |

protected

Makes the clouds evolve.

## AdjustLevel()

void Gfx::CCloud::AdjustLevel | ( | Math::Vector & | pos,
|  | Math::Vector & | eye,
|  | float | deep,
|  | Math::Point & | uv1,
|  | Math::Point & | uv2 )

protected

Adjusts the position to normal, to imitate the clouds at movement.

## CreateLine()

void Gfx::CCloud::CreateLine | ( | int | x,
|  | int | y,
|  | int | len )

protected

Updates the positions, relative to the ground.

## Member Data Documentation

## m_level

float Gfx::CCloud::m_level = 0.0f

protected

Overall level.

## m_fileName

std::string Gfx::CCloud::m_fileName

protected

Texture.

## m_speed

Math::Point Gfx::CCloud::m_speed

protected

Feedrate (wind).

## m_diffuse

Color Gfx::CCloud::m_diffuse

protected

Diffuse color.

## m_ambient

Color Gfx::CCloud::m_ambient

protected

Ambient color.

## m_wind

Math::Vector Gfx::CCloud::m_wind

protected

Wind speed.

## m_brickCount

int Gfx::CCloud::m_brickCount = 0

protected

Brick mosaic.

## m_brickSize

float Gfx::CCloud::m_brickSize = 0

protected

Size of a brick element.

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

- src/graphics/engine/cloud.h
- src/graphics/engine/cloud.cpp