world module#
-
namespace world#
Game world structures.
This module defines the structures used to build the entire game world.
-
class Level#
-
class Light#
- #include <sector.hpp>
A light source.
-
class PolygonalSectorBuilder : public world::SectorBuilder#
-
class RectangularSectorBuilder : public world::SectorBuilder#
-
class Sector#
- #include <sector.hpp>
The largest building block of a Level.
A sector is a piece of the map, which is a concave polygon on the X/Y plane, and has a ceiling and a floor, both of which have some set Z height.
The sector is bounded by walls, any of which might be a portal looking into another sector. In order to be rendered properly, walls have to be placed in clockwise order (as any wall is defined by its vertices). Most of the engine calculations assume this order and breaking this constraint will most likely break the engine.
The sector, apart from the walls, contains sprites and lights. Player, at any given time, is present in exactly one sector. A position of any entity in the world is defined by [Sector ID; X; Y; Z] coordinates, as the sectors/portals system allows for one set of [X; Y; Z] coordinates to be part of many sectors.
-
class SectorBuilder#
Subclassed by world::PolygonalSectorBuilder, world::RectangularSectorBuilder
-
class Sprite#
- #include <sector.hpp>
A 2D sprite.
-
class Wall#
- #include <sector.hpp>
A wall on a sector edge.
The wall, when the level map is viewed from a top-down perspective, is an edge of the convex polygon representing a single Sector.
The wall is defined by its start and end X/Y-coordinates.
The wall is rendered as a 2D rectangle in the 3D space, with the following vertices:
[xStart, yStart, sector.floor]
[xStart, yStart, sector.ceiling]
[xEnd, yEnd, sector.ceiling]
[xEnd, yEnd, sector.floor]
The wall might be marked as a Portal.
-
class World#
-
class Level#