The surfaces of a sector map sector by sector, from its sectors and sides as they are
now: each sector's floors and ceilings over its subsectors' polygons
(CauldronGPU.Sectors.Flats.polygons/1), and the walls facing into it
(CauldronGPU.Sectors.Walls, with its pegging and sky rules). Floors and ceilings
whose picture marks a sky, and the upper walls left out between two sky ceilings
(from the lower ceiling up to the higher, facing into the higher sector), are sky
surfaces keyed :sky.
A surface is {{:picture, id} | :sky, corners}, each corner
{position, normal, uv, {sector, contrast}} in map coordinates (+Z up): sector the
sector it is lit by and contrast the light -16, 0 or 16 added for the wall's
direction.
geometry = CauldronGPU.Sectors.Live.Geometry.new(map)
CauldronGPU.Sectors.Live.Geometry.surfaces(geometry, [3, 7], sectors, sides, pictures, sky)
CauldronGPU.Sectors.Live.Geometry.neighbours(geometry, 3)
Summary
Functions
The sectors sharing a two-sided line with sector.
The geometry of map, which must carry a BSP.
The surfaces of each of wanted, as %{sector => surfaces}, given the map's
sectors and sides as they are now; sky is the set of picture ids that mark a sky.
Types
@type surface() :: {{:picture, non_neg_integer()} | :sky, [corner()]}
@type t() :: %CauldronGPU.Sectors.Live.Geometry{ lines: %{required(non_neg_integer()) => [non_neg_integer()]}, map: Cauldron2D.Sectors.Map.t(), neighbours: %{required(non_neg_integer()) => MapSet.t(non_neg_integer())}, polygons: %{ required(non_neg_integer()) => [CauldronGPU.Sectors.Flats.polygon()] } }
Functions
@spec neighbours(t(), non_neg_integer()) :: MapSet.t(non_neg_integer())
The sectors sharing a two-sided line with sector.
@spec new(Cauldron2D.Sectors.Map.t()) :: t()
The geometry of map, which must carry a BSP.
@spec surfaces( t(), [non_neg_integer()], tuple(), tuple(), Cauldron2D.Sectors.Pictures.t(), MapSet.t() ) :: %{required(non_neg_integer()) => [surface()]}
The surfaces of each of wanted, as %{sector => surfaces}, given the map's
sectors and sides as they are now; sky is the set of picture ids that mark a sky.