nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
nanommo::Sky Class Reference

#include <sky.h>

Public Member Functions

 Sky ()
 ~Sky ()
 Sky (const Sky &)=delete
Sky & operator= (const Sky &)=delete
void Gather (uint32_t seed)
void Draw (const Camera3D &camera, const Atmosphere &atmosphere, float seconds) const
void Shade (Shader shader, const Camera3D &camera, const Atmosphere &atmosphere, float seconds) const

Static Public Attributes

static constexpr int kClouds = 40
 The most clouds a land has, all of them on a cloudy day.
static constexpr int kShadows = 64
static constexpr Vector2 kWind = {2.5f, 1.0f}
 In metres a second, which way the wind blows the clouds.
static constexpr float kSpread = 900.0f

Detailed Description

The sky over a land: its colour from the horizon up, the sun, and low-poly clouds that drift over with the wind, whose shadows drift over the ground beneath them.

Definition at line 16 of file sky.h.

Constructor & Destructor Documentation

◆ Sky() [1/2]

nanommo::Sky::Sky ( )

Definition at line 148 of file sky.cc.

◆ ~Sky()

nanommo::Sky::~Sky ( )

Definition at line 158 of file sky.cc.

◆ Sky() [2/2]

nanommo::Sky::Sky ( const Sky & )
delete

Member Function Documentation

◆ Draw()

void nanommo::Sky::Draw ( const Camera3D & camera,
const Atmosphere & atmosphere,
float seconds ) const

Draws the sky, and the atmosphere's share of the clouds where the wind has blown them by then, around the camera. Inside BeginMode3D, first.

Definition at line 204 of file sky.cc.

◆ Gather()

void nanommo::Sky::Gather ( uint32_t seed)

The land's clouds, from its seed, so that a land's clouds are its own, and the same each time.

Definition at line 165 of file sky.cc.

◆ operator=()

Sky & nanommo::Sky::operator= ( const Sky & )
delete

◆ Shade()

void nanommo::Sky::Shade ( Shader shader,
const Camera3D & camera,
const Atmosphere & atmosphere,
float seconds ) const

Tells the world's shader where the clouds' shadows are: the middle of each of their balls, its height, and how wide its shadow is.

Definition at line 245 of file sky.cc.

Member Data Documentation

◆ kClouds

int nanommo::Sky::kClouds = 40
staticconstexpr

The most clouds a land has, all of them on a cloudy day.

Definition at line 19 of file sky.h.

◆ kShadows

int nanommo::Sky::kShadows = 64
staticconstexpr

The world's shader darkens the ground under this many of the clouds' balls, those nearest to what the camera looks at, as it can't afford all of them for each pixel.

Definition at line 23 of file sky.h.

◆ kSpread

float nanommo::Sky::kSpread = 900.0f
staticconstexpr

The clouds drift through a square this wide, in metres, around the camera, and come back in at the other side when they leave it.

Definition at line 28 of file sky.h.

◆ kWind

Vector2 nanommo::Sky::kWind = {2.5f, 1.0f}
staticconstexpr

In metres a second, which way the wind blows the clouds.

Definition at line 25 of file sky.h.


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