1#ifndef NANOMMO_CLIENT_RENDERER_H_
2#define NANOMMO_CLIENT_RENDERER_H_
52 atmosphere_.sky = background;
66 adjust_ = std::move(adjust);
76 const Camera3D&
camera()
const {
return camera_; }
86 void set_cubes(std::vector<Cube> cubes) { cubes_ = std::move(cubes); }
96 const std::vector<Figure>&
figures()
const {
return figures_; }
113 void Struck(uint32_t monster, uint32_t player) {
114 reactions_.Hit(monster, player);
121 target_player_ = player;
127 destination_ = destination;
132 void set_flag(std::optional<Vector3> flag) { flag_ = flag; }
137 telegraphs_ = std::move(telegraphs);
145 void UnloadTerrain();
146 void DrawCounted(
const Mesh& mesh,
const Material& material,
147 const Matrix& transform)
const;
148 void DrawFigure(
const Figure& figure)
const;
152 std::optional<protocol::Sky> sky_;
156 std::vector<Cube> cubes_;
157 std::vector<Figure> figures_;
158 uint32_t target_ = 0;
159 uint32_t target_player_ = 0;
160 std::optional<Vector3> destination_;
161 std::optional<Vector3> flag_;
162 std::map<uint32_t, Telegraph> telegraphs_;
171 Shader character_shader_;
173 bool cel_shading_ =
false;
177 std::vector<Face> tree_;
178 std::vector<Chunk> chunks_;
179 std::unique_ptr<Sea> sea_;
181 std::optional<Terrain> terrain_;
184 std::map<uint32_t, std::unique_ptr<Characters>> monsters_;
185 std::unique_ptr<Fx> fx_;
187 std::unique_ptr<Sky> sky_dome_;
188 std::unique_ptr<Weather> weather_;
const Work & work() const
void Struck(uint32_t monster, uint32_t player)
The player hit the monster, both by their ids.
std::optional< Gait > GaitOf(const Figure &figure) const
void set_background(const std::array< float, 3 > &background)
The sky's colour at the horizon, which the fog fades into.
const Atmosphere & atmosphere() const
The atmosphere as the last frame drew it.
void set_figures(std::vector< Figure > figures)
void set_camera(const Camera3D &camera)
void set_clear(float clear)
Renderer(const Content &content=Content())
void set_cel_shading(bool on)
Cel shading's bands and outlines, on or off. It starts off.
void DrawPreview(const Figure &figure, const Camera3D &camera) const
Draws one figure on a plain background, for previews in the UI.
void set_terrain(const Terrain &terrain, int land)
void set_adjust(std::function< void(Atmosphere &)> adjust)
void Animate(float seconds)
void set_sky(const protocol::Sky &sky, const Showing &showing)
const std::vector< Figure > & figures() const
Renderer(const Renderer &)=delete
Renderer & operator=(const Renderer &)=delete
void set_flag(std::optional< Vector3 > flag)
void set_cubes(std::vector< Cube > cubes)
void set_telegraphs(std::map< uint32_t, Telegraph > telegraphs)
void set_destination(std::optional< Vector3 > destination)
const Camera3D & camera() const
void set_target(uint32_t target, uint32_t player=0)
Camera3D GameCamera()
Looking down at the middle of the board, from above and behind.
The sky and the light, which the shaders read each frame.
What turns on and off: the time of day, and the weather.