1#ifndef NANOMMO_CLIENT_WEATHER_H_
2#define NANOMMO_CLIENT_WEATHER_H_
11#include "protocol/nanommo.pb.h"
47 void Update(
float seconds,
const protocol::Sky& sky,
bool on,
48 const Camera3D& camera);
52 void Draw(
const Camera3D& camera,
const Atmosphere& atmosphere)
const;
55 float wetness()
const {
return wetness_.value_or(0.0f); }
65 std::vector<Vector3> points;
66 std::vector<Vector3> branch;
71 void DrawFalling(
const Camera3D& camera,
const Atmosphere& atmosphere,
72 const Terrain& terrain, Vector3 middle)
const;
73 void DrawGlows(
const Camera3D& camera,
const Terrain& terrain,
74 Vector3 middle)
const;
75 void DrawStrike(
const Camera3D& camera)
const;
76 float StrikeLight()
const;
79 std::optional<Terrain> terrain_;
87 std::optional<float> wetness_;
89 float next_bolt_ = 3.0f;
90 uint32_t bolts_struck_ = 0;
92 std::vector<Bolt> bolts_;
void Update(float seconds, const protocol::Sky &sky, bool on, const Camera3D &camera)
void set_seed(uint32_t seed)
float flash() const
How bright the sky is from a bolt that's just struck, from 0 to 1.
Weather(const Weather &)=delete
float wetness() const
From dry to soaked, which rain makes it, and the sun dries.
Weather & operator=(const Weather &)=delete
void set_land(const Terrain &terrain, int land)
void set_wetness(float wetness)
void Draw(const Camera3D &camera, const Atmosphere &atmosphere) const
std::vector< Bolt > TakeBolts()
The bolts that struck since the last time, once each.
The sky and the light, which the shaders read each frame.
Where a bolt of lightning struck, for its thunder to come from.