mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 10:01:23 +01:00
Updated Data model (markdown)
parent
ecb2d027d5
commit
9b38192334
1 changed files with 2 additions and 1 deletions
|
|
@ -13,10 +13,11 @@ Repacking is a process of amending an initial [voronoi diagram](https://en.wikip
|
|||
Both `grid` and `pack` objects include data representing voronoi diagrams and their inner connections. Both initial and repacked voronoi can be build from the initial set of points, so this data is stored in memory only. It does not included into the .map file and getting calculated on map load.
|
||||
|
||||
### Grid object
|
||||
* `grid.cellsDesired`: `number` - initial count of cells/points requested for map creation. Used to define `spacing` and place points on a jittered square grid, hence the object name. Actual number of cells is defined by the number points able to place on a square grid. Default `cellsDesired` is 10 000, maximum - 100 000, minimal - 1 000
|
||||
* `grid.spacing`: `number` - spacing between points before jittering
|
||||
* `grid.cellsY`: `number` - number of cells in column
|
||||
* `grid.cellsX`: `number` - number of cells in row
|
||||
* `grid.points`: `number[][]` - initial coordinates `[x, y]` based on jittered square grid. Numbers rounded to 2 decimals
|
||||
* `grid.points`: `number[][]` - coordinates `[x, y]` based on jittered square grid. Numbers rounded to 2 decimals
|
||||
* `grid.boundary`: `number[][]` - off-canvas points coordinates used to cut the diagram approximately by canvas edges. Integers
|
||||
* `grid.cells`: `{}` - cells data object, including voronoi data:
|
||||
* * `grid.cells.i`: `number[]` - cell indexes `Uint16Array` or `Uint32Array` (depending on cells number)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue