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

#include <renderer.h>

Classes

struct  Work

Public Member Functions

 Renderer (const Content &content=Content())
 ~Renderer ()
 Renderer (const Renderer &)=delete
Renderer & operator= (const Renderer &)=delete
void Draw () const
void DrawPreview (const Figure &figure, const Camera3D &camera) const
 Draws one figure on a plain background, for previews in the UI.
void Clear () const
void set_background (const std::array< float, 3 > &background)
 The sky's colour at the horizon, which the fog fades into.
void set_sky (const protocol::Sky &sky, const Showing &showing)
void set_adjust (std::function< void(Atmosphere &)> adjust)
const Atmosphere & atmosphere () const
 The atmosphere as the last frame drew it.
Weather & weather ()
const Camera3D & camera () const
void set_camera (const Camera3D &camera)
void set_cel_shading (bool on)
 Cel shading's bands and outlines, on or off. It starts off.
void set_terrain (const Terrain &terrain, int land)
void set_cubes (std::vector< Cube > cubes)
const Work & work () const
const std::vector< Figure > & figures () const
void set_figures (std::vector< Figure > figures)
std::optional< Gait > GaitOf (const Figure &figure) const
void Animate (float seconds)
void Struck (uint32_t monster, uint32_t player)
 The player hit the monster, both by their ids.
void set_target (uint32_t target, uint32_t player=0)
void set_destination (std::optional< Vector3 > destination)
void set_flag (std::optional< Vector3 > flag)
void set_telegraphs (std::map< uint32_t, Telegraph > telegraphs)
void set_clear (float clear)

Detailed Description

Definition at line 35 of file renderer.h.

Constructor & Destructor Documentation

◆ Renderer() [1/2]

nanommo::Renderer::Renderer ( const Content & content = Content())
explicit

Definition at line 358 of file renderer.cc.

◆ ~Renderer()

nanommo::Renderer::~Renderer ( )

Definition at line 397 of file renderer.cc.

◆ Renderer() [2/2]

nanommo::Renderer::Renderer ( const Renderer & )
delete

Member Function Documentation

◆ Animate()

void nanommo::Renderer::Animate ( float seconds)

Moves the skills' fx, the sea's waves, the clouds and the weather on by the seconds, as the figures are now. Then the monsters take their blows, and those that just landed hold their players, and them, still for a moment. The sky's light is worked out again, for the time and the weather now.

Definition at line 435 of file renderer.cc.

◆ atmosphere()

const Atmosphere & nanommo::Renderer::atmosphere ( ) const
inline

The atmosphere as the last frame drew it.

Definition at line 70 of file renderer.h.

◆ camera()

const Camera3D & nanommo::Renderer::camera ( ) const
inline

Definition at line 76 of file renderer.h.

◆ Clear()

void nanommo::Renderer::Clear ( ) const

Definition at line 639 of file renderer.cc.

◆ Draw()

void nanommo::Renderer::Draw ( ) const

Definition at line 477 of file renderer.cc.

◆ DrawPreview()

void nanommo::Renderer::DrawPreview ( const Figure & figure,
const Camera3D & camera ) const

Draws one figure on a plain background, for previews in the UI.

Definition at line 586 of file renderer.cc.

◆ figures()

const std::vector< Figure > & nanommo::Renderer::figures ( ) const
inline

Definition at line 96 of file renderer.h.

◆ GaitOf()

std::optional< Gait > nanommo::Renderer::GaitOf ( const Figure & figure) const

Where the figure is in its walk or run, as its model's clips have it: none, if it's doing neither.

Definition at line 609 of file renderer.cc.

◆ operator=()

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

◆ set_adjust()

void nanommo::Renderer::set_adjust ( std::function< void(Atmosphere &)> adjust)
inline

Changes the atmosphere each frame, after the time of day and the weather: a film's own fog, sun or light.

Definition at line 65 of file renderer.h.

◆ set_background()

void nanommo::Renderer::set_background ( const std::array< float, 3 > & background)
inline

The sky's colour at the horizon, which the fog fades into.

Definition at line 51 of file renderer.h.

◆ set_camera()

void nanommo::Renderer::set_camera ( const Camera3D & camera)
inline

Definition at line 77 of file renderer.h.

◆ set_cel_shading()

void nanommo::Renderer::set_cel_shading ( bool on)

Cel shading's bands and outlines, on or off. It starts off.

Definition at line 421 of file renderer.cc.

◆ set_clear()

void nanommo::Renderer::set_clear ( float clear)
inline

How far the fog has lifted, as Loading::clear says: from 0, where it hides all but what's nearest, to 1, the atmosphere's own.

Definition at line 142 of file renderer.h.

◆ set_cubes()

void nanommo::Renderer::set_cubes ( std::vector< Cube > cubes)
inline

Definition at line 86 of file renderer.h.

◆ set_destination()

void nanommo::Renderer::set_destination ( std::optional< Vector3 > destination)
inline

Where the player's walking to by themselves, which gets a ring of its own, if they are.

Definition at line 126 of file renderer.h.

◆ set_figures()

void nanommo::Renderer::set_figures ( std::vector< Figure > figures)
inline

Definition at line 97 of file renderer.h.

◆ set_flag()

void nanommo::Renderer::set_flag ( std::optional< Vector3 > flag)
inline

Where a duel's flag is, while there's one: a pole, with a ring at its foot, and a ring as far out as the duellists can go.

Definition at line 132 of file renderer.h.

◆ set_sky()

void nanommo::Renderer::set_sky ( const protocol::Sky & sky,
const Showing & showing )
inline

The time of day and the weather, as the server sent them, and which of them the player wants to see. Until the first, the land has its own look all the time.

Definition at line 58 of file renderer.h.

◆ set_target()

void nanommo::Renderer::set_target ( uint32_t target,
uint32_t player = 0 )
inline

The monster the player picked, by its id, or in a duel, the player, by theirs, which gets a ring at its feet, or 0 for none.

Definition at line 119 of file renderer.h.

◆ set_telegraphs()

void nanommo::Renderer::set_telegraphs ( std::map< uint32_t, Telegraph > telegraphs)
inline

The monsters' skills on their way, each a shape on the ground that fills until it lands.

Definition at line 136 of file renderer.h.

◆ set_terrain()

void nanommo::Renderer::set_terrain ( const Terrain & terrain,
int land )

Builds the terrain's meshes in the colours of the land's look, by its place in the lands, in place of any we had, and takes on its atmosphere.

Definition at line 408 of file renderer.cc.

◆ Struck()

void nanommo::Renderer::Struck ( uint32_t monster,
uint32_t player )
inline

The player hit the monster, both by their ids.

Definition at line 113 of file renderer.h.

◆ weather()

Weather & nanommo::Renderer::weather ( )
inline

What falls from the sky, and the lightning, whose bolts the thunder follows.

Definition at line 74 of file renderer.h.

◆ work()

const Work & nanommo::Renderer::work ( ) const
inline

Definition at line 94 of file renderer.h.


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