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

#include <interpolation.h>

Public Member Functions

void Add (const protocol::World &world, double now)
protocol::World Shown (const protocol::World &newest, double now) const
int64_t Drawn (double now) const

Static Public Attributes

static constexpr double kDelay = 0.1
static constexpr double kMostAhead = 0.1

Detailed Description

Everyone but you, drawn a little in the past, between the two worlds from the server on either side of that moment, so that they move smoothly whenever the worlds come, as long as each next one has come by then.

Definition at line 15 of file interpolation.h.

Member Function Documentation

◆ Add()

void nanommo::Interpolation::Add ( const protocol::World & world,
double now )

A world as it came, at the time on our clock, in seconds. More of a world we have, as its other parts come, fills it in, and keeps the time its first part came.

Definition at line 40 of file interpolation.cc.

◆ Drawn()

int64_t nanommo::Interpolation::Drawn ( double now) const

The time on the server's clock that we draw everyone else at, now, in microseconds, which each input says, so that a blow on a duel opponent is checked against where we drew them. Or 0 before any world has come.

Definition at line 71 of file interpolation.cc.

◆ Shown()

protocol::World nanommo::Interpolation::Shown ( const protocol::World & newest,
double now ) const

The newest world, with the players other than you, and the monsters, where they were kDelay ago on the server's clock.

Definition at line 78 of file interpolation.cc.

Member Data Documentation

◆ kDelay

double nanommo::Interpolation::kDelay = 0.1
staticconstexpr

How far behind the server's clock we draw them: two of its ticks, so a world can come up to one tick late and still be there in time.

Definition at line 19 of file interpolation.h.

◆ kMostAhead

double nanommo::Interpolation::kMostAhead = 0.1
staticconstexpr

How far past the newest world we carry them on, along the way they were going, when the next one's late or lost, before they wait for it.

Definition at line 23 of file interpolation.h.


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