|
nanoMMO 0.97.8
Building an MMO: The Engineering Series
|
#include <terrain.h>
Public Member Functions | |
| Terrain () | |
| The board we had: flat, twelve metres across, for the tests. | |
| Terrain (uint32_t seed, float wading=kWading) | |
| float | Height (float x, float z) const |
| On the triangles between the grid's corners, as the client draws them. | |
| bool | Walkable (float x, float z) const |
| const std::vector< Tree > & | trees () const |
| float | Corner (int i, int j) const |
| The height at a corner of the grid, from 0 to cells() along each side. | |
| uint32_t | seed () const |
| int | cells () const |
| Along each side. | |
| float | half_size () const |
| From the middle to each side of the grid. | |
| float | edge () const |
| Half a metre short of each side, so that players stay on the grid. | |
Static Public Attributes | |
| static constexpr float | kCell = 2.0f |
| In metres. Each cell of the grid is two triangles. | |
| static constexpr float | kSeaLevel = 0.0f |
| static constexpr float | kWading = 0.4f |
| Players wade into the sea up to their knees. | |
| static constexpr float | kTreeSpacing = 4.0f |
| The trees grow on a grid of squares this size, at most one in each. | |
| static constexpr float | kTrunk = 0.5f |
| How close to the middle of a trunk a player can stand. | |
The ground everyone walks on. The server and the clients each make it from the same seed, so only the seed goes over the network.
| nanommo::Terrain::Terrain | ( | ) |
The board we had: flat, twelve metres across, for the tests.
Definition at line 51 of file terrain.cc.
|
explicit |
An island, 512 metres across, with the sea all around it, which players can wade into as deep as wading, in metres.
Definition at line 54 of file terrain.cc.
|
inline |
|
inline |
|
inline |
|
inline |
| float nanommo::Terrain::Height | ( | float | x, |
| float | z ) const |
On the triangles between the grid's corners, as the client draws them.
Definition at line 102 of file terrain.cc.
|
inline |
| bool nanommo::Terrain::Walkable | ( | float | x, |
| float | z ) const |
Whether a player can stand there: on the grid, out of the sea, and not in a tree.
Definition at line 123 of file terrain.cc.
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |