Compare commits
129 Commits
shitcode
...
tahrion_te
| Author | SHA1 | Date | |
|---|---|---|---|
| cfa75bd8f3 | |||
| b08f808167 | |||
| eb69779b0d | |||
| b0fc925750 | |||
| e12b0d64e5 | |||
| efcee33a02 | |||
| ce778673c7 | |||
| 5ec4bdd933 | |||
| 6332f23bf3 | |||
| 966af2328a | |||
| d08ee33400 | |||
| ba97a8f36f | |||
| ef6c0d9fe6 | |||
| c3bdb29852 | |||
| 6904090d19 | |||
| f3c5beb341 | |||
| fc90ae54c0 | |||
| 0952e96452 | |||
| 19d6637a29 | |||
| 6fb06b7109 | |||
| d392414cb7 | |||
| 8c7aaefe09 | |||
| 1d1591accc | |||
| ec614e6080 | |||
| c32d324bfb | |||
| 37d759e48a | |||
| 4b9afcf97d | |||
| c9ce8e5f60 | |||
| b7124419e7 | |||
| 8742b86a44 | |||
| 79111b3cbd | |||
| 087a8eee86 | |||
| cb853778fe | |||
| bdd35af484 | |||
| 882165c9e7 | |||
| e294c34801 | |||
| b6e07d04e3 | |||
| 3d03477467 | |||
| c75e06d274 | |||
| 6d3e9af2f8 | |||
| cabe562dc4 | |||
| 43bee3dae0 | |||
| 4f4b268d3c | |||
| c2b0c54236 | |||
| 907230e67d | |||
| 03ce7983eb | |||
| e81e2141a6 | |||
| 3d0a906a59 | |||
| 18dbce95c0 | |||
| b646a8e3e3 | |||
| 7ec4f906c8 | |||
| 39dbf29ff6 | |||
| a4b1ff2ee5 | |||
| 0c5f508152 | |||
| 50dd702e6e | |||
| 426fea3691 | |||
| 299dad5e11 | |||
| 0e8edc4f05 | |||
| f13a0b1273 | |||
| 57de1f4b42 | |||
| d0eba35e8d | |||
| 8640e55415 | |||
| 84295c56c4 | |||
| eaf350e9ce | |||
| dfd8021808 | |||
| d9f9bd7a6c | |||
|
|
0ff45e4da1 | ||
| 395f45aeb9 | |||
| d9aa50fc91 | |||
| 876b24e1fe | |||
| 37ad60d348 | |||
| bc50096293 | |||
| 1c5038ff14 | |||
| 562ff7d24c | |||
| a08934c6e4 | |||
| 6236a12ca9 | |||
| f7ec69bd54 | |||
| bf107cb167 | |||
| cb49582a19 | |||
| cf4ca6f8dc | |||
| 2032082ba8 | |||
| 9557642805 | |||
| 6db2e9f77a | |||
| 275f54c7b7 | |||
| 47dc024b6c | |||
| efeb5c75cd | |||
| c0575e2c82 | |||
| 4e823bfee6 | |||
| 44ba5c7cfa | |||
| 475b199ddb | |||
| 96b51caaaf | |||
| 514e676e9a | |||
| 7773e25a81 | |||
| 96289375b1 | |||
| 40c1d34124 | |||
| 2655127a22 | |||
| b1c3e50445 | |||
| 9c919343cf | |||
| 13391b085e | |||
| 27004ebf45 | |||
| 7b951b64ac | |||
| c57a7ceadd | |||
| 95084d5daf | |||
| 3e9996e6a0 | |||
| 3646ec78cd | |||
| cf141f9797 | |||
| 475b5fab0c | |||
| 6f742e7291 | |||
| b5994d7383 | |||
| c5a71d5bdc | |||
| 1ac87b464a | |||
| 5b22c900d5 | |||
| 0b749564af | |||
| a699367bf4 | |||
| 720b7edcdb | |||
| bbd5c781e4 | |||
| 0870ce37e9 | |||
| a5c8846130 | |||
| 745fdb8dd3 | |||
| a0a1db6179 | |||
| 1d576dcaf5 | |||
| 414d5008d3 | |||
| 7908f5fc9f | |||
| af87c2912c | |||
| e44420d0ab | |||
| ace217832b | |||
| f9eccced09 | |||
| d07b7c811f | |||
| f556e4349e |
@@ -24,7 +24,9 @@
|
|||||||
"enables": [],
|
"enables": [],
|
||||||
"globals": [
|
"globals": [
|
||||||
"core",
|
"core",
|
||||||
|
"Smc",
|
||||||
"table",
|
"table",
|
||||||
|
"Events",
|
||||||
"VoxelArea",
|
"VoxelArea",
|
||||||
"VoxelManip",
|
"VoxelManip",
|
||||||
"vector",
|
"vector",
|
||||||
|
|||||||
52
.gitea/issue_template/bug.yaml
Normal file
52
.gitea/issue_template/bug.yaml
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
name: Сообщение об ошибке
|
||||||
|
about: Сообщить о недоработке игры, которую необходимо исправить.
|
||||||
|
title: "[Bug]: "
|
||||||
|
labels:
|
||||||
|
- bug/need confirmed
|
||||||
|
body:
|
||||||
|
- type: textarea
|
||||||
|
id: bug-desc
|
||||||
|
attributes:
|
||||||
|
label: Описание ошибки
|
||||||
|
description: Опишите, что произошло, в чем по вашему мнению заключается ошибка и какое поведение игры вы ожидали.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: playback-order
|
||||||
|
attributes:
|
||||||
|
label: Как воспроизвести баг?
|
||||||
|
description: Опишите порядок действий, как воспроизвести описываемую ошибку.
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: dropdown
|
||||||
|
id: game-version
|
||||||
|
attributes:
|
||||||
|
label: Версия игры
|
||||||
|
description: Сообщите на каких версиях клиента игры была замечена ошибка.
|
||||||
|
multiple: true
|
||||||
|
options:
|
||||||
|
- "5.15"
|
||||||
|
- "5.14"
|
||||||
|
- "5.13"
|
||||||
|
- "5.12"
|
||||||
|
- "5.11"
|
||||||
|
- "5.10"
|
||||||
|
- "< 5.10"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
id: bug-server
|
||||||
|
attributes:
|
||||||
|
label: Где была замечена ошибка?
|
||||||
|
description: Сообщите, где была замечена ошибка.
|
||||||
|
multiple: true
|
||||||
|
options:
|
||||||
|
- Игровой сервер
|
||||||
|
- Локальный мир
|
||||||
|
- Тестовый сервер
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
Спасибо, что уделили время и заполнили этот отчет об ошибке!
|
||||||
19
.gitea/issue_template/idea.yaml
Normal file
19
.gitea/issue_template/idea.yaml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
name: Предложение
|
||||||
|
about: Описать предложение для рассмотрения мейнтейнерами проекта.
|
||||||
|
labels:
|
||||||
|
- idea/need a maintainer
|
||||||
|
body:
|
||||||
|
- type: textarea
|
||||||
|
id: task-desc
|
||||||
|
attributes:
|
||||||
|
label: Описание
|
||||||
|
description: Подробно опишите в чем заключается ваша идея, а так же объясните необходимость её реализации.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: task-additions
|
||||||
|
attributes:
|
||||||
|
label: Дополнения
|
||||||
|
description: Приложите дополнительные сведенья, файлы или изображения.
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
19
.gitea/issue_template/task.yaml
Normal file
19
.gitea/issue_template/task.yaml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
name: Задача
|
||||||
|
about: Сформировать и описать задачу, которую должен будет выполнить разработчик. Этот шаблон предназначен для мейнтейнеров проекта.
|
||||||
|
labels:
|
||||||
|
- task/need developer
|
||||||
|
body:
|
||||||
|
- type: textarea
|
||||||
|
id: task-desc
|
||||||
|
attributes:
|
||||||
|
label: Описание задачи
|
||||||
|
description: Подробно опишите в чем заключается задача для разработчика.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: task-additions
|
||||||
|
attributes:
|
||||||
|
label: Дополнения
|
||||||
|
description: Приложите дополнительные сведенья, файлы или изображения необходимые для выполнения задачи.
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
35
.gitea/pull_request_template.yml
Normal file
35
.gitea/pull_request_template.yml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
name: Сообщение об ошибке
|
||||||
|
about: Сообщить о недоработке игры, которую необходимо исправить.
|
||||||
|
labels:
|
||||||
|
- pr/wait review
|
||||||
|
- review/need a maintainer
|
||||||
|
body:
|
||||||
|
- type: textarea
|
||||||
|
id: pr-desc
|
||||||
|
attributes:
|
||||||
|
label: Описание изменений
|
||||||
|
description: Опишите, что было изменено в запросе на слияние и по какой причине.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: testing
|
||||||
|
attributes:
|
||||||
|
label: Тестирование
|
||||||
|
description: Опишите, в наличии каких объектов или в работоспособности каких систем необходимо убедиться.
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: checkboxes
|
||||||
|
id: terms
|
||||||
|
attributes:
|
||||||
|
label: Требования
|
||||||
|
options:
|
||||||
|
- label: Я запускал игру и убедился в том, что она работает.
|
||||||
|
required: true
|
||||||
|
- label: Я ознакомлен с соглашением по разработке и мои изменения следуют принятым стандартам.
|
||||||
|
required: true
|
||||||
|
- label: Я указал в описании запроса метки (label) с префиксом `Edit:` в соответствии с теми изменениями, которые сделал.
|
||||||
|
required: true
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
Спасибо, что прислали это запрос на слияние и помогли нам в разработке игры!
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
|
IGNORE
|
||||||
/mods/IGNORE
|
/mods/IGNORE
|
||||||
7
.gitmodules
vendored
7
.gitmodules
vendored
@@ -1,7 +1,6 @@
|
|||||||
[submodule "mods/API/Utf8"]
|
|
||||||
path = mods/API/Utf8
|
|
||||||
url = https://github.com/ApancoreStudio/utf8_api.git
|
|
||||||
branch = main
|
|
||||||
[submodule "util/ide-helper"]
|
[submodule "util/ide-helper"]
|
||||||
path = util/ide-helper
|
path = util/ide-helper
|
||||||
url = https://github.com/Voxrame/luanti-ide-helper.git
|
url = https://github.com/Voxrame/luanti-ide-helper.git
|
||||||
|
[submodule "mods/SYSTEM/Utf8"]
|
||||||
|
path = mods/SYSTEM/Utf8
|
||||||
|
url = https://git.apancore.ru/Apancore.Studio/utf8_api.git
|
||||||
|
|||||||
13
README.md
13
README.md
@@ -1,3 +1,12 @@
|
|||||||
Simple Makes Complex is a Luanti engine-based game focused on the multiplayer gameplay
|

|
||||||
|
|
||||||

|
# Simple Makes Complex
|
||||||
|
Simple Makes Complex is a Luanti engine-based game focused on the multiplayer gameplay.
|
||||||
|
|
||||||
|
# Licensing
|
||||||
|
- The project's core code is licensed under [MIT](/LICENSE).
|
||||||
|
- Submodules may contain their own license.
|
||||||
|
- Media assets are used and distributed under [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/).
|
||||||
|
|
||||||
|
# Assets used
|
||||||
|
- Font used in the `/menu/last_header.png`: https://fontstruct.com/fontstructions/show/2722233/gbjve (danil_2461, [CC0](http://creativecommons.org/publicdomain/zero/1.0/))
|
||||||
|
|||||||
218
docs/MapGen_docs.txt
Normal file
218
docs/MapGen_docs.txt
Normal file
@@ -0,0 +1,218 @@
|
|||||||
|
MapGen.PastCalcNoiseValue *MapGen.PastCalcNoiseValue*
|
||||||
|
|
||||||
|
Type: ~
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
MapGen *MapGen*
|
||||||
|
|
||||||
|
Fields: ~
|
||||||
|
{layersByName} (table<string,MapGen.Layer>)
|
||||||
|
{layersList} (MapGen.Layer[])
|
||||||
|
{staticsByName} (table<string,MapGen.StaticLayer>)
|
||||||
|
{staticsList} (MapGen.StaticLayer[])
|
||||||
|
{layersNoisesInitialized} (boolean) Is the fractal noise of the layer initialized? This is necessary for a one-time noise initialization.
|
||||||
|
{cavernsNoiseInitialized} (boolean) Is the fractal noise of the caverns initialized? This is necessary for a one-time noise initialization.
|
||||||
|
{isRunning} (boolean) A static field that guarantees that only one instance of the `MapGen` class will work.
|
||||||
|
{nodeIDs} (table<string,number>)
|
||||||
|
|
||||||
|
|
||||||
|
MapGenDef *MapGenDef*
|
||||||
|
Definition table for the `MapGen`.
|
||||||
|
|
||||||
|
**Only for EmmyLua.**
|
||||||
|
|
||||||
|
Fields: ~
|
||||||
|
{nodes} (table<string,string>)
|
||||||
|
|
||||||
|
|
||||||
|
MapGen:new({def}) *MapGen:new*
|
||||||
|
|
||||||
|
Parameters: ~
|
||||||
|
{def} (MapGenDef)
|
||||||
|
|
||||||
|
Returns: ~
|
||||||
|
(MapGen)
|
||||||
|
|
||||||
|
|
||||||
|
MapGen:getLayerByHeight({yPos}) *MapGen:getLayerByHeight*
|
||||||
|
Determines which layer a node belongs to based on its height coordinate.
|
||||||
|
|
||||||
|
Parameters: ~
|
||||||
|
{yPos} (number) @return MapGen.Layer?
|
||||||
|
|
||||||
|
|
||||||
|
MapGen:getStaticByHeight({yPos}) *MapGen:getStaticByHeight*
|
||||||
|
Determines which statics layer a node belongs to based on its height coordinate.
|
||||||
|
|
||||||
|
Parameters: ~
|
||||||
|
{yPos} (number) @return MapGen.StaticLayer?
|
||||||
|
|
||||||
|
|
||||||
|
MapGen:registerLayer({name}, {def}) *MapGen:registerLayer*
|
||||||
|
Mark the world area between two heights as a `MapGen.Layer`.
|
||||||
|
|
||||||
|
Note: layers must not overlap.
|
||||||
|
|
||||||
|
Parameters: ~
|
||||||
|
{name} (string) The name that will be assigned to the layer. The name must be unique for each layer.
|
||||||
|
{def} (MapGen.LayerDef) Layer description table, see details `MapGen.LayerDef`.
|
||||||
|
|
||||||
|
|
||||||
|
*MapGen:registerLayerNoiseColor*
|
||||||
|
MapGen:registerLayerNoiseColor({layerName}, {category}, {color}, {noiseParams})
|
||||||
|
Register the color and the noise parameters that correspond to it.
|
||||||
|
|
||||||
|
Parameters: ~
|
||||||
|
{layerName} (string) The name of the layer for which the color will be registered.
|
||||||
|
{category} (MapGen.Layer.Category) Category indicating what will be generated by noise.
|
||||||
|
{color} (ColorString) Noise color. Must be unique.
|
||||||
|
{noiseParams} (NoiseParams) Fractal noise parameters.
|
||||||
|
|
||||||
|
|
||||||
|
*MapGen:registerStaticLayer*
|
||||||
|
MapGen:registerStaticLayer({name}, {def})
|
||||||
|
Mark the world area between two heights as a `MapGen.StaticLayer`.
|
||||||
|
|
||||||
|
Note: layers must not overlap.
|
||||||
|
|
||||||
|
Parameters: ~
|
||||||
|
{name} (string) The name that will be assigned to the static layer. The name must be unique for each layer.
|
||||||
|
{def} (MapGen.StaticLayerDef) Static layer description table, see details `MapGen.StaticLayerDef`.
|
||||||
|
|
||||||
|
|
||||||
|
*MapGen:registerPeak*
|
||||||
|
MapGen:registerPeak({layerName}, {category}, {def})
|
||||||
|
Mark a world point as `MapGen.Peak` and assign it a specific color that will affect the generation.
|
||||||
|
|
||||||
|
Note: The peaks shouldn't overlap. This won't cause any errors, but it might ruin the generation.
|
||||||
|
|
||||||
|
Parameters: ~
|
||||||
|
{layerName} (string) The name of the layer in which the new peak will be included.
|
||||||
|
{category} (MapGen.Layer.Category) Category indicating what will be generated by peak.
|
||||||
|
{def} (MapGen.PeakDef) Peak description table, see details `MapGen.PeakDef`.
|
||||||
|
|
||||||
|
|
||||||
|
*MapGen:register2DPeak*
|
||||||
|
MapGen:register2DPeak({layerName}, {category}, {def})
|
||||||
|
Mark a world point as `MapGen.Peak` and assign it a specific color that will affect the generation.
|
||||||
|
The Y coordinate will be forced to zero, and the `is2d` group will be added to the groups field.
|
||||||
|
|
||||||
|
Note: The peaks shouldn't overlap. This won't cause any errors, but it might ruin the generation.
|
||||||
|
|
||||||
|
Parameters: ~
|
||||||
|
{layerName} (string) The name of the layer in which the new peak will be included.
|
||||||
|
{category} (MapGen.Layer.Category) Category indicating what will be generated by peak.
|
||||||
|
{def} (MapGen.PeakDef) Peak description table, see details `MapGen.PeakDef`.
|
||||||
|
|
||||||
|
|
||||||
|
*MapGen:register2DPeaks*
|
||||||
|
MapGen:register2DPeaks({layerName}, {category}, {defs})
|
||||||
|
Mark the world points as `MapGen.Peak` and assign them all a specific noise that will affect generation.
|
||||||
|
The Y coordinate will be forced to zero, and the `is2d` group will be added to the groups field.
|
||||||
|
|
||||||
|
Note: The peaks shouldn't overlap. This won't cause any errors, but it might ruin the generation.
|
||||||
|
|
||||||
|
Parameters: ~
|
||||||
|
{layerName} (string) The name of the layer in which the new peaks will be included.
|
||||||
|
{category} (MapGen.Layer.Category) Category indicating what will be generated by peaks.
|
||||||
|
{defs} (MapGen.PeakDef[]) Peaks description table, see details `MapGen.PeakDef`.
|
||||||
|
|
||||||
|
|
||||||
|
*MapGen:register2DPeaksFromFile*
|
||||||
|
MapGen:register2DPeaksFromFile({layerName}, {map}, {scale}, {zeroPos}, {category}, {groups?})
|
||||||
|
Extract the `MapGen.Peak` from the image and assign them all a specific color that will affect the generation.
|
||||||
|
|
||||||
|
Parameters: ~
|
||||||
|
{layerName} (string) The name of the layer in which the new peaks will be included.
|
||||||
|
{map} (string) The name of the image from which the peaks will be extracted. It should be located in the `<mod_name>/textures/maps` folder and have the following format `<image_name>.ff`
|
||||||
|
{scale} (number) Multiplier of how many blocks (nodes) will be between image pixels. It is not recommended to set the value below 50 for performance reasons.
|
||||||
|
{zeroPos} (Position2d) The position in pixels where the zero world coordinate will be in the image.
|
||||||
|
{category} (MapGen.Layer.Category) Category indicating what will be generated by peaks.
|
||||||
|
{groups?} (table<string,number>) Groups that will be added to all peaks.
|
||||||
|
|
||||||
|
|
||||||
|
*MapGen:registerBiome*
|
||||||
|
MapGen:registerBiome({layerName}, {biomeName}, {def})
|
||||||
|
Mark a point on the biomes diagram and constrain the world area by height to mark it as `MapGen.Biome`.
|
||||||
|
|
||||||
|
Parameters: ~
|
||||||
|
{layerName} (string) The name of the layer in which the new biome will be included.
|
||||||
|
{biomeName} (string) The name to be assigned to the biome. The name must be unique for each biome.
|
||||||
|
{def} (MapGen.BiomeDef) Biome description table, see details `MapGen.BiomeDef`
|
||||||
|
|
||||||
|
|
||||||
|
*MapGen:registerCavern*
|
||||||
|
MapGen:registerCavern({layerName}, {cavernName}, {def})
|
||||||
|
Mark the world area between two heights as a `MapGen.Cavern` and assign the noise that the cave will be generated from.
|
||||||
|
|
||||||
|
Parameters: ~
|
||||||
|
{layerName} (string) The name of the layer in which the new cavern will be included.
|
||||||
|
{cavernName} (string) The name to be assigned to the cavern. The name must be unique for each cavern.
|
||||||
|
{def} (MapGen.CavernDef) Cavern description table, see details `MapGen.CavernDef`
|
||||||
|
|
||||||
|
|
||||||
|
MapGen:initLayersTriangultaion() *MapGen:initLayersTriangultaion*
|
||||||
|
Divide all layers into triangles whose vertices are the `Mapgen.Peak` belonging to these layers.
|
||||||
|
|
||||||
|
|
||||||
|
MapGen:initLayersNoises() *MapGen:initLayersNoises*
|
||||||
|
Initialize all layer noises. This should be called after the map object is loaded.
|
||||||
|
|
||||||
|
|
||||||
|
MapGen:initBiomesDiagram() *MapGen:initBiomesDiagram*
|
||||||
|
Initialization of the biome diagram using the Voronoi method.
|
||||||
|
|
||||||
|
|
||||||
|
MapGen:initCavernsNoise() *MapGen:initCavernsNoise*
|
||||||
|
Initialize caverns's noises. This should be called after the map object is loaded.
|
||||||
|
|
||||||
|
|
||||||
|
*MapGen:getNoises2dValue*
|
||||||
|
MapGen:getNoises2dValue({category}, {layer}, {x}, {y}, {z})
|
||||||
|
Calculates a smoothed 2D noise value based on a preliminary space partitioning.
|
||||||
|
|
||||||
|
Returns `nil` if the point is not included in any triangle.
|
||||||
|
|
||||||
|
Parameters: ~
|
||||||
|
{category} (MapGen.Layer.Category)
|
||||||
|
{layer} (MapGen.Layer)
|
||||||
|
{x} (integer)
|
||||||
|
{y} (integer)
|
||||||
|
{z} (integer) @return number?
|
||||||
|
|
||||||
|
|
||||||
|
*MapGen:getNoises3dValues*
|
||||||
|
MapGen:getNoises3dValues({layer}, {x}, {y}, {z})
|
||||||
|
Calculates a smoothed 3D noise value based on a preliminary space partitioning.
|
||||||
|
|
||||||
|
Returns `nil` if the point is not included in any tetrahedron.
|
||||||
|
|
||||||
|
|
||||||
|
Parameters: ~
|
||||||
|
{layer} (MapGen.Layer)
|
||||||
|
{x} (number)
|
||||||
|
{y} (number)
|
||||||
|
{z} (number) @return number?
|
||||||
|
|
||||||
|
|
||||||
|
*MapGen:onMapGenerated*
|
||||||
|
MapGen:onMapGenerated({voxelManip}, {minPos}, {maxPos}, {blockseed})
|
||||||
|
Chunk generation handler.
|
||||||
|
|
||||||
|
Parameters: ~
|
||||||
|
{voxelManip} (VoxelManip)
|
||||||
|
{minPos} (Position)
|
||||||
|
{maxPos} (Position)
|
||||||
|
{blockseed} (number)
|
||||||
|
|
||||||
|
|
||||||
|
MapGen:run() *MapGen:run*
|
||||||
|
Run world generation through this mapgen object
|
||||||
|
|
||||||
|
Note: only one instance of a `MapGen` class can be running.
|
||||||
|
|
||||||
|
**FOR MAPGEN ENVIRONMENT ONLY**
|
||||||
|
|
||||||
|
|
||||||
|
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||||
54
docs/docs/index.md
Normal file
54
docs/docs/index.md
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
# index
|
||||||
|
|
||||||
|
|
||||||
|
## Types
|
||||||
|
|
||||||
|
- [alias Category](types/MapGen.Layer.Category.md)
|
||||||
|
- [alias CircumCircleEnum](types/MapGen.Triangle.CircumCircleEnum.md)
|
||||||
|
- [alias ColoredDotsTable](types/ColoredDotsTable.md)
|
||||||
|
- [alias Neighbours](types/MapGen.Triangle.Neighbours.md)
|
||||||
|
- [alias PastCalcNoiseValue](types/MapGen.PastCalcNoiseValue.md)
|
||||||
|
- [alias generateFunc](types/generateFunc.md)
|
||||||
|
- [class Biome](types/MapGen.Biome.md)
|
||||||
|
- [class BiomeDef](types/MapGen.BiomeDef.md)
|
||||||
|
- [class Cavern](types/MapGen.Cavern.md)
|
||||||
|
- [class CavernDef](types/MapGen.CavernDef.md)
|
||||||
|
- [class Decoration](types/MapGen.Decoration.md)
|
||||||
|
- [class Edge](types/MapGen.Triangulation.Edge.md)
|
||||||
|
- [class FakePeak](types/MapGen.Triangulation.FakePeak.md)
|
||||||
|
- [class GroundNodes](types/MapGen.Biome.GroundNodes.md)
|
||||||
|
- [class GroundNodesIDs](types/MapGen.Biome.GroundNodesIDs.md)
|
||||||
|
- [class Layer](types/MapGen.Layer.md)
|
||||||
|
- [class LayerDef](types/MapGen.LayerDef.md)
|
||||||
|
- [class MapGen](types/MapGen.md)
|
||||||
|
- [class MapGenDef](types/MapGenDef.md)
|
||||||
|
- [class Peak](types/MapGen.Peak.md)
|
||||||
|
- [class PeakDef](types/MapGen.PeakDef.md)
|
||||||
|
- [class StaticLayer](types/MapGen.StaticLayer.md)
|
||||||
|
- [class StaticLayerDef](types/MapGen.StaticLayerDef.md)
|
||||||
|
- [class Tetrahedron](types/MapGen.Tetrahedron.md)
|
||||||
|
- [class Triangle](types/MapGen.Triangle.md)
|
||||||
|
- [class Triangulation](types/MapGen.Triangulation.md)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Modules
|
||||||
|
- [MapGen](modules/MapGen.md)
|
||||||
|
- [MapGen.Biome](modules/MapGen.Biome.md)
|
||||||
|
- [MapGen.Biome.GroundNodes](modules/MapGen.Biome.GroundNodes.md)
|
||||||
|
- [MapGen.Biome.GroundNodesIds](modules/MapGen.Biome.GroundNodesIds.md)
|
||||||
|
- [MapGen.Cavern](modules/MapGen.Cavern.md)
|
||||||
|
- [MapGen.Decoration](modules/MapGen.Decoration.md)
|
||||||
|
- [MapGen.Layer](modules/MapGen.Layer.md)
|
||||||
|
- [MapGen.Peak](modules/MapGen.Peak.md)
|
||||||
|
- [MapGen.StaticLayer](modules/MapGen.StaticLayer.md)
|
||||||
|
- [MapGen.Tetrahedron](modules/MapGen.Tetrahedron.md)
|
||||||
|
- [MapGen.Triangle](modules/MapGen.Triangle.md)
|
||||||
|
- [MapGen.Triangulation](modules/MapGen.Triangulation.md)
|
||||||
|
- [MapGen.Triangulation.Edge](modules/MapGen.Triangulation.Edge.md)
|
||||||
|
- [MapGen.Triangulation.FakePeak](modules/MapGen.Triangulation.FakePeak.md)
|
||||||
|
- [MapGen.ff2luat](modules/MapGen.ff2luat.md)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
85
docs/docs/modules/MapGen.Biome.GroundNodes.md
Normal file
85
docs/docs/modules/MapGen.Biome.GroundNodes.md
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
# global MapGen.Biome.GroundNodes
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### GroundNodes.turf
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
GroundNodes.turf : string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
The soil covering the surface of the biome
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### GroundNodes.soil
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
GroundNodes.soil : string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
The soil beneath the turf. The height of this layer depends on `Biome.soilHeight`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### GroundNodes.rock
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
GroundNodes.rock : string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
The rock found beneath the soil of a biome.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### GroundNodes.bottom
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
GroundNodes.bottom : string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Covering the bottom of reservoirs.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
85
docs/docs/modules/MapGen.Biome.GroundNodesIds.md
Normal file
85
docs/docs/modules/MapGen.Biome.GroundNodesIds.md
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
# global MapGen.Biome.GroundNodesIds
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### GroundNodesIDs.turf
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
GroundNodesIDs.turf : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
The soil covering the surface of the biome
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### GroundNodesIDs.soil
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
GroundNodesIDs.soil : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
The soil beneath the turf. The height of this layer depends on `Biome.soilHeight`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### GroundNodesIDs.rock
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
GroundNodesIDs.rock : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
The rock found beneath the soil of a biome.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### GroundNodesIDs.bottom
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
GroundNodesIDs.bottom : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Covering the bottom of reservoirs.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
307
docs/docs/modules/MapGen.Biome.md
Normal file
307
docs/docs/modules/MapGen.Biome.md
Normal file
@@ -0,0 +1,307 @@
|
|||||||
|
# global MapGen.Biome
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## methods
|
||||||
|
---
|
||||||
|
|
||||||
|
### Biome.new
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Biome.new(
|
||||||
|
name: string,
|
||||||
|
def: MapGen.BiomeDef {
|
||||||
|
tempPoint = number,
|
||||||
|
humidityPoint = number,
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
groundNodes = MapGen.Biome.GroundNodes,
|
||||||
|
soilHeight = number,
|
||||||
|
generateAir = generateFunc?,
|
||||||
|
generateCavernAir = generateFunc?,
|
||||||
|
generateWater = generateFunc?,
|
||||||
|
generateRock = generateFunc?,
|
||||||
|
generateTurf = generateFunc?,
|
||||||
|
generateSoil = generateFunc?,
|
||||||
|
generateBottom = generateFunc?,
|
||||||
|
}
|
||||||
|
) -> MapGen.Biome {
|
||||||
|
name = string,
|
||||||
|
tempPoint = number,
|
||||||
|
humidityPoint = number,
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
groundNodes = MapGen.Biome.GroundNodes,
|
||||||
|
groundNodesIDs = MapGen.Biome.GroundNodesIDs,
|
||||||
|
soilHeight = number,
|
||||||
|
generateAir = generateFunc,
|
||||||
|
generateCavernAir = generateFunc,
|
||||||
|
generateWater = generateFunc,
|
||||||
|
generateRock = generateFunc,
|
||||||
|
generateTurf = generateFunc,
|
||||||
|
generateSoil = generateFunc,
|
||||||
|
generateBottom = generateFunc,
|
||||||
|
new = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### Biome.name
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.name : string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.tempPoint
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.tempPoint : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.humidityPoint
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.humidityPoint : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.minY
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.minY : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.maxY
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.maxY : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.groundNodes
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.groundNodes : MapGen.Biome.GroundNodes {
|
||||||
|
turf: string,
|
||||||
|
soil: string,
|
||||||
|
rock: string,
|
||||||
|
bottom: string,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.groundNodesIDs
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.groundNodesIDs : MapGen.Biome.GroundNodesIDs {
|
||||||
|
turf: number,
|
||||||
|
soil: number,
|
||||||
|
rock: number,
|
||||||
|
bottom: number,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.soilHeight
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.soilHeight : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.generateAir
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.generateAir : generateFunc
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.generateCavernAir
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.generateCavernAir : generateFunc
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.generateWater
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.generateWater : generateFunc
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.generateRock
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.generateRock : generateFunc
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.generateTurf
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.generateTurf : generateFunc
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.generateSoil
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.generateSoil : generateFunc
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.generateBottom
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.generateBottom : generateFunc
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
203
docs/docs/modules/MapGen.Cavern.md
Normal file
203
docs/docs/modules/MapGen.Cavern.md
Normal file
@@ -0,0 +1,203 @@
|
|||||||
|
# global MapGen.Cavern
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## methods
|
||||||
|
---
|
||||||
|
|
||||||
|
### Cavern.getNoise
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Cavern.getNoise()-> ValueNoise
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Cavern.initNoise
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Cavern.initNoise()-> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Cavern.getGroups
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Cavern.getGroups()
|
||||||
|
-> table<string,number>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Cavern.new
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Cavern.new(
|
||||||
|
name: string,
|
||||||
|
def: MapGen.CavernDef {
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
noiseParams = NoiseParams,
|
||||||
|
smoothDistance = number,
|
||||||
|
threshold = number?,
|
||||||
|
groups = table<string,number>?,
|
||||||
|
}
|
||||||
|
) -> MapGen.Cavern {
|
||||||
|
name = string,
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
smoothDistance = number,
|
||||||
|
threshold = number,
|
||||||
|
getNoise = function,
|
||||||
|
initNoise = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
isCavern = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Cavern.isCavern
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Cavern.isCavern(
|
||||||
|
x: integer,
|
||||||
|
y: integer,
|
||||||
|
z: integer
|
||||||
|
) -> boolean
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns `true` if there is a cavern at the specified coordinates.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### Cavern.name
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Cavern.name : string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Cavern.minY
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Cavern.minY : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Cavern.maxY
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Cavern.maxY : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Cavern.smoothDistance
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Cavern.smoothDistance : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Cavern.threshold
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Cavern.threshold : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
36
docs/docs/modules/MapGen.Decoration.md
Normal file
36
docs/docs/modules/MapGen.Decoration.md
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
# global MapGen.Decoration
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## methods
|
||||||
|
---
|
||||||
|
|
||||||
|
### Decoration.new
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Decoration.new() -> MapGen.Decoration {
|
||||||
|
new = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
673
docs/docs/modules/MapGen.Layer.md
Normal file
673
docs/docs/modules/MapGen.Layer.md
Normal file
@@ -0,0 +1,673 @@
|
|||||||
|
# global MapGen.Layer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## methods
|
||||||
|
---
|
||||||
|
|
||||||
|
### Layer.calcTemp
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Layer.calcTemp(
|
||||||
|
self: MapGen.Layer {
|
||||||
|
name = string,
|
||||||
|
minY = integer,
|
||||||
|
maxY = integer,
|
||||||
|
minTemp = integer,
|
||||||
|
maxTemp = integer,
|
||||||
|
minHumidity = integer,
|
||||||
|
maxHumidity = integer,
|
||||||
|
waterLevel = integer,
|
||||||
|
peaksList = { humidity: MapGen.Peak[], landscape: MapGen.Peak[], temp: MapGen.Peak[] },
|
||||||
|
noisesByColor = { humidity: table<ColorString,ValueNoise>, landscape: table<ColorString,ValueNoise>, temp: table<ColorString,ValueNoise> },
|
||||||
|
noisesParamsByColor = { humidity: table<ColorString,NoiseParams>, landscape: table<ColorString,NoiseParams>, temp: table<ColorString,NoiseParams> },
|
||||||
|
biomesByName = table<string,MapGen.Biome>,
|
||||||
|
biomesList = MapGen.Biome[],
|
||||||
|
biomesDiagram = table,
|
||||||
|
biomesGorizontalScattering = integer,
|
||||||
|
biomesVerticalScattering = integer,
|
||||||
|
cavernsByName = table<string,MapGen.Cavern>,
|
||||||
|
cavernsList = MapGen.Cavern[],
|
||||||
|
trianglesList = { humidity: MapGen.Triangle[], landscape: MapGen.Triangle[], temp: MapGen.Triangle[] },
|
||||||
|
tetrahedronsList = MapGen.Tetrahedron[],
|
||||||
|
calcTemp = function,
|
||||||
|
calcHumidity = function,
|
||||||
|
new = function,
|
||||||
|
addPeak = function,
|
||||||
|
addNoiseParamsColor = function,
|
||||||
|
getNoiseByColor = function,
|
||||||
|
addBiome = function,
|
||||||
|
addCavern = function,
|
||||||
|
initNoises = function,
|
||||||
|
initBiomesDiagram = function,
|
||||||
|
},
|
||||||
|
value: number,
|
||||||
|
height: number
|
||||||
|
)-> number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.calcHumidity
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Layer.calcHumidity(
|
||||||
|
self: MapGen.Layer {
|
||||||
|
name = string,
|
||||||
|
minY = integer,
|
||||||
|
maxY = integer,
|
||||||
|
minTemp = integer,
|
||||||
|
maxTemp = integer,
|
||||||
|
minHumidity = integer,
|
||||||
|
maxHumidity = integer,
|
||||||
|
waterLevel = integer,
|
||||||
|
peaksList = { humidity: MapGen.Peak[], landscape: MapGen.Peak[], temp: MapGen.Peak[] },
|
||||||
|
noisesByColor = { humidity: table<ColorString,ValueNoise>, landscape: table<ColorString,ValueNoise>, temp: table<ColorString,ValueNoise> },
|
||||||
|
noisesParamsByColor = { humidity: table<ColorString,NoiseParams>, landscape: table<ColorString,NoiseParams>, temp: table<ColorString,NoiseParams> },
|
||||||
|
biomesByName = table<string,MapGen.Biome>,
|
||||||
|
biomesList = MapGen.Biome[],
|
||||||
|
biomesDiagram = table,
|
||||||
|
biomesGorizontalScattering = integer,
|
||||||
|
biomesVerticalScattering = integer,
|
||||||
|
cavernsByName = table<string,MapGen.Cavern>,
|
||||||
|
cavernsList = MapGen.Cavern[],
|
||||||
|
trianglesList = { humidity: MapGen.Triangle[], landscape: MapGen.Triangle[], temp: MapGen.Triangle[] },
|
||||||
|
tetrahedronsList = MapGen.Tetrahedron[],
|
||||||
|
calcTemp = function,
|
||||||
|
calcHumidity = function,
|
||||||
|
new = function,
|
||||||
|
addPeak = function,
|
||||||
|
addNoiseParamsColor = function,
|
||||||
|
getNoiseByColor = function,
|
||||||
|
addBiome = function,
|
||||||
|
addCavern = function,
|
||||||
|
initNoises = function,
|
||||||
|
initBiomesDiagram = function,
|
||||||
|
},
|
||||||
|
value: number,
|
||||||
|
height: number
|
||||||
|
)-> number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.new
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Layer.new(
|
||||||
|
name: string,
|
||||||
|
def: MapGen.LayerDef {
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
minTemp = number,
|
||||||
|
maxTemp = number,
|
||||||
|
minHumidity = number,
|
||||||
|
maxHumidity = number,
|
||||||
|
waterLevel = number?,
|
||||||
|
calcTemp = (fun(self: MapGen.Layer, value: number, height: number) -> number)?,
|
||||||
|
calcHumidity = (fun(self: MapGen.Layer, value: number, height: number) -> number)?,
|
||||||
|
biomesGorizontalScattering = number?,
|
||||||
|
biomesVerticalScattering = number?,
|
||||||
|
}
|
||||||
|
) -> MapGen.Layer {
|
||||||
|
name = string,
|
||||||
|
minY = integer,
|
||||||
|
maxY = integer,
|
||||||
|
minTemp = integer,
|
||||||
|
maxTemp = integer,
|
||||||
|
minHumidity = integer,
|
||||||
|
maxHumidity = integer,
|
||||||
|
waterLevel = integer,
|
||||||
|
peaksList = { humidity: MapGen.Peak[], landscape: MapGen.Peak[], temp: MapGen.Peak[] },
|
||||||
|
noisesByColor = { humidity: table<ColorString,ValueNoise>, landscape: table<ColorString,ValueNoise>, temp: table<ColorString,ValueNoise> },
|
||||||
|
noisesParamsByColor = { humidity: table<ColorString,NoiseParams>, landscape: table<ColorString,NoiseParams>, temp: table<ColorString,NoiseParams> },
|
||||||
|
biomesByName = table<string,MapGen.Biome>,
|
||||||
|
biomesList = MapGen.Biome[],
|
||||||
|
biomesDiagram = table,
|
||||||
|
biomesGorizontalScattering = integer,
|
||||||
|
biomesVerticalScattering = integer,
|
||||||
|
cavernsByName = table<string,MapGen.Cavern>,
|
||||||
|
cavernsList = MapGen.Cavern[],
|
||||||
|
trianglesList = { humidity: MapGen.Triangle[], landscape: MapGen.Triangle[], temp: MapGen.Triangle[] },
|
||||||
|
tetrahedronsList = MapGen.Tetrahedron[],
|
||||||
|
calcTemp = function,
|
||||||
|
calcHumidity = function,
|
||||||
|
new = function,
|
||||||
|
addPeak = function,
|
||||||
|
addNoiseParamsColor = function,
|
||||||
|
getNoiseByColor = function,
|
||||||
|
addBiome = function,
|
||||||
|
addCavern = function,
|
||||||
|
initNoises = function,
|
||||||
|
initBiomesDiagram = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.addPeak
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Layer.addPeak(
|
||||||
|
category: MapGen.Layer.Category,
|
||||||
|
peak: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
}
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Adds a peak to the `Layer.peaksList`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.addNoiseParamsColor
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Layer.addNoiseParamsColor(
|
||||||
|
category: MapGen.Layer.Category,
|
||||||
|
color: ColorString,
|
||||||
|
noiseParams: NoiseParams
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Adds a NoiseParams color to the `Layer.noisesParamsByColor`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.getNoiseByColor
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Layer.getNoiseByColor(
|
||||||
|
category: MapGen.Layer.Category,
|
||||||
|
color: ColorString
|
||||||
|
) -> ValueNoise
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns noise corresponding to a color.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.addBiome
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Layer.addBiome(
|
||||||
|
biomeName: string,
|
||||||
|
biome: MapGen.Biome {
|
||||||
|
name = string,
|
||||||
|
tempPoint = number,
|
||||||
|
humidityPoint = number,
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
groundNodes = MapGen.Biome.GroundNodes,
|
||||||
|
groundNodesIDs = MapGen.Biome.GroundNodesIDs,
|
||||||
|
soilHeight = number,
|
||||||
|
generateAir = generateFunc,
|
||||||
|
generateCavernAir = generateFunc,
|
||||||
|
generateWater = generateFunc,
|
||||||
|
generateRock = generateFunc,
|
||||||
|
generateTurf = generateFunc,
|
||||||
|
generateSoil = generateFunc,
|
||||||
|
generateBottom = generateFunc,
|
||||||
|
new = function,
|
||||||
|
}
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Adds a biome to the `Layer.biomesByName` & `Layer.biomesList`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.addCavern
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Layer.addCavern(
|
||||||
|
cavernName: string,
|
||||||
|
cavern: MapGen.Cavern {
|
||||||
|
name = string,
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
smoothDistance = number,
|
||||||
|
threshold = number,
|
||||||
|
getNoise = function,
|
||||||
|
initNoise = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
isCavern = function,
|
||||||
|
}
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Adds a cavern to the `Layer.cavernsByName` & `Layer.cavernsList`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.initNoises
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Layer.initNoises() -> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Initializes noise for generation.
|
||||||
|
|
||||||
|
Should only be called after the mapgen object has been loaded.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.initBiomesDiagram
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Layer.initBiomesDiagram() -> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Initialization of the biome diagram using the Voronoi method.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### Layer.name
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.name : string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.minY
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.minY : integer
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.maxY
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.maxY : integer
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.minTemp
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.minTemp : integer
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.maxTemp
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.maxTemp : integer
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.minHumidity
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.minHumidity : integer
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.maxHumidity
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.maxHumidity : integer
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.waterLevel
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.waterLevel : integer
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.peaksList
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.peaksList : { humidity: MapGen.Peak[], landscape: MapGen.Peak[], temp: MapGen.Peak[] }
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.noisesByColor
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.noisesByColor : { humidity: table<ColorString,ValueNoise>, landscape: table<ColorString,ValueNoise>, temp: table<ColorString,ValueNoise> }
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.noisesParamsByColor
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.noisesParamsByColor : { humidity: table<ColorString,NoiseParams>, landscape: table<ColorString,NoiseParams>, temp: table<ColorString,NoiseParams> }
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.biomesByName
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.biomesByName : table<string,MapGen.Biome>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.biomesList
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.biomesList : MapGen.Biome[]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.biomesDiagram
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.biomesDiagram : table
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.biomesGorizontalScattering
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.biomesGorizontalScattering : integer
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.biomesVerticalScattering
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.biomesVerticalScattering : integer
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.cavernsByName
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.cavernsByName : table<string,MapGen.Cavern>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.cavernsList
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.cavernsList : MapGen.Cavern[]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.trianglesList
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.trianglesList : { humidity: MapGen.Triangle[], landscape: MapGen.Triangle[], temp: MapGen.Triangle[] }
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.tetrahedronsList
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.tetrahedronsList : MapGen.Tetrahedron[]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
**Not supported**
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
157
docs/docs/modules/MapGen.Peak.md
Normal file
157
docs/docs/modules/MapGen.Peak.md
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
# global MapGen.Peak
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## methods
|
||||||
|
---
|
||||||
|
|
||||||
|
### Peak.getPeakPos
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Peak.getPeakPos(self)-> vector
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Peak.getColor
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Peak.getColor(self)-> ColorString
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Peak.getGroups
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Peak.getGroups(self)
|
||||||
|
-> table<string,number>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Peak.new
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Peak.new(def: MapGen.PeakDef {
|
||||||
|
pos = vector,
|
||||||
|
color = ColorString,
|
||||||
|
groups = table<string,number>?,
|
||||||
|
}) -> MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Peak.toString
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Peak.toString() -> string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns a string describing the object in a readable form.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Peak.eq
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Peak.eq(other: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
}) -> boolean
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns true if the peaks are equivalent.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### Peak.id
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Peak.id : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
144
docs/docs/modules/MapGen.StaticLayer.md
Normal file
144
docs/docs/modules/MapGen.StaticLayer.md
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
# global MapGen.StaticLayer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## methods
|
||||||
|
---
|
||||||
|
|
||||||
|
### StaticLayer.new
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function StaticLayer.new(
|
||||||
|
name: string,
|
||||||
|
def: MapGen.StaticLayerDef {
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
staticNode = string,
|
||||||
|
generateStaticNode = generateFunc,
|
||||||
|
}
|
||||||
|
) -> MapGen.StaticLayer {
|
||||||
|
name = string,
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
staticNode = string,
|
||||||
|
staticNodeID = number,
|
||||||
|
generateStaticNode = generateFunc,
|
||||||
|
new = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### StaticLayer.name
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
StaticLayer.name : string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### StaticLayer.minY
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
StaticLayer.minY : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### StaticLayer.maxY
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
StaticLayer.maxY : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### StaticLayer.staticNode
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
StaticLayer.staticNode : string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### StaticLayer.staticNodeID
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
StaticLayer.staticNodeID : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### StaticLayer.generateStaticNode
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
StaticLayer.generateStaticNode : generateFunc
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
536
docs/docs/modules/MapGen.Tetrahedron.md
Normal file
536
docs/docs/modules/MapGen.Tetrahedron.md
Normal file
@@ -0,0 +1,536 @@
|
|||||||
|
# global MapGen.Tetrahedron
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## methods
|
||||||
|
---
|
||||||
|
|
||||||
|
### Tetrahedron.new
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Tetrahedron.new(
|
||||||
|
p1: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p2: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p3: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p4: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
}
|
||||||
|
) -> MapGen.Tetrahedron {
|
||||||
|
p1 = MapGen.Peak,
|
||||||
|
p2 = MapGen.Peak,
|
||||||
|
p3 = MapGen.Peak,
|
||||||
|
p4 = MapGen.Peak,
|
||||||
|
h1 = MapGen.Triangulation.Edge,
|
||||||
|
h2 = MapGen.Triangulation.Edge,
|
||||||
|
h3 = MapGen.Triangulation.Edge,
|
||||||
|
h4 = MapGen.Triangulation.Edge,
|
||||||
|
f1 = MapGen.Triangle,
|
||||||
|
f2 = MapGen.Triangle,
|
||||||
|
f3 = MapGen.Triangle,
|
||||||
|
f4 = MapGen.Triangle,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
getHeight = function,
|
||||||
|
getCircumSphereCenter = function,
|
||||||
|
getCircumSphereRadius = function,
|
||||||
|
inCircumSphere = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.toString
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Tetrahedron.toString() -> string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns a string describing the object in a readable form.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.getHeight
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Tetrahedron.getHeight(
|
||||||
|
p1: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p2: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p3: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p4: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
}
|
||||||
|
) -> MapGen.Triangulation.Edge?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.getCircumSphereCenter
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Tetrahedron.getCircumSphereCenter() -> vector
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the center of the circumscribed sphere.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.getCircumSphereRadius
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Tetrahedron.getCircumSphereRadius() -> number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the radius of the circumscribed sphere.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.inCircumSphere
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Tetrahedron.inCircumSphere(p: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
}) -> boolean
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Checks whether a given point lies within the circumscribed sphere of a tetrahedron.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### Tetrahedron.p1
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Tetrahedron.p1 : MapGen.Peak {
|
||||||
|
id: number,
|
||||||
|
getPeakPos: function,
|
||||||
|
getColor: function,
|
||||||
|
getGroups: function,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.p2
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Tetrahedron.p2 : MapGen.Peak {
|
||||||
|
id: number,
|
||||||
|
getPeakPos: function,
|
||||||
|
getColor: function,
|
||||||
|
getGroups: function,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.p3
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Tetrahedron.p3 : MapGen.Peak {
|
||||||
|
id: number,
|
||||||
|
getPeakPos: function,
|
||||||
|
getColor: function,
|
||||||
|
getGroups: function,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.p4
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Tetrahedron.p4 : MapGen.Peak {
|
||||||
|
id: number,
|
||||||
|
getPeakPos: function,
|
||||||
|
getColor: function,
|
||||||
|
getGroups: function,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.h1
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Tetrahedron.h1 : MapGen.Triangulation.Edge {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
same: function,
|
||||||
|
length: function,
|
||||||
|
getMidPoint: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.h2
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Tetrahedron.h2 : MapGen.Triangulation.Edge {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
same: function,
|
||||||
|
length: function,
|
||||||
|
getMidPoint: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.h3
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Tetrahedron.h3 : MapGen.Triangulation.Edge {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
same: function,
|
||||||
|
length: function,
|
||||||
|
getMidPoint: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.h4
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Tetrahedron.h4 : MapGen.Triangulation.Edge {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
same: function,
|
||||||
|
length: function,
|
||||||
|
getMidPoint: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.f1
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Tetrahedron.f1 : MapGen.Triangle {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
p3: MapGen.Peak,
|
||||||
|
e1: MapGen.Triangulation.Edge,
|
||||||
|
e2: MapGen.Triangulation.Edge,
|
||||||
|
e3: MapGen.Triangulation.Edge,
|
||||||
|
h1: MapGen.Triangulation.Edge,
|
||||||
|
h2: MapGen.Triangulation.Edge,
|
||||||
|
h3: MapGen.Triangulation.Edge,
|
||||||
|
neighbours: MapGen.Triangle.Neighbours,
|
||||||
|
color: ColorString?,
|
||||||
|
new: function,
|
||||||
|
...(+13)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.f2
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Tetrahedron.f2 : MapGen.Triangle {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
p3: MapGen.Peak,
|
||||||
|
e1: MapGen.Triangulation.Edge,
|
||||||
|
e2: MapGen.Triangulation.Edge,
|
||||||
|
e3: MapGen.Triangulation.Edge,
|
||||||
|
h1: MapGen.Triangulation.Edge,
|
||||||
|
h2: MapGen.Triangulation.Edge,
|
||||||
|
h3: MapGen.Triangulation.Edge,
|
||||||
|
neighbours: MapGen.Triangle.Neighbours,
|
||||||
|
color: ColorString?,
|
||||||
|
new: function,
|
||||||
|
...(+13)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.f3
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Tetrahedron.f3 : MapGen.Triangle {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
p3: MapGen.Peak,
|
||||||
|
e1: MapGen.Triangulation.Edge,
|
||||||
|
e2: MapGen.Triangulation.Edge,
|
||||||
|
e3: MapGen.Triangulation.Edge,
|
||||||
|
h1: MapGen.Triangulation.Edge,
|
||||||
|
h2: MapGen.Triangulation.Edge,
|
||||||
|
h3: MapGen.Triangulation.Edge,
|
||||||
|
neighbours: MapGen.Triangle.Neighbours,
|
||||||
|
color: ColorString?,
|
||||||
|
new: function,
|
||||||
|
...(+13)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.f4
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Tetrahedron.f4 : MapGen.Triangle {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
p3: MapGen.Peak,
|
||||||
|
e1: MapGen.Triangulation.Edge,
|
||||||
|
e2: MapGen.Triangulation.Edge,
|
||||||
|
e3: MapGen.Triangulation.Edge,
|
||||||
|
h1: MapGen.Triangulation.Edge,
|
||||||
|
h2: MapGen.Triangulation.Edge,
|
||||||
|
h3: MapGen.Triangulation.Edge,
|
||||||
|
neighbours: MapGen.Triangle.Neighbours,
|
||||||
|
color: ColorString?,
|
||||||
|
new: function,
|
||||||
|
...(+13)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
745
docs/docs/modules/MapGen.Triangle.md
Normal file
745
docs/docs/modules/MapGen.Triangle.md
Normal file
@@ -0,0 +1,745 @@
|
|||||||
|
# global MapGen.Triangle
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## methods
|
||||||
|
---
|
||||||
|
|
||||||
|
### Triangle.new
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.new(
|
||||||
|
p1: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p2: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p3: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
}
|
||||||
|
) -> MapGen.Triangle {
|
||||||
|
p1 = MapGen.Peak,
|
||||||
|
p2 = MapGen.Peak,
|
||||||
|
p3 = MapGen.Peak,
|
||||||
|
e1 = MapGen.Triangulation.Edge,
|
||||||
|
e2 = MapGen.Triangulation.Edge,
|
||||||
|
e3 = MapGen.Triangulation.Edge,
|
||||||
|
h1 = MapGen.Triangulation.Edge,
|
||||||
|
h2 = MapGen.Triangulation.Edge,
|
||||||
|
h3 = MapGen.Triangulation.Edge,
|
||||||
|
neighbours = MapGen.Triangle.Neighbours,
|
||||||
|
color = ColorString?,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
same = function,
|
||||||
|
getCenter = function,
|
||||||
|
getArea = function,
|
||||||
|
getHeight = function,
|
||||||
|
getHeight2D = function,
|
||||||
|
getSidesLength = function,
|
||||||
|
getSidesLength2D = function,
|
||||||
|
getCircumCenter2D = function,
|
||||||
|
getCircumRadius2D = function,
|
||||||
|
getCircumCircle2D = function,
|
||||||
|
inCircumCircle2D = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.toString
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.toString() -> string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns a string describing the object in a readable form.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.eq
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.eq(other: MapGen.Triangle {
|
||||||
|
p1 = MapGen.Peak,
|
||||||
|
p2 = MapGen.Peak,
|
||||||
|
p3 = MapGen.Peak,
|
||||||
|
e1 = MapGen.Triangulation.Edge,
|
||||||
|
e2 = MapGen.Triangulation.Edge,
|
||||||
|
e3 = MapGen.Triangulation.Edge,
|
||||||
|
h1 = MapGen.Triangulation.Edge,
|
||||||
|
h2 = MapGen.Triangulation.Edge,
|
||||||
|
h3 = MapGen.Triangulation.Edge,
|
||||||
|
neighbours = MapGen.Triangle.Neighbours,
|
||||||
|
color = ColorString?,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
same = function,
|
||||||
|
getCenter = function,
|
||||||
|
getArea = function,
|
||||||
|
getHeight = function,
|
||||||
|
getHeight2D = function,
|
||||||
|
getSidesLength = function,
|
||||||
|
getSidesLength2D = function,
|
||||||
|
getCircumCenter2D = function,
|
||||||
|
getCircumRadius2D = function,
|
||||||
|
getCircumCircle2D = function,
|
||||||
|
inCircumCircle2D = function,
|
||||||
|
}) -> boolean
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns true if the triangles are equivalent.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.same
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.same(other: MapGen.Triangle {
|
||||||
|
p1 = MapGen.Peak,
|
||||||
|
p2 = MapGen.Peak,
|
||||||
|
p3 = MapGen.Peak,
|
||||||
|
e1 = MapGen.Triangulation.Edge,
|
||||||
|
e2 = MapGen.Triangulation.Edge,
|
||||||
|
e3 = MapGen.Triangulation.Edge,
|
||||||
|
h1 = MapGen.Triangulation.Edge,
|
||||||
|
h2 = MapGen.Triangulation.Edge,
|
||||||
|
h3 = MapGen.Triangulation.Edge,
|
||||||
|
neighbours = MapGen.Triangle.Neighbours,
|
||||||
|
color = ColorString?,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
same = function,
|
||||||
|
getCenter = function,
|
||||||
|
getArea = function,
|
||||||
|
getHeight = function,
|
||||||
|
getHeight2D = function,
|
||||||
|
getSidesLength = function,
|
||||||
|
getSidesLength2D = function,
|
||||||
|
getCircumCenter2D = function,
|
||||||
|
getCircumRadius2D = function,
|
||||||
|
getCircumCircle2D = function,
|
||||||
|
inCircumCircle2D = function,
|
||||||
|
}) -> boolean
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns true if the triangles are similar.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.getCenter
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.getCenter() -> vector
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the coordinates of the triangle's center.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.getArea
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.getArea() -> number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the area of a triangle.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.getHeight
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.getHeight(
|
||||||
|
p1: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p2: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p3: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
}
|
||||||
|
) -> MapGen.Triangulation.Edge {
|
||||||
|
p1 = MapGen.Peak,
|
||||||
|
p2 = MapGen.Peak,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
same = function,
|
||||||
|
length = function,
|
||||||
|
getMidPoint = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the perpendicular from the vertex Peak1 to the line Peak2-Peak3.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.getHeight2D
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.getHeight2D(
|
||||||
|
p1: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p2: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p3: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
}
|
||||||
|
) -> MapGen.Triangulation.Edge {
|
||||||
|
p1 = MapGen.Peak,
|
||||||
|
p2 = MapGen.Peak,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
same = function,
|
||||||
|
length = function,
|
||||||
|
getMidPoint = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the perpendicular from the vertex Peak1 to the line Peak2-Peak3.
|
||||||
|
|
||||||
|
Note: This function does not take into account the Y-coordinate,
|
||||||
|
that is, the calculation is performed on the projection of the triangle XZ.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.getSidesLength
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.getSidesLength()
|
||||||
|
-> number
|
||||||
|
-> number
|
||||||
|
-> number
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the length of the edges
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.getSidesLength2D
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.getSidesLength2D()
|
||||||
|
-> number
|
||||||
|
-> number
|
||||||
|
-> number
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the length of the edges.
|
||||||
|
|
||||||
|
Note: This function does not take into account the Y-coordinate,
|
||||||
|
that is, the calculation is performed on the projection of the triangle XZ.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.getCircumCenter2D
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.getCircumCenter2D() -> vector
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the coordinates of the circumcircle center.
|
||||||
|
|
||||||
|
Note: This function does not take into account the Y-coordinate,
|
||||||
|
that is, the calculation is performed on the projection of the triangle XZ.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.getCircumRadius2D
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.getCircumRadius2D() -> number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the radius of the circumcircle.
|
||||||
|
|
||||||
|
Note: This function does not take into account the Y-coordinate,
|
||||||
|
that is, the calculation is performed on the projection of the triangle XZ.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.getCircumCircle2D
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.getCircumCircle2D()
|
||||||
|
-> vector
|
||||||
|
-> number
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the coordinates of the circumcircle center and its radius.
|
||||||
|
|
||||||
|
Note: This function does not take into account the Y-coordinate,
|
||||||
|
that is, the calculation is performed on the projection of the triangle XZ.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.inCircumCircle2D
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.inCircumCircle2D(p: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
}) -> boolean
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Checks if a given point lies into the triangle circumcircle.
|
||||||
|
|
||||||
|
Note: This function does not take into account the Y-coordinate,
|
||||||
|
that is, the calculation is performed on the projection of the triangle XZ.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### Triangle.p1
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Triangle.p1 : MapGen.Peak {
|
||||||
|
id: number,
|
||||||
|
getPeakPos: function,
|
||||||
|
getColor: function,
|
||||||
|
getGroups: function,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.p2
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Triangle.p2 : MapGen.Peak {
|
||||||
|
id: number,
|
||||||
|
getPeakPos: function,
|
||||||
|
getColor: function,
|
||||||
|
getGroups: function,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.p3
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Triangle.p3 : MapGen.Peak {
|
||||||
|
id: number,
|
||||||
|
getPeakPos: function,
|
||||||
|
getColor: function,
|
||||||
|
getGroups: function,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.e1
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Triangle.e1 : MapGen.Triangulation.Edge {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
same: function,
|
||||||
|
length: function,
|
||||||
|
getMidPoint: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.e2
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Triangle.e2 : MapGen.Triangulation.Edge {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
same: function,
|
||||||
|
length: function,
|
||||||
|
getMidPoint: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.e3
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Triangle.e3 : MapGen.Triangulation.Edge {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
same: function,
|
||||||
|
length: function,
|
||||||
|
getMidPoint: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.h1
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Triangle.h1 : MapGen.Triangulation.Edge {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
same: function,
|
||||||
|
length: function,
|
||||||
|
getMidPoint: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.h2
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Triangle.h2 : MapGen.Triangulation.Edge {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
same: function,
|
||||||
|
length: function,
|
||||||
|
getMidPoint: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.h3
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Triangle.h3 : MapGen.Triangulation.Edge {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
same: function,
|
||||||
|
length: function,
|
||||||
|
getMidPoint: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.neighbours
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Triangle.neighbours : MapGen.Triangle.Neighbours
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.color
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Triangle.color : ColorString?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
225
docs/docs/modules/MapGen.Triangulation.Edge.md
Normal file
225
docs/docs/modules/MapGen.Triangulation.Edge.md
Normal file
@@ -0,0 +1,225 @@
|
|||||||
|
# global MapGen.Triangulation.Edge
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## methods
|
||||||
|
---
|
||||||
|
|
||||||
|
### Edge.new
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Edge.new(
|
||||||
|
p1: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p2: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
}
|
||||||
|
) -> MapGen.Triangulation.Edge {
|
||||||
|
p1 = MapGen.Peak,
|
||||||
|
p2 = MapGen.Peak,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
same = function,
|
||||||
|
length = function,
|
||||||
|
getMidPoint = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Edge.toString
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Edge.toString() -> string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns a string describing the object in a readable form.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Edge.eq
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Edge.eq(other: MapGen.Triangulation.Edge {
|
||||||
|
p1 = MapGen.Peak,
|
||||||
|
p2 = MapGen.Peak,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
same = function,
|
||||||
|
length = function,
|
||||||
|
getMidPoint = function,
|
||||||
|
}) -> boolean
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns true if the edges are equivalent.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Edge.same
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Edge.same(other: MapGen.Triangulation.Edge {
|
||||||
|
p1 = MapGen.Peak,
|
||||||
|
p2 = MapGen.Peak,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
same = function,
|
||||||
|
length = function,
|
||||||
|
getMidPoint = function,
|
||||||
|
}) -> boolean
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns true if the edges are similar.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Edge.length
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Edge.length() -> number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the length of an edge.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Edge.getMidPoint
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Edge.getMidPoint() -> vector
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the vector of the point located in the middle of the edge.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### Edge.p1
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Edge.p1 : MapGen.Peak {
|
||||||
|
id: number,
|
||||||
|
getPeakPos: function,
|
||||||
|
getColor: function,
|
||||||
|
getGroups: function,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Edge.p2
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Edge.p2 : MapGen.Peak {
|
||||||
|
id: number,
|
||||||
|
getPeakPos: function,
|
||||||
|
getColor: function,
|
||||||
|
getGroups: function,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
79
docs/docs/modules/MapGen.Triangulation.FakePeak.md
Normal file
79
docs/docs/modules/MapGen.Triangulation.FakePeak.md
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
# global MapGen.Triangulation.FakePeak
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## methods
|
||||||
|
---
|
||||||
|
|
||||||
|
### FakePeak.getPeakPos
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function FakePeak.getPeakPos()-> vector
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### FakePeak.new
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function FakePeak.new(peakPos: vector) -> MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns a fake `MapGen.Peak` that has no noise parameters.
|
||||||
|
Note that the initialized peak should not be used in generation.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### FakePeak.id
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
FakePeak.id : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
81
docs/docs/modules/MapGen.Triangulation.md
Normal file
81
docs/docs/modules/MapGen.Triangulation.md
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
# global MapGen.Triangulation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## methods
|
||||||
|
---
|
||||||
|
|
||||||
|
### Triangulation.triangulate
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangulation.triangulate(vertices: table<integer,MapGen.Peak>) -> ((MapGen.Triangle)|MapGen.Triangle[])
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
The Delaunay method divides a plane into triangles based on a list of their vertices.
|
||||||
|
|
||||||
|
Doesn't take into account the Y coordinate of the vertices.
|
||||||
|
That is, all triangles that don't lie in the XZ plane will be projected onto it.
|
||||||
|
|
||||||
|
Vertices that do not have a `is2d` group will not participate in the triangulation.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangulation.tetrahedralize
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangulation.tetrahedralize(vertices: table<integer,MapGen.Peak>) -> ((MapGen.Tetrahedron)|MapGen.Tetrahedron[])
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
The Delaunay method divides space into tetrahedra based on a list of their vertices.
|
||||||
|
|
||||||
|
Vertices that do not have a `is3d` group will not participate in the triangulation.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### Triangulation.convexMultiplier
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Triangulation.convexMultiplier : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
30
docs/docs/modules/MapGen.ff2luat.md
Normal file
30
docs/docs/modules/MapGen.ff2luat.md
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# global MapGen.ff2luat
|
||||||
|
|
||||||
|
|
||||||
|
Converts given farbfeld image to ColoredDotsTable.
|
||||||
|
Farbfeld format:
|
||||||
|
```
|
||||||
|
╔════════╤═════════════════════════════════════════════════════════╗
|
||||||
|
║ Bytes │ Description ║
|
||||||
|
╠════════╪═════════════════════════════════════════════════════════╣
|
||||||
|
║ 8 │ 'farbfeld' magic value ║
|
||||||
|
╟────────┼─────────────────────────────────────────────────────────╢
|
||||||
|
║ 4 │ 32-Bit BE unsigned integer (width) ║
|
||||||
|
╟────────┼─────────────────────────────────────────────────────────╢
|
||||||
|
║ 4 │ 32-Bit BE unsigned integer (height) ║
|
||||||
|
╟────────┼─────────────────────────────────────────────────────────╢
|
||||||
|
║ [2222] │ 4x16-Bit BE unsigned integers [RGBA] / pixel, row-major ║
|
||||||
|
╚════════╧═════════════════════════════════════════════════════════╝
|
||||||
|
```
|
||||||
|
[tools/farbfeld | suckless.org software that sucks less](https://tools.suckless.org/farbfeld/)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
738
docs/docs/modules/MapGen.md
Normal file
738
docs/docs/modules/MapGen.md
Normal file
@@ -0,0 +1,738 @@
|
|||||||
|
# global MapGen
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## methods
|
||||||
|
---
|
||||||
|
|
||||||
|
### MapGen.new
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.new(def: MapGenDef {
|
||||||
|
nodes = table<string,string>,
|
||||||
|
}) -> MapGen {
|
||||||
|
layersByName = table<string,MapGen.Layer>,
|
||||||
|
layersList = MapGen.Layer[],
|
||||||
|
staticsByName = table<string,MapGen.StaticLayer>,
|
||||||
|
staticsList = MapGen.StaticLayer[],
|
||||||
|
layersNoisesInitialized = boolean,
|
||||||
|
cavernsNoiseInitialized = boolean,
|
||||||
|
isRunning = boolean,
|
||||||
|
nodeIDs = table<string,number>,
|
||||||
|
new = function,
|
||||||
|
getLayerByHeight = function,
|
||||||
|
getStaticByHeight = function,
|
||||||
|
registerLayer = function,
|
||||||
|
registerLayerNoiseColor = function,
|
||||||
|
registerStaticLayer = function,
|
||||||
|
registerPeak = function,
|
||||||
|
register2DPeak = function,
|
||||||
|
register2DPeaks = function,
|
||||||
|
register2DPeaksFromFile = function,
|
||||||
|
registerBiome = function,
|
||||||
|
registerCavern = function,
|
||||||
|
initLayersTriangultaion = function,
|
||||||
|
initLayersNoises = function,
|
||||||
|
initBiomesDiagram = function,
|
||||||
|
initCavernsNoise = function,
|
||||||
|
getNoises2dValue = function,
|
||||||
|
onMapGenerated = function,
|
||||||
|
run = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.getLayerByHeight
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.getLayerByHeight(yPos: number) -> MapGen.Layer?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Determines which layer a node belongs to based on its height coordinate.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.getStaticByHeight
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.getStaticByHeight(yPos: number) -> MapGen.StaticLayer?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Determines which statics layer a node belongs to based on its height coordinate.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.registerLayer
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.registerLayer(
|
||||||
|
name: string,
|
||||||
|
def: MapGen.LayerDef {
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
minTemp = number,
|
||||||
|
maxTemp = number,
|
||||||
|
minHumidity = number,
|
||||||
|
maxHumidity = number,
|
||||||
|
waterLevel = number?,
|
||||||
|
calcTemp = (fun(self: MapGen.Layer, value: number, height: number) -> number)?,
|
||||||
|
calcHumidity = (fun(self: MapGen.Layer, value: number, height: number) -> number)?,
|
||||||
|
biomesGorizontalScattering = number?,
|
||||||
|
biomesVerticalScattering = number?,
|
||||||
|
}
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
@param `name` - The name that will be assigned to the layer. The name must be unique for each layer.
|
||||||
|
|
||||||
|
@param `def` - Layer description table, see details `MapGen.LayerDef`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Mark the world area between two heights as a `MapGen.Layer`.
|
||||||
|
|
||||||
|
Note: layers must not overlap.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.registerLayerNoiseColor
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.registerLayerNoiseColor(
|
||||||
|
layerName: string,
|
||||||
|
category: MapGen.Layer.Category,
|
||||||
|
color: ColorString,
|
||||||
|
noiseParams: NoiseParams
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
@param `layerName` - The name of the layer for which the color will be registered.
|
||||||
|
|
||||||
|
@param `category` - Category indicating what will be generated by noise.
|
||||||
|
|
||||||
|
@param `color` - Noise color. Must be unique.
|
||||||
|
|
||||||
|
@param `noiseParams` - Fractal noise parameters.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Register the color and the noise parameters that correspond to it.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.registerStaticLayer
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.registerStaticLayer(
|
||||||
|
name: string,
|
||||||
|
def: MapGen.StaticLayerDef {
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
staticNode = string,
|
||||||
|
generateStaticNode = generateFunc,
|
||||||
|
}
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
@param `name` - The name that will be assigned to the static layer. The name must be unique for each layer.
|
||||||
|
|
||||||
|
@param `def` - Static layer description table, see details `MapGen.StaticLayerDef`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Mark the world area between two heights as a `MapGen.StaticLayer`.
|
||||||
|
|
||||||
|
Note: layers must not overlap.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.registerPeak
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.registerPeak(
|
||||||
|
layerName: string,
|
||||||
|
category: MapGen.Layer.Category,
|
||||||
|
def: MapGen.PeakDef {
|
||||||
|
pos = vector,
|
||||||
|
color = ColorString,
|
||||||
|
groups = table<string,number>?,
|
||||||
|
}
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
@param `layerName` - The name of the layer in which the new peak will be included.
|
||||||
|
|
||||||
|
@param `category` - Category indicating what will be generated by peak.
|
||||||
|
|
||||||
|
@param `def` - Peak description table, see details `MapGen.PeakDef`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Mark a world point as `MapGen.Peak` and assign it a specific color that will affect the generation.
|
||||||
|
|
||||||
|
Note: The peaks shouldn't overlap. This won't cause any errors, but it might ruin the generation.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.register2DPeak
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.register2DPeak(
|
||||||
|
layerName: string,
|
||||||
|
category: MapGen.Layer.Category,
|
||||||
|
def: MapGen.PeakDef {
|
||||||
|
pos = vector,
|
||||||
|
color = ColorString,
|
||||||
|
groups = table<string,number>?,
|
||||||
|
}
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
@param `layerName` - The name of the layer in which the new peak will be included.
|
||||||
|
|
||||||
|
@param `category` - Category indicating what will be generated by peak.
|
||||||
|
|
||||||
|
@param `def` - Peak description table, see details `MapGen.PeakDef`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Mark a world point as `MapGen.Peak` and assign it a specific color that will affect the generation.
|
||||||
|
The Y coordinate will be forced to zero, and the `is2d` group will be added to the groups field.
|
||||||
|
|
||||||
|
Note: The peaks shouldn't overlap. This won't cause any errors, but it might ruin the generation.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.register2DPeaks
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.register2DPeaks(
|
||||||
|
layerName: string,
|
||||||
|
category: MapGen.Layer.Category,
|
||||||
|
defs: MapGen.PeakDef[]
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
@param `layerName` - The name of the layer in which the new peaks will be included.
|
||||||
|
|
||||||
|
@param `category` - Category indicating what will be generated by peaks.
|
||||||
|
|
||||||
|
@param `defs` - Peaks description table, see details `MapGen.PeakDef`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Mark the world points as `MapGen.Peak` and assign them all a specific noise that will affect generation.
|
||||||
|
The Y coordinate will be forced to zero, and the `is2d` group will be added to the groups field.
|
||||||
|
|
||||||
|
Note: The peaks shouldn't overlap. This won't cause any errors, but it might ruin the generation.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.register2DPeaksFromFile
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.register2DPeaksFromFile(
|
||||||
|
layerName: string,
|
||||||
|
map: string,
|
||||||
|
scale: number,
|
||||||
|
zeroPos: Position2d,
|
||||||
|
category: MapGen.Layer.Category,
|
||||||
|
groups: table<string,number>?
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
@param `layerName` - The name of the layer in which the new peaks will be included.
|
||||||
|
|
||||||
|
@param `map` - The name of the image from which the peaks will be extracted. It should be located in the `<mod_name>/textures/maps` folder and have the following format `<image_name>.ff`
|
||||||
|
|
||||||
|
@param `scale` - Multiplier of how many blocks (nodes) will be between image pixels. It is not recommended to set the value below 50 for performance reasons.
|
||||||
|
|
||||||
|
@param `zeroPos` - The position in pixels where the zero world coordinate will be in the image.
|
||||||
|
|
||||||
|
@param `category` - Category indicating what will be generated by peaks.
|
||||||
|
|
||||||
|
@param `groups` - Groups that will be added to all peaks.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Extract the `MapGen.Peak` from the image and assign them all a specific color that will affect the generation.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.registerBiome
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.registerBiome(
|
||||||
|
layerName: string,
|
||||||
|
biomeName: string,
|
||||||
|
def: MapGen.BiomeDef {
|
||||||
|
tempPoint = number,
|
||||||
|
humidityPoint = number,
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
groundNodes = MapGen.Biome.GroundNodes,
|
||||||
|
soilHeight = number,
|
||||||
|
generateAir = generateFunc?,
|
||||||
|
generateCavernAir = generateFunc?,
|
||||||
|
generateWater = generateFunc?,
|
||||||
|
generateRock = generateFunc?,
|
||||||
|
generateTurf = generateFunc?,
|
||||||
|
generateSoil = generateFunc?,
|
||||||
|
generateBottom = generateFunc?,
|
||||||
|
}
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
@param `layerName` - The name of the layer in which the new biome will be included.
|
||||||
|
|
||||||
|
@param `biomeName` - The name to be assigned to the biome. The name must be unique for each biome.
|
||||||
|
|
||||||
|
@param `def` - Biome description table, see details `MapGen.BiomeDef`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Mark a point on the biomes diagram and constrain the world area by height to mark it as `MapGen.Biome`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.registerCavern
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.registerCavern(
|
||||||
|
layerName: string,
|
||||||
|
cavernName: string,
|
||||||
|
def: MapGen.CavernDef {
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
noiseParams = NoiseParams,
|
||||||
|
smoothDistance = number,
|
||||||
|
threshold = number?,
|
||||||
|
groups = table<string,number>?,
|
||||||
|
}
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
@param `layerName` - The name of the layer in which the new cavern will be included.
|
||||||
|
|
||||||
|
@param `cavernName` - The name to be assigned to the cavern. The name must be unique for each cavern.
|
||||||
|
|
||||||
|
@param `def` - Cavern description table, see details `MapGen.CavernDef`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Mark the world area between two heights as a `MapGen.Cavern` and assign the noise that the cave will be generated from.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.initLayersTriangultaion
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.initLayersTriangultaion() -> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Divide all layers into triangles whose vertices are the `Mapgen.Peak` belonging to these layers.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.initLayersNoises
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.initLayersNoises() -> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Initialize all layer noises. This should be called after the map object is loaded.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.initBiomesDiagram
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.initBiomesDiagram() -> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Initialization of the biome diagram using the Voronoi method.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.initCavernsNoise
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.initCavernsNoise() -> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Initialize caverns's noises. This should be called after the map object is loaded.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.getNoises2dValue
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.getNoises2dValue(
|
||||||
|
category: MapGen.Layer.Category,
|
||||||
|
layer: MapGen.Layer {
|
||||||
|
name = string,
|
||||||
|
minY = integer,
|
||||||
|
maxY = integer,
|
||||||
|
minTemp = integer,
|
||||||
|
maxTemp = integer,
|
||||||
|
minHumidity = integer,
|
||||||
|
maxHumidity = integer,
|
||||||
|
waterLevel = integer,
|
||||||
|
peaksList = { humidity: MapGen.Peak[], landscape: MapGen.Peak[], temp: MapGen.Peak[] },
|
||||||
|
noisesByColor = { humidity: table<ColorString,ValueNoise>, landscape: table<ColorString,ValueNoise>, temp: table<ColorString,ValueNoise> },
|
||||||
|
noisesParamsByColor = { humidity: table<ColorString,NoiseParams>, landscape: table<ColorString,NoiseParams>, temp: table<ColorString,NoiseParams> },
|
||||||
|
biomesByName = table<string,MapGen.Biome>,
|
||||||
|
biomesList = MapGen.Biome[],
|
||||||
|
biomesDiagram = table,
|
||||||
|
biomesGorizontalScattering = integer,
|
||||||
|
biomesVerticalScattering = integer,
|
||||||
|
cavernsByName = table<string,MapGen.Cavern>,
|
||||||
|
cavernsList = MapGen.Cavern[],
|
||||||
|
trianglesList = { humidity: MapGen.Triangle[], landscape: MapGen.Triangle[], temp: MapGen.Triangle[] },
|
||||||
|
tetrahedronsList = MapGen.Tetrahedron[],
|
||||||
|
calcTemp = function,
|
||||||
|
calcHumidity = function,
|
||||||
|
new = function,
|
||||||
|
addPeak = function,
|
||||||
|
addNoiseParamsColor = function,
|
||||||
|
getNoiseByColor = function,
|
||||||
|
addBiome = function,
|
||||||
|
addCavern = function,
|
||||||
|
initNoises = function,
|
||||||
|
initBiomesDiagram = function,
|
||||||
|
},
|
||||||
|
x: integer,
|
||||||
|
y: integer,
|
||||||
|
z: integer
|
||||||
|
) -> number?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Calculates a smoothed 2D noise value based on a preliminary space partitioning.
|
||||||
|
|
||||||
|
Returns `nil` if the point is not included in any triangle.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.onMapGenerated
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.onMapGenerated(
|
||||||
|
voxelManip: VoxelManip,
|
||||||
|
minPos: Position,
|
||||||
|
maxPos: Position,
|
||||||
|
blockseed: number
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Chunk generation handler.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.run
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.run() -> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Run world generation through this mapgen object
|
||||||
|
|
||||||
|
Note: only one instance of a `MapGen` class can be running.
|
||||||
|
|
||||||
|
**FOR MAPGEN ENVIRONMENT ONLY**
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### MapGen.layersByName
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
MapGen.layersByName : table<string,MapGen.Layer>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.layersList
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
MapGen.layersList : MapGen.Layer[]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.staticsByName
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
MapGen.staticsByName : table<string,MapGen.StaticLayer>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.staticsList
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
MapGen.staticsList : MapGen.StaticLayer[]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.layersNoisesInitialized
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
MapGen.layersNoisesInitialized : boolean
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Is the fractal noise of the layer initialized? This is necessary for a one-time noise initialization.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.cavernsNoiseInitialized
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
MapGen.cavernsNoiseInitialized : boolean
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Is the fractal noise of the caverns initialized? This is necessary for a one-time noise initialization.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.isRunning
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
MapGen.isRunning : boolean
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
A static field that guarantees that only one instance of the `MapGen` class will work.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.nodeIDs
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
MapGen.nodeIDs : table<string,number>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
23
docs/docs/types/ColoredDotsTable.md
Normal file
23
docs/docs/types/ColoredDotsTable.md
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# alias ColoredDotsTable
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```lua
|
||||||
|
(alias) ColoredDotsTable = table<string,table>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Table with color as key and value is table with coordinates of dots. Note: coords begin from 1,1 (not 0,0).
|
||||||
|
Example of table:
|
||||||
|
```lua
|
||||||
|
{
|
||||||
|
'size': { h=256, w=256 },
|
||||||
|
'#fff': { {x=1,y=1}, {x=2,y=2}, ... },
|
||||||
|
'#ff0': { {x=3,y=3}, {x=4,y=4}, ... },
|
||||||
|
...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
92
docs/docs/types/MapGen.Biome.GroundNodes.md
Normal file
92
docs/docs/types/MapGen.Biome.GroundNodes.md
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
# class GroundNodes
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- namespace: MapGen.Biome
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
**Only for EmmyLua.**
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### GroundNodes.turf
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
GroundNodes.turf : string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
The soil covering the surface of the biome
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### GroundNodes.soil
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
GroundNodes.soil : string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
The soil beneath the turf. The height of this layer depends on `Biome.soilHeight`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### GroundNodes.rock
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
GroundNodes.rock : string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
The rock found beneath the soil of a biome.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### GroundNodes.bottom
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
GroundNodes.bottom : string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Covering the bottom of reservoirs.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
92
docs/docs/types/MapGen.Biome.GroundNodesIDs.md
Normal file
92
docs/docs/types/MapGen.Biome.GroundNodesIDs.md
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
# class GroundNodesIDs
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- namespace: MapGen.Biome
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
**Only for EmmyLua.**
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### GroundNodesIDs.turf
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
GroundNodesIDs.turf : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
The soil covering the surface of the biome
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### GroundNodesIDs.soil
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
GroundNodesIDs.soil : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
The soil beneath the turf. The height of this layer depends on `Biome.soilHeight`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### GroundNodesIDs.rock
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
GroundNodesIDs.rock : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
The rock found beneath the soil of a biome.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### GroundNodesIDs.bottom
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
GroundNodesIDs.bottom : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Covering the bottom of reservoirs.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
312
docs/docs/types/MapGen.Biome.md
Normal file
312
docs/docs/types/MapGen.Biome.md
Normal file
@@ -0,0 +1,312 @@
|
|||||||
|
# class Biome
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- namespace: MapGen
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## methods
|
||||||
|
---
|
||||||
|
|
||||||
|
### Biome.new
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Biome.new(
|
||||||
|
name: string,
|
||||||
|
def: MapGen.BiomeDef {
|
||||||
|
tempPoint = number,
|
||||||
|
humidityPoint = number,
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
groundNodes = MapGen.Biome.GroundNodes,
|
||||||
|
soilHeight = number,
|
||||||
|
generateAir = generateFunc?,
|
||||||
|
generateCavernAir = generateFunc?,
|
||||||
|
generateWater = generateFunc?,
|
||||||
|
generateRock = generateFunc?,
|
||||||
|
generateTurf = generateFunc?,
|
||||||
|
generateSoil = generateFunc?,
|
||||||
|
generateBottom = generateFunc?,
|
||||||
|
}
|
||||||
|
) -> MapGen.Biome {
|
||||||
|
name = string,
|
||||||
|
tempPoint = number,
|
||||||
|
humidityPoint = number,
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
groundNodes = MapGen.Biome.GroundNodes,
|
||||||
|
groundNodesIDs = MapGen.Biome.GroundNodesIDs,
|
||||||
|
soilHeight = number,
|
||||||
|
generateAir = generateFunc,
|
||||||
|
generateCavernAir = generateFunc,
|
||||||
|
generateWater = generateFunc,
|
||||||
|
generateRock = generateFunc,
|
||||||
|
generateTurf = generateFunc,
|
||||||
|
generateSoil = generateFunc,
|
||||||
|
generateBottom = generateFunc,
|
||||||
|
new = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### Biome.name
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.name : string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.tempPoint
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.tempPoint : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.humidityPoint
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.humidityPoint : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.minY
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.minY : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.maxY
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.maxY : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.groundNodes
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.groundNodes : MapGen.Biome.GroundNodes {
|
||||||
|
turf: string,
|
||||||
|
soil: string,
|
||||||
|
rock: string,
|
||||||
|
bottom: string,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.groundNodesIDs
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.groundNodesIDs : MapGen.Biome.GroundNodesIDs {
|
||||||
|
turf: number,
|
||||||
|
soil: number,
|
||||||
|
rock: number,
|
||||||
|
bottom: number,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.soilHeight
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.soilHeight : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.generateAir
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.generateAir : generateFunc
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.generateCavernAir
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.generateCavernAir : generateFunc
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.generateWater
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.generateWater : generateFunc
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.generateRock
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.generateRock : generateFunc
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.generateTurf
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.generateTurf : generateFunc
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.generateSoil
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.generateSoil : generateFunc
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Biome.generateBottom
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Biome.generateBottom : generateFunc
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
226
docs/docs/types/MapGen.BiomeDef.md
Normal file
226
docs/docs/types/MapGen.BiomeDef.md
Normal file
@@ -0,0 +1,226 @@
|
|||||||
|
# class BiomeDef
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- namespace: MapGen
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Definition table for the `MapGen.Biome`.
|
||||||
|
|
||||||
|
**Only for EmmyLua.**
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### BiomeDef.tempPoint
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
BiomeDef.tempPoint : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### BiomeDef.humidityPoint
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
BiomeDef.humidityPoint : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### BiomeDef.minY
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
BiomeDef.minY : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### BiomeDef.maxY
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
BiomeDef.maxY : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### BiomeDef.groundNodes
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
BiomeDef.groundNodes : MapGen.Biome.GroundNodes {
|
||||||
|
turf: string,
|
||||||
|
soil: string,
|
||||||
|
rock: string,
|
||||||
|
bottom: string,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### BiomeDef.soilHeight
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
BiomeDef.soilHeight : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### BiomeDef.generateAir
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
BiomeDef.generateAir : generateFunc?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### BiomeDef.generateCavernAir
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
BiomeDef.generateCavernAir : generateFunc?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### BiomeDef.generateWater
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
BiomeDef.generateWater : generateFunc?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### BiomeDef.generateRock
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
BiomeDef.generateRock : generateFunc?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### BiomeDef.generateTurf
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
BiomeDef.generateTurf : generateFunc?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### BiomeDef.generateSoil
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
BiomeDef.generateSoil : generateFunc?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### BiomeDef.generateBottom
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
BiomeDef.generateBottom : generateFunc?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
208
docs/docs/types/MapGen.Cavern.md
Normal file
208
docs/docs/types/MapGen.Cavern.md
Normal file
@@ -0,0 +1,208 @@
|
|||||||
|
# class Cavern
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- namespace: MapGen
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## methods
|
||||||
|
---
|
||||||
|
|
||||||
|
### Cavern.getNoise
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Cavern.getNoise()-> ValueNoise
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Cavern.initNoise
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Cavern.initNoise()-> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Cavern.getGroups
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Cavern.getGroups()
|
||||||
|
-> table<string,number>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Cavern.new
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Cavern.new(
|
||||||
|
name: string,
|
||||||
|
def: MapGen.CavernDef {
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
noiseParams = NoiseParams,
|
||||||
|
smoothDistance = number,
|
||||||
|
threshold = number?,
|
||||||
|
groups = table<string,number>?,
|
||||||
|
}
|
||||||
|
) -> MapGen.Cavern {
|
||||||
|
name = string,
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
smoothDistance = number,
|
||||||
|
threshold = number,
|
||||||
|
getNoise = function,
|
||||||
|
initNoise = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
isCavern = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Cavern.isCavern
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Cavern.isCavern(
|
||||||
|
x: integer,
|
||||||
|
y: integer,
|
||||||
|
z: integer
|
||||||
|
) -> boolean
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns `true` if there is a cavern at the specified coordinates.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### Cavern.name
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Cavern.name : string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Cavern.minY
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Cavern.minY : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Cavern.maxY
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Cavern.maxY : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Cavern.smoothDistance
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Cavern.smoothDistance : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Cavern.threshold
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Cavern.threshold : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
116
docs/docs/types/MapGen.CavernDef.md
Normal file
116
docs/docs/types/MapGen.CavernDef.md
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
# class CavernDef
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- namespace: MapGen
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Definition table for the `MapGen.Cavern`.
|
||||||
|
|
||||||
|
**Only for EmmyLua.**
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### CavernDef.minY
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
CavernDef.minY : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### CavernDef.maxY
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
CavernDef.maxY : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### CavernDef.noiseParams
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
CavernDef.noiseParams : NoiseParams
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### CavernDef.smoothDistance
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
CavernDef.smoothDistance : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### CavernDef.threshold
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
CavernDef.threshold : number?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### CavernDef.groups
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
CavernDef.groups : table<string,number>?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
43
docs/docs/types/MapGen.Decoration.md
Normal file
43
docs/docs/types/MapGen.Decoration.md
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
# class Decoration
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- namespace: MapGen
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
**NOT IMPLEMENTED**
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## methods
|
||||||
|
---
|
||||||
|
|
||||||
|
### Decoration.new
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Decoration.new() -> MapGen.Decoration {
|
||||||
|
new = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
16
docs/docs/types/MapGen.Layer.Category.md
Normal file
16
docs/docs/types/MapGen.Layer.Category.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# alias Category
|
||||||
|
---
|
||||||
|
|
||||||
|
- namespace: MapGen.Layer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```lua
|
||||||
|
(alias) Category = ("landscape"|"temp"|"humidity")
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
A category of noise that affects specific map generation objects.
|
||||||
|
|
||||||
678
docs/docs/types/MapGen.Layer.md
Normal file
678
docs/docs/types/MapGen.Layer.md
Normal file
@@ -0,0 +1,678 @@
|
|||||||
|
# class Layer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- namespace: MapGen
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## methods
|
||||||
|
---
|
||||||
|
|
||||||
|
### Layer.calcTemp
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Layer.calcTemp(
|
||||||
|
self: MapGen.Layer {
|
||||||
|
name = string,
|
||||||
|
minY = integer,
|
||||||
|
maxY = integer,
|
||||||
|
minTemp = integer,
|
||||||
|
maxTemp = integer,
|
||||||
|
minHumidity = integer,
|
||||||
|
maxHumidity = integer,
|
||||||
|
waterLevel = integer,
|
||||||
|
peaksList = { humidity: MapGen.Peak[], landscape: MapGen.Peak[], temp: MapGen.Peak[] },
|
||||||
|
noisesByColor = { humidity: table<ColorString,ValueNoise>, landscape: table<ColorString,ValueNoise>, temp: table<ColorString,ValueNoise> },
|
||||||
|
noisesParamsByColor = { humidity: table<ColorString,NoiseParams>, landscape: table<ColorString,NoiseParams>, temp: table<ColorString,NoiseParams> },
|
||||||
|
biomesByName = table<string,MapGen.Biome>,
|
||||||
|
biomesList = MapGen.Biome[],
|
||||||
|
biomesDiagram = table,
|
||||||
|
biomesGorizontalScattering = integer,
|
||||||
|
biomesVerticalScattering = integer,
|
||||||
|
cavernsByName = table<string,MapGen.Cavern>,
|
||||||
|
cavernsList = MapGen.Cavern[],
|
||||||
|
trianglesList = { humidity: MapGen.Triangle[], landscape: MapGen.Triangle[], temp: MapGen.Triangle[] },
|
||||||
|
tetrahedronsList = MapGen.Tetrahedron[],
|
||||||
|
calcTemp = function,
|
||||||
|
calcHumidity = function,
|
||||||
|
new = function,
|
||||||
|
addPeak = function,
|
||||||
|
addNoiseParamsColor = function,
|
||||||
|
getNoiseByColor = function,
|
||||||
|
addBiome = function,
|
||||||
|
addCavern = function,
|
||||||
|
initNoises = function,
|
||||||
|
initBiomesDiagram = function,
|
||||||
|
},
|
||||||
|
value: number,
|
||||||
|
height: number
|
||||||
|
)-> number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.calcHumidity
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Layer.calcHumidity(
|
||||||
|
self: MapGen.Layer {
|
||||||
|
name = string,
|
||||||
|
minY = integer,
|
||||||
|
maxY = integer,
|
||||||
|
minTemp = integer,
|
||||||
|
maxTemp = integer,
|
||||||
|
minHumidity = integer,
|
||||||
|
maxHumidity = integer,
|
||||||
|
waterLevel = integer,
|
||||||
|
peaksList = { humidity: MapGen.Peak[], landscape: MapGen.Peak[], temp: MapGen.Peak[] },
|
||||||
|
noisesByColor = { humidity: table<ColorString,ValueNoise>, landscape: table<ColorString,ValueNoise>, temp: table<ColorString,ValueNoise> },
|
||||||
|
noisesParamsByColor = { humidity: table<ColorString,NoiseParams>, landscape: table<ColorString,NoiseParams>, temp: table<ColorString,NoiseParams> },
|
||||||
|
biomesByName = table<string,MapGen.Biome>,
|
||||||
|
biomesList = MapGen.Biome[],
|
||||||
|
biomesDiagram = table,
|
||||||
|
biomesGorizontalScattering = integer,
|
||||||
|
biomesVerticalScattering = integer,
|
||||||
|
cavernsByName = table<string,MapGen.Cavern>,
|
||||||
|
cavernsList = MapGen.Cavern[],
|
||||||
|
trianglesList = { humidity: MapGen.Triangle[], landscape: MapGen.Triangle[], temp: MapGen.Triangle[] },
|
||||||
|
tetrahedronsList = MapGen.Tetrahedron[],
|
||||||
|
calcTemp = function,
|
||||||
|
calcHumidity = function,
|
||||||
|
new = function,
|
||||||
|
addPeak = function,
|
||||||
|
addNoiseParamsColor = function,
|
||||||
|
getNoiseByColor = function,
|
||||||
|
addBiome = function,
|
||||||
|
addCavern = function,
|
||||||
|
initNoises = function,
|
||||||
|
initBiomesDiagram = function,
|
||||||
|
},
|
||||||
|
value: number,
|
||||||
|
height: number
|
||||||
|
)-> number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.new
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Layer.new(
|
||||||
|
name: string,
|
||||||
|
def: MapGen.LayerDef {
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
minTemp = number,
|
||||||
|
maxTemp = number,
|
||||||
|
minHumidity = number,
|
||||||
|
maxHumidity = number,
|
||||||
|
waterLevel = number?,
|
||||||
|
calcTemp = (fun(self: MapGen.Layer, value: number, height: number) -> number)?,
|
||||||
|
calcHumidity = (fun(self: MapGen.Layer, value: number, height: number) -> number)?,
|
||||||
|
biomesGorizontalScattering = number?,
|
||||||
|
biomesVerticalScattering = number?,
|
||||||
|
}
|
||||||
|
) -> MapGen.Layer {
|
||||||
|
name = string,
|
||||||
|
minY = integer,
|
||||||
|
maxY = integer,
|
||||||
|
minTemp = integer,
|
||||||
|
maxTemp = integer,
|
||||||
|
minHumidity = integer,
|
||||||
|
maxHumidity = integer,
|
||||||
|
waterLevel = integer,
|
||||||
|
peaksList = { humidity: MapGen.Peak[], landscape: MapGen.Peak[], temp: MapGen.Peak[] },
|
||||||
|
noisesByColor = { humidity: table<ColorString,ValueNoise>, landscape: table<ColorString,ValueNoise>, temp: table<ColorString,ValueNoise> },
|
||||||
|
noisesParamsByColor = { humidity: table<ColorString,NoiseParams>, landscape: table<ColorString,NoiseParams>, temp: table<ColorString,NoiseParams> },
|
||||||
|
biomesByName = table<string,MapGen.Biome>,
|
||||||
|
biomesList = MapGen.Biome[],
|
||||||
|
biomesDiagram = table,
|
||||||
|
biomesGorizontalScattering = integer,
|
||||||
|
biomesVerticalScattering = integer,
|
||||||
|
cavernsByName = table<string,MapGen.Cavern>,
|
||||||
|
cavernsList = MapGen.Cavern[],
|
||||||
|
trianglesList = { humidity: MapGen.Triangle[], landscape: MapGen.Triangle[], temp: MapGen.Triangle[] },
|
||||||
|
tetrahedronsList = MapGen.Tetrahedron[],
|
||||||
|
calcTemp = function,
|
||||||
|
calcHumidity = function,
|
||||||
|
new = function,
|
||||||
|
addPeak = function,
|
||||||
|
addNoiseParamsColor = function,
|
||||||
|
getNoiseByColor = function,
|
||||||
|
addBiome = function,
|
||||||
|
addCavern = function,
|
||||||
|
initNoises = function,
|
||||||
|
initBiomesDiagram = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.addPeak
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Layer.addPeak(
|
||||||
|
category: MapGen.Layer.Category,
|
||||||
|
peak: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
}
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Adds a peak to the `Layer.peaksList`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.addNoiseParamsColor
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Layer.addNoiseParamsColor(
|
||||||
|
category: MapGen.Layer.Category,
|
||||||
|
color: ColorString,
|
||||||
|
noiseParams: NoiseParams
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Adds a NoiseParams color to the `Layer.noisesParamsByColor`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.getNoiseByColor
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Layer.getNoiseByColor(
|
||||||
|
category: MapGen.Layer.Category,
|
||||||
|
color: ColorString
|
||||||
|
) -> ValueNoise
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns noise corresponding to a color.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.addBiome
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Layer.addBiome(
|
||||||
|
biomeName: string,
|
||||||
|
biome: MapGen.Biome {
|
||||||
|
name = string,
|
||||||
|
tempPoint = number,
|
||||||
|
humidityPoint = number,
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
groundNodes = MapGen.Biome.GroundNodes,
|
||||||
|
groundNodesIDs = MapGen.Biome.GroundNodesIDs,
|
||||||
|
soilHeight = number,
|
||||||
|
generateAir = generateFunc,
|
||||||
|
generateCavernAir = generateFunc,
|
||||||
|
generateWater = generateFunc,
|
||||||
|
generateRock = generateFunc,
|
||||||
|
generateTurf = generateFunc,
|
||||||
|
generateSoil = generateFunc,
|
||||||
|
generateBottom = generateFunc,
|
||||||
|
new = function,
|
||||||
|
}
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Adds a biome to the `Layer.biomesByName` & `Layer.biomesList`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.addCavern
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Layer.addCavern(
|
||||||
|
cavernName: string,
|
||||||
|
cavern: MapGen.Cavern {
|
||||||
|
name = string,
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
smoothDistance = number,
|
||||||
|
threshold = number,
|
||||||
|
getNoise = function,
|
||||||
|
initNoise = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
isCavern = function,
|
||||||
|
}
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Adds a cavern to the `Layer.cavernsByName` & `Layer.cavernsList`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.initNoises
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Layer.initNoises() -> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Initializes noise for generation.
|
||||||
|
|
||||||
|
Should only be called after the mapgen object has been loaded.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.initBiomesDiagram
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Layer.initBiomesDiagram() -> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Initialization of the biome diagram using the Voronoi method.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### Layer.name
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.name : string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.minY
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.minY : integer
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.maxY
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.maxY : integer
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.minTemp
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.minTemp : integer
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.maxTemp
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.maxTemp : integer
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.minHumidity
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.minHumidity : integer
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.maxHumidity
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.maxHumidity : integer
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.waterLevel
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.waterLevel : integer
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.peaksList
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.peaksList : { humidity: MapGen.Peak[], landscape: MapGen.Peak[], temp: MapGen.Peak[] }
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.noisesByColor
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.noisesByColor : { humidity: table<ColorString,ValueNoise>, landscape: table<ColorString,ValueNoise>, temp: table<ColorString,ValueNoise> }
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.noisesParamsByColor
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.noisesParamsByColor : { humidity: table<ColorString,NoiseParams>, landscape: table<ColorString,NoiseParams>, temp: table<ColorString,NoiseParams> }
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.biomesByName
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.biomesByName : table<string,MapGen.Biome>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.biomesList
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.biomesList : MapGen.Biome[]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.biomesDiagram
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.biomesDiagram : table
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.biomesGorizontalScattering
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.biomesGorizontalScattering : integer
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.biomesVerticalScattering
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.biomesVerticalScattering : integer
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.cavernsByName
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.cavernsByName : table<string,MapGen.Cavern>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.cavernsList
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.cavernsList : MapGen.Cavern[]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.trianglesList
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.trianglesList : { humidity: MapGen.Triangle[], landscape: MapGen.Triangle[], temp: MapGen.Triangle[] }
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Layer.tetrahedronsList
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Layer.tetrahedronsList : MapGen.Tetrahedron[]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
**Not supported**
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
191
docs/docs/types/MapGen.LayerDef.md
Normal file
191
docs/docs/types/MapGen.LayerDef.md
Normal file
@@ -0,0 +1,191 @@
|
|||||||
|
# class LayerDef
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- namespace: MapGen
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Definition table for the `MapGen.Layer`.
|
||||||
|
|
||||||
|
**Only for EmmyLua.**
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### LayerDef.minY
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
LayerDef.minY : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### LayerDef.maxY
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
LayerDef.maxY : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### LayerDef.minTemp
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
LayerDef.minTemp : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### LayerDef.maxTemp
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
LayerDef.maxTemp : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### LayerDef.minHumidity
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
LayerDef.minHumidity : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### LayerDef.maxHumidity
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
LayerDef.maxHumidity : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### LayerDef.waterLevel
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
LayerDef.waterLevel : number?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### LayerDef.calcTemp
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
LayerDef.calcTemp : (fun(self: MapGen.Layer, value: number, height: number) -> number)?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### LayerDef.calcHumidity
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
LayerDef.calcHumidity : (fun(self: MapGen.Layer, value: number, height: number) -> number)?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### LayerDef.biomesGorizontalScattering
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
LayerDef.biomesGorizontalScattering : number?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### LayerDef.biomesVerticalScattering
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
LayerDef.biomesVerticalScattering : number?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
14
docs/docs/types/MapGen.PastCalcNoiseValue.md
Normal file
14
docs/docs/types/MapGen.PastCalcNoiseValue.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# alias PastCalcNoiseValue
|
||||||
|
---
|
||||||
|
|
||||||
|
- namespace: MapGen
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```lua
|
||||||
|
(alias) PastCalcNoiseValue = { noiseValue: number?, triangle: MapGen.Triangle?, x: integer?, z: integer? }
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
162
docs/docs/types/MapGen.Peak.md
Normal file
162
docs/docs/types/MapGen.Peak.md
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
# class Peak
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- namespace: MapGen
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## methods
|
||||||
|
---
|
||||||
|
|
||||||
|
### Peak.getPeakPos
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Peak.getPeakPos(self)-> vector
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Peak.getColor
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Peak.getColor(self)-> ColorString
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Peak.getGroups
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Peak.getGroups(self)
|
||||||
|
-> table<string,number>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Peak.new
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Peak.new(def: MapGen.PeakDef {
|
||||||
|
pos = vector,
|
||||||
|
color = ColorString,
|
||||||
|
groups = table<string,number>?,
|
||||||
|
}) -> MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Peak.toString
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Peak.toString() -> string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns a string describing the object in a readable form.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Peak.eq
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Peak.eq(other: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
}) -> boolean
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns true if the peaks are equivalent.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### Peak.id
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Peak.id : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
71
docs/docs/types/MapGen.PeakDef.md
Normal file
71
docs/docs/types/MapGen.PeakDef.md
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
# class PeakDef
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- namespace: MapGen
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Definition table for the `MapGen.Peak`.
|
||||||
|
|
||||||
|
**Only for EmmyLua.**
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### PeakDef.pos
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
PeakDef.pos : vector
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### PeakDef.color
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
PeakDef.color : ColorString
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### PeakDef.groups
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
PeakDef.groups : table<string,number>?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
149
docs/docs/types/MapGen.StaticLayer.md
Normal file
149
docs/docs/types/MapGen.StaticLayer.md
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
# class StaticLayer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- namespace: MapGen
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## methods
|
||||||
|
---
|
||||||
|
|
||||||
|
### StaticLayer.new
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function StaticLayer.new(
|
||||||
|
name: string,
|
||||||
|
def: MapGen.StaticLayerDef {
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
staticNode = string,
|
||||||
|
generateStaticNode = generateFunc,
|
||||||
|
}
|
||||||
|
) -> MapGen.StaticLayer {
|
||||||
|
name = string,
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
staticNode = string,
|
||||||
|
staticNodeID = number,
|
||||||
|
generateStaticNode = generateFunc,
|
||||||
|
new = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### StaticLayer.name
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
StaticLayer.name : string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### StaticLayer.minY
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
StaticLayer.minY : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### StaticLayer.maxY
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
StaticLayer.maxY : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### StaticLayer.staticNode
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
StaticLayer.staticNode : string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### StaticLayer.staticNodeID
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
StaticLayer.staticNodeID : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### StaticLayer.generateStaticNode
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
StaticLayer.generateStaticNode : generateFunc
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
86
docs/docs/types/MapGen.StaticLayerDef.md
Normal file
86
docs/docs/types/MapGen.StaticLayerDef.md
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
# class StaticLayerDef
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- namespace: MapGen
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Definition table for the `MapGen.StaticLayer`.
|
||||||
|
|
||||||
|
**Only for EmmyLua.**
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### StaticLayerDef.minY
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
StaticLayerDef.minY : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### StaticLayerDef.maxY
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
StaticLayerDef.maxY : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### StaticLayerDef.staticNode
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
StaticLayerDef.staticNode : string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### StaticLayerDef.generateStaticNode
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
StaticLayerDef.generateStaticNode : generateFunc
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
541
docs/docs/types/MapGen.Tetrahedron.md
Normal file
541
docs/docs/types/MapGen.Tetrahedron.md
Normal file
@@ -0,0 +1,541 @@
|
|||||||
|
# class Tetrahedron
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- namespace: MapGen
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## methods
|
||||||
|
---
|
||||||
|
|
||||||
|
### Tetrahedron.new
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Tetrahedron.new(
|
||||||
|
p1: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p2: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p3: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p4: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
}
|
||||||
|
) -> MapGen.Tetrahedron {
|
||||||
|
p1 = MapGen.Peak,
|
||||||
|
p2 = MapGen.Peak,
|
||||||
|
p3 = MapGen.Peak,
|
||||||
|
p4 = MapGen.Peak,
|
||||||
|
h1 = MapGen.Triangulation.Edge,
|
||||||
|
h2 = MapGen.Triangulation.Edge,
|
||||||
|
h3 = MapGen.Triangulation.Edge,
|
||||||
|
h4 = MapGen.Triangulation.Edge,
|
||||||
|
f1 = MapGen.Triangle,
|
||||||
|
f2 = MapGen.Triangle,
|
||||||
|
f3 = MapGen.Triangle,
|
||||||
|
f4 = MapGen.Triangle,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
getHeight = function,
|
||||||
|
getCircumSphereCenter = function,
|
||||||
|
getCircumSphereRadius = function,
|
||||||
|
inCircumSphere = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.toString
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Tetrahedron.toString() -> string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns a string describing the object in a readable form.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.getHeight
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Tetrahedron.getHeight(
|
||||||
|
p1: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p2: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p3: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p4: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
}
|
||||||
|
) -> MapGen.Triangulation.Edge?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.getCircumSphereCenter
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Tetrahedron.getCircumSphereCenter() -> vector
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the center of the circumscribed sphere.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.getCircumSphereRadius
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Tetrahedron.getCircumSphereRadius() -> number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the radius of the circumscribed sphere.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.inCircumSphere
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Tetrahedron.inCircumSphere(p: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
}) -> boolean
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Checks whether a given point lies within the circumscribed sphere of a tetrahedron.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### Tetrahedron.p1
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Tetrahedron.p1 : MapGen.Peak {
|
||||||
|
id: number,
|
||||||
|
getPeakPos: function,
|
||||||
|
getColor: function,
|
||||||
|
getGroups: function,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.p2
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Tetrahedron.p2 : MapGen.Peak {
|
||||||
|
id: number,
|
||||||
|
getPeakPos: function,
|
||||||
|
getColor: function,
|
||||||
|
getGroups: function,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.p3
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Tetrahedron.p3 : MapGen.Peak {
|
||||||
|
id: number,
|
||||||
|
getPeakPos: function,
|
||||||
|
getColor: function,
|
||||||
|
getGroups: function,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.p4
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Tetrahedron.p4 : MapGen.Peak {
|
||||||
|
id: number,
|
||||||
|
getPeakPos: function,
|
||||||
|
getColor: function,
|
||||||
|
getGroups: function,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.h1
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Tetrahedron.h1 : MapGen.Triangulation.Edge {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
same: function,
|
||||||
|
length: function,
|
||||||
|
getMidPoint: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.h2
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Tetrahedron.h2 : MapGen.Triangulation.Edge {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
same: function,
|
||||||
|
length: function,
|
||||||
|
getMidPoint: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.h3
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Tetrahedron.h3 : MapGen.Triangulation.Edge {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
same: function,
|
||||||
|
length: function,
|
||||||
|
getMidPoint: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.h4
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Tetrahedron.h4 : MapGen.Triangulation.Edge {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
same: function,
|
||||||
|
length: function,
|
||||||
|
getMidPoint: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.f1
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Tetrahedron.f1 : MapGen.Triangle {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
p3: MapGen.Peak,
|
||||||
|
e1: MapGen.Triangulation.Edge,
|
||||||
|
e2: MapGen.Triangulation.Edge,
|
||||||
|
e3: MapGen.Triangulation.Edge,
|
||||||
|
h1: MapGen.Triangulation.Edge,
|
||||||
|
h2: MapGen.Triangulation.Edge,
|
||||||
|
h3: MapGen.Triangulation.Edge,
|
||||||
|
neighbours: MapGen.Triangle.Neighbours,
|
||||||
|
color: ColorString?,
|
||||||
|
new: function,
|
||||||
|
...(+13)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.f2
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Tetrahedron.f2 : MapGen.Triangle {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
p3: MapGen.Peak,
|
||||||
|
e1: MapGen.Triangulation.Edge,
|
||||||
|
e2: MapGen.Triangulation.Edge,
|
||||||
|
e3: MapGen.Triangulation.Edge,
|
||||||
|
h1: MapGen.Triangulation.Edge,
|
||||||
|
h2: MapGen.Triangulation.Edge,
|
||||||
|
h3: MapGen.Triangulation.Edge,
|
||||||
|
neighbours: MapGen.Triangle.Neighbours,
|
||||||
|
color: ColorString?,
|
||||||
|
new: function,
|
||||||
|
...(+13)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.f3
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Tetrahedron.f3 : MapGen.Triangle {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
p3: MapGen.Peak,
|
||||||
|
e1: MapGen.Triangulation.Edge,
|
||||||
|
e2: MapGen.Triangulation.Edge,
|
||||||
|
e3: MapGen.Triangulation.Edge,
|
||||||
|
h1: MapGen.Triangulation.Edge,
|
||||||
|
h2: MapGen.Triangulation.Edge,
|
||||||
|
h3: MapGen.Triangulation.Edge,
|
||||||
|
neighbours: MapGen.Triangle.Neighbours,
|
||||||
|
color: ColorString?,
|
||||||
|
new: function,
|
||||||
|
...(+13)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Tetrahedron.f4
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Tetrahedron.f4 : MapGen.Triangle {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
p3: MapGen.Peak,
|
||||||
|
e1: MapGen.Triangulation.Edge,
|
||||||
|
e2: MapGen.Triangulation.Edge,
|
||||||
|
e3: MapGen.Triangulation.Edge,
|
||||||
|
h1: MapGen.Triangulation.Edge,
|
||||||
|
h2: MapGen.Triangulation.Edge,
|
||||||
|
h3: MapGen.Triangulation.Edge,
|
||||||
|
neighbours: MapGen.Triangle.Neighbours,
|
||||||
|
color: ColorString?,
|
||||||
|
new: function,
|
||||||
|
...(+13)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
14
docs/docs/types/MapGen.Triangle.CircumCircleEnum.md
Normal file
14
docs/docs/types/MapGen.Triangle.CircumCircleEnum.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# alias CircumCircleEnum
|
||||||
|
---
|
||||||
|
|
||||||
|
- namespace: MapGen.Triangle
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```lua
|
||||||
|
(alias) CircumCircleEnum = ("IN"|"BEHIND"|"ON")
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
19
docs/docs/types/MapGen.Triangle.Neighbours.md
Normal file
19
docs/docs/types/MapGen.Triangle.Neighbours.md
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# alias Neighbours
|
||||||
|
---
|
||||||
|
|
||||||
|
- namespace: MapGen.Triangle
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```lua
|
||||||
|
(alias) Neighbours = { t1: MapGen.Triangle?, t2: MapGen.Triangle?, t3: MapGen.Triangle? }
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Adjacent triangles:
|
||||||
|
* `t1` with a common side p1-p2
|
||||||
|
* `t2` with a common side p2-p3
|
||||||
|
* `t3` with a common side p3-p1
|
||||||
|
|
||||||
750
docs/docs/types/MapGen.Triangle.md
Normal file
750
docs/docs/types/MapGen.Triangle.md
Normal file
@@ -0,0 +1,750 @@
|
|||||||
|
# class Triangle
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- namespace: MapGen
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## methods
|
||||||
|
---
|
||||||
|
|
||||||
|
### Triangle.new
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.new(
|
||||||
|
p1: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p2: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p3: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
}
|
||||||
|
) -> MapGen.Triangle {
|
||||||
|
p1 = MapGen.Peak,
|
||||||
|
p2 = MapGen.Peak,
|
||||||
|
p3 = MapGen.Peak,
|
||||||
|
e1 = MapGen.Triangulation.Edge,
|
||||||
|
e2 = MapGen.Triangulation.Edge,
|
||||||
|
e3 = MapGen.Triangulation.Edge,
|
||||||
|
h1 = MapGen.Triangulation.Edge,
|
||||||
|
h2 = MapGen.Triangulation.Edge,
|
||||||
|
h3 = MapGen.Triangulation.Edge,
|
||||||
|
neighbours = MapGen.Triangle.Neighbours,
|
||||||
|
color = ColorString?,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
same = function,
|
||||||
|
getCenter = function,
|
||||||
|
getArea = function,
|
||||||
|
getHeight = function,
|
||||||
|
getHeight2D = function,
|
||||||
|
getSidesLength = function,
|
||||||
|
getSidesLength2D = function,
|
||||||
|
getCircumCenter2D = function,
|
||||||
|
getCircumRadius2D = function,
|
||||||
|
getCircumCircle2D = function,
|
||||||
|
inCircumCircle2D = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.toString
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.toString() -> string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns a string describing the object in a readable form.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.eq
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.eq(other: MapGen.Triangle {
|
||||||
|
p1 = MapGen.Peak,
|
||||||
|
p2 = MapGen.Peak,
|
||||||
|
p3 = MapGen.Peak,
|
||||||
|
e1 = MapGen.Triangulation.Edge,
|
||||||
|
e2 = MapGen.Triangulation.Edge,
|
||||||
|
e3 = MapGen.Triangulation.Edge,
|
||||||
|
h1 = MapGen.Triangulation.Edge,
|
||||||
|
h2 = MapGen.Triangulation.Edge,
|
||||||
|
h3 = MapGen.Triangulation.Edge,
|
||||||
|
neighbours = MapGen.Triangle.Neighbours,
|
||||||
|
color = ColorString?,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
same = function,
|
||||||
|
getCenter = function,
|
||||||
|
getArea = function,
|
||||||
|
getHeight = function,
|
||||||
|
getHeight2D = function,
|
||||||
|
getSidesLength = function,
|
||||||
|
getSidesLength2D = function,
|
||||||
|
getCircumCenter2D = function,
|
||||||
|
getCircumRadius2D = function,
|
||||||
|
getCircumCircle2D = function,
|
||||||
|
inCircumCircle2D = function,
|
||||||
|
}) -> boolean
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns true if the triangles are equivalent.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.same
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.same(other: MapGen.Triangle {
|
||||||
|
p1 = MapGen.Peak,
|
||||||
|
p2 = MapGen.Peak,
|
||||||
|
p3 = MapGen.Peak,
|
||||||
|
e1 = MapGen.Triangulation.Edge,
|
||||||
|
e2 = MapGen.Triangulation.Edge,
|
||||||
|
e3 = MapGen.Triangulation.Edge,
|
||||||
|
h1 = MapGen.Triangulation.Edge,
|
||||||
|
h2 = MapGen.Triangulation.Edge,
|
||||||
|
h3 = MapGen.Triangulation.Edge,
|
||||||
|
neighbours = MapGen.Triangle.Neighbours,
|
||||||
|
color = ColorString?,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
same = function,
|
||||||
|
getCenter = function,
|
||||||
|
getArea = function,
|
||||||
|
getHeight = function,
|
||||||
|
getHeight2D = function,
|
||||||
|
getSidesLength = function,
|
||||||
|
getSidesLength2D = function,
|
||||||
|
getCircumCenter2D = function,
|
||||||
|
getCircumRadius2D = function,
|
||||||
|
getCircumCircle2D = function,
|
||||||
|
inCircumCircle2D = function,
|
||||||
|
}) -> boolean
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns true if the triangles are similar.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.getCenter
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.getCenter() -> vector
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the coordinates of the triangle's center.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.getArea
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.getArea() -> number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the area of a triangle.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.getHeight
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.getHeight(
|
||||||
|
p1: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p2: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p3: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
}
|
||||||
|
) -> MapGen.Triangulation.Edge {
|
||||||
|
p1 = MapGen.Peak,
|
||||||
|
p2 = MapGen.Peak,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
same = function,
|
||||||
|
length = function,
|
||||||
|
getMidPoint = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the perpendicular from the vertex Peak1 to the line Peak2-Peak3.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.getHeight2D
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.getHeight2D(
|
||||||
|
p1: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p2: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p3: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
}
|
||||||
|
) -> MapGen.Triangulation.Edge {
|
||||||
|
p1 = MapGen.Peak,
|
||||||
|
p2 = MapGen.Peak,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
same = function,
|
||||||
|
length = function,
|
||||||
|
getMidPoint = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the perpendicular from the vertex Peak1 to the line Peak2-Peak3.
|
||||||
|
|
||||||
|
Note: This function does not take into account the Y-coordinate,
|
||||||
|
that is, the calculation is performed on the projection of the triangle XZ.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.getSidesLength
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.getSidesLength()
|
||||||
|
-> number
|
||||||
|
-> number
|
||||||
|
-> number
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the length of the edges
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.getSidesLength2D
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.getSidesLength2D()
|
||||||
|
-> number
|
||||||
|
-> number
|
||||||
|
-> number
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the length of the edges.
|
||||||
|
|
||||||
|
Note: This function does not take into account the Y-coordinate,
|
||||||
|
that is, the calculation is performed on the projection of the triangle XZ.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.getCircumCenter2D
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.getCircumCenter2D() -> vector
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the coordinates of the circumcircle center.
|
||||||
|
|
||||||
|
Note: This function does not take into account the Y-coordinate,
|
||||||
|
that is, the calculation is performed on the projection of the triangle XZ.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.getCircumRadius2D
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.getCircumRadius2D() -> number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the radius of the circumcircle.
|
||||||
|
|
||||||
|
Note: This function does not take into account the Y-coordinate,
|
||||||
|
that is, the calculation is performed on the projection of the triangle XZ.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.getCircumCircle2D
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.getCircumCircle2D()
|
||||||
|
-> vector
|
||||||
|
-> number
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the coordinates of the circumcircle center and its radius.
|
||||||
|
|
||||||
|
Note: This function does not take into account the Y-coordinate,
|
||||||
|
that is, the calculation is performed on the projection of the triangle XZ.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.inCircumCircle2D
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangle.inCircumCircle2D(p: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
}) -> boolean
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Checks if a given point lies into the triangle circumcircle.
|
||||||
|
|
||||||
|
Note: This function does not take into account the Y-coordinate,
|
||||||
|
that is, the calculation is performed on the projection of the triangle XZ.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### Triangle.p1
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Triangle.p1 : MapGen.Peak {
|
||||||
|
id: number,
|
||||||
|
getPeakPos: function,
|
||||||
|
getColor: function,
|
||||||
|
getGroups: function,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.p2
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Triangle.p2 : MapGen.Peak {
|
||||||
|
id: number,
|
||||||
|
getPeakPos: function,
|
||||||
|
getColor: function,
|
||||||
|
getGroups: function,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.p3
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Triangle.p3 : MapGen.Peak {
|
||||||
|
id: number,
|
||||||
|
getPeakPos: function,
|
||||||
|
getColor: function,
|
||||||
|
getGroups: function,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.e1
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Triangle.e1 : MapGen.Triangulation.Edge {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
same: function,
|
||||||
|
length: function,
|
||||||
|
getMidPoint: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.e2
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Triangle.e2 : MapGen.Triangulation.Edge {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
same: function,
|
||||||
|
length: function,
|
||||||
|
getMidPoint: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.e3
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Triangle.e3 : MapGen.Triangulation.Edge {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
same: function,
|
||||||
|
length: function,
|
||||||
|
getMidPoint: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.h1
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Triangle.h1 : MapGen.Triangulation.Edge {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
same: function,
|
||||||
|
length: function,
|
||||||
|
getMidPoint: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.h2
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Triangle.h2 : MapGen.Triangulation.Edge {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
same: function,
|
||||||
|
length: function,
|
||||||
|
getMidPoint: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.h3
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Triangle.h3 : MapGen.Triangulation.Edge {
|
||||||
|
p1: MapGen.Peak,
|
||||||
|
p2: MapGen.Peak,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
same: function,
|
||||||
|
length: function,
|
||||||
|
getMidPoint: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.neighbours
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Triangle.neighbours : MapGen.Triangle.Neighbours
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangle.color
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Triangle.color : ColorString?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
230
docs/docs/types/MapGen.Triangulation.Edge.md
Normal file
230
docs/docs/types/MapGen.Triangulation.Edge.md
Normal file
@@ -0,0 +1,230 @@
|
|||||||
|
# class Edge
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- namespace: MapGen.Triangulation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## methods
|
||||||
|
---
|
||||||
|
|
||||||
|
### Edge.new
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Edge.new(
|
||||||
|
p1: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
},
|
||||||
|
p2: MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
}
|
||||||
|
) -> MapGen.Triangulation.Edge {
|
||||||
|
p1 = MapGen.Peak,
|
||||||
|
p2 = MapGen.Peak,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
same = function,
|
||||||
|
length = function,
|
||||||
|
getMidPoint = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Edge.toString
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Edge.toString() -> string
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns a string describing the object in a readable form.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Edge.eq
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Edge.eq(other: MapGen.Triangulation.Edge {
|
||||||
|
p1 = MapGen.Peak,
|
||||||
|
p2 = MapGen.Peak,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
same = function,
|
||||||
|
length = function,
|
||||||
|
getMidPoint = function,
|
||||||
|
}) -> boolean
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns true if the edges are equivalent.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Edge.same
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Edge.same(other: MapGen.Triangulation.Edge {
|
||||||
|
p1 = MapGen.Peak,
|
||||||
|
p2 = MapGen.Peak,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
same = function,
|
||||||
|
length = function,
|
||||||
|
getMidPoint = function,
|
||||||
|
}) -> boolean
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns true if the edges are similar.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Edge.length
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Edge.length() -> number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the length of an edge.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Edge.getMidPoint
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Edge.getMidPoint() -> vector
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns the vector of the point located in the middle of the edge.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### Edge.p1
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Edge.p1 : MapGen.Peak {
|
||||||
|
id: number,
|
||||||
|
getPeakPos: function,
|
||||||
|
getColor: function,
|
||||||
|
getGroups: function,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Edge.p2
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Edge.p2 : MapGen.Peak {
|
||||||
|
id: number,
|
||||||
|
getPeakPos: function,
|
||||||
|
getColor: function,
|
||||||
|
getGroups: function,
|
||||||
|
new: function,
|
||||||
|
toString: function,
|
||||||
|
eq: function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
90
docs/docs/types/MapGen.Triangulation.FakePeak.md
Normal file
90
docs/docs/types/MapGen.Triangulation.FakePeak.md
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
# class FakePeak
|
||||||
|
|
||||||
|
|
||||||
|
- supers: MapGen.Peak
|
||||||
|
|
||||||
|
|
||||||
|
- namespace: MapGen.Triangulation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Allows you to create a `MapGen.Peak` without specifying a noise parameter.
|
||||||
|
|
||||||
|
**WARNING: MUST NOT BE PARTICIPATED IN GENERATION**
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## methods
|
||||||
|
---
|
||||||
|
|
||||||
|
### FakePeak.getPeakPos
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function FakePeak.getPeakPos()-> vector
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### FakePeak.new
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function FakePeak.new(peakPos: vector) -> MapGen.Peak {
|
||||||
|
id = number,
|
||||||
|
getPeakPos = function,
|
||||||
|
getColor = function,
|
||||||
|
getGroups = function,
|
||||||
|
new = function,
|
||||||
|
toString = function,
|
||||||
|
eq = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Returns a fake `MapGen.Peak` that has no noise parameters.
|
||||||
|
Note that the initialized peak should not be used in generation.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### FakePeak.id
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
FakePeak.id : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
86
docs/docs/types/MapGen.Triangulation.md
Normal file
86
docs/docs/types/MapGen.Triangulation.md
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
# class Triangulation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- namespace: MapGen
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## methods
|
||||||
|
---
|
||||||
|
|
||||||
|
### Triangulation.triangulate
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangulation.triangulate(vertices: table<integer,MapGen.Peak>) -> ((MapGen.Triangle)|MapGen.Triangle[])
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
The Delaunay method divides a plane into triangles based on a list of their vertices.
|
||||||
|
|
||||||
|
Doesn't take into account the Y coordinate of the vertices.
|
||||||
|
That is, all triangles that don't lie in the XZ plane will be projected onto it.
|
||||||
|
|
||||||
|
Vertices that do not have a `is2d` group will not participate in the triangulation.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Triangulation.tetrahedralize
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function Triangulation.tetrahedralize(vertices: table<integer,MapGen.Peak>) -> ((MapGen.Tetrahedron)|MapGen.Tetrahedron[])
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
The Delaunay method divides space into tetrahedra based on a list of their vertices.
|
||||||
|
|
||||||
|
Vertices that do not have a `is3d` group will not participate in the triangulation.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### Triangulation.convexMultiplier
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
Triangulation.convexMultiplier : number
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
741
docs/docs/types/MapGen.md
Normal file
741
docs/docs/types/MapGen.md
Normal file
@@ -0,0 +1,741 @@
|
|||||||
|
# class MapGen
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## methods
|
||||||
|
---
|
||||||
|
|
||||||
|
### MapGen.new
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.new(def: MapGenDef {
|
||||||
|
nodes = table<string,string>,
|
||||||
|
}) -> MapGen {
|
||||||
|
layersByName = table<string,MapGen.Layer>,
|
||||||
|
layersList = MapGen.Layer[],
|
||||||
|
staticsByName = table<string,MapGen.StaticLayer>,
|
||||||
|
staticsList = MapGen.StaticLayer[],
|
||||||
|
layersNoisesInitialized = boolean,
|
||||||
|
cavernsNoiseInitialized = boolean,
|
||||||
|
isRunning = boolean,
|
||||||
|
nodeIDs = table<string,number>,
|
||||||
|
new = function,
|
||||||
|
getLayerByHeight = function,
|
||||||
|
getStaticByHeight = function,
|
||||||
|
registerLayer = function,
|
||||||
|
registerLayerNoiseColor = function,
|
||||||
|
registerStaticLayer = function,
|
||||||
|
registerPeak = function,
|
||||||
|
register2DPeak = function,
|
||||||
|
register2DPeaks = function,
|
||||||
|
register2DPeaksFromFile = function,
|
||||||
|
registerBiome = function,
|
||||||
|
registerCavern = function,
|
||||||
|
initLayersTriangultaion = function,
|
||||||
|
initLayersNoises = function,
|
||||||
|
initBiomesDiagram = function,
|
||||||
|
initCavernsNoise = function,
|
||||||
|
getNoises2dValue = function,
|
||||||
|
onMapGenerated = function,
|
||||||
|
run = function,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.getLayerByHeight
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.getLayerByHeight(yPos: number) -> MapGen.Layer?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Determines which layer a node belongs to based on its height coordinate.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.getStaticByHeight
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.getStaticByHeight(yPos: number) -> MapGen.StaticLayer?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Determines which statics layer a node belongs to based on its height coordinate.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.registerLayer
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.registerLayer(
|
||||||
|
name: string,
|
||||||
|
def: MapGen.LayerDef {
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
minTemp = number,
|
||||||
|
maxTemp = number,
|
||||||
|
minHumidity = number,
|
||||||
|
maxHumidity = number,
|
||||||
|
waterLevel = number?,
|
||||||
|
calcTemp = (fun(self: MapGen.Layer, value: number, height: number) -> number)?,
|
||||||
|
calcHumidity = (fun(self: MapGen.Layer, value: number, height: number) -> number)?,
|
||||||
|
biomesGorizontalScattering = number?,
|
||||||
|
biomesVerticalScattering = number?,
|
||||||
|
}
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
@param `name` - The name that will be assigned to the layer. The name must be unique for each layer.
|
||||||
|
|
||||||
|
@param `def` - Layer description table, see details `MapGen.LayerDef`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Mark the world area between two heights as a `MapGen.Layer`.
|
||||||
|
|
||||||
|
Note: layers must not overlap.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.registerLayerNoiseColor
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.registerLayerNoiseColor(
|
||||||
|
layerName: string,
|
||||||
|
category: MapGen.Layer.Category,
|
||||||
|
color: ColorString,
|
||||||
|
noiseParams: NoiseParams
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
@param `layerName` - The name of the layer for which the color will be registered.
|
||||||
|
|
||||||
|
@param `category` - Category indicating what will be generated by noise.
|
||||||
|
|
||||||
|
@param `color` - Noise color. Must be unique.
|
||||||
|
|
||||||
|
@param `noiseParams` - Fractal noise parameters.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Register the color and the noise parameters that correspond to it.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.registerStaticLayer
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.registerStaticLayer(
|
||||||
|
name: string,
|
||||||
|
def: MapGen.StaticLayerDef {
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
staticNode = string,
|
||||||
|
generateStaticNode = generateFunc,
|
||||||
|
}
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
@param `name` - The name that will be assigned to the static layer. The name must be unique for each layer.
|
||||||
|
|
||||||
|
@param `def` - Static layer description table, see details `MapGen.StaticLayerDef`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Mark the world area between two heights as a `MapGen.StaticLayer`.
|
||||||
|
|
||||||
|
Note: layers must not overlap.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.registerPeak
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.registerPeak(
|
||||||
|
layerName: string,
|
||||||
|
category: MapGen.Layer.Category,
|
||||||
|
def: MapGen.PeakDef {
|
||||||
|
pos = vector,
|
||||||
|
color = ColorString,
|
||||||
|
groups = table<string,number>?,
|
||||||
|
}
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
@param `layerName` - The name of the layer in which the new peak will be included.
|
||||||
|
|
||||||
|
@param `category` - Category indicating what will be generated by peak.
|
||||||
|
|
||||||
|
@param `def` - Peak description table, see details `MapGen.PeakDef`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Mark a world point as `MapGen.Peak` and assign it a specific color that will affect the generation.
|
||||||
|
|
||||||
|
Note: The peaks shouldn't overlap. This won't cause any errors, but it might ruin the generation.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.register2DPeak
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.register2DPeak(
|
||||||
|
layerName: string,
|
||||||
|
category: MapGen.Layer.Category,
|
||||||
|
def: MapGen.PeakDef {
|
||||||
|
pos = vector,
|
||||||
|
color = ColorString,
|
||||||
|
groups = table<string,number>?,
|
||||||
|
}
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
@param `layerName` - The name of the layer in which the new peak will be included.
|
||||||
|
|
||||||
|
@param `category` - Category indicating what will be generated by peak.
|
||||||
|
|
||||||
|
@param `def` - Peak description table, see details `MapGen.PeakDef`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Mark a world point as `MapGen.Peak` and assign it a specific color that will affect the generation.
|
||||||
|
The Y coordinate will be forced to zero, and the `is2d` group will be added to the groups field.
|
||||||
|
|
||||||
|
Note: The peaks shouldn't overlap. This won't cause any errors, but it might ruin the generation.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.register2DPeaks
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.register2DPeaks(
|
||||||
|
layerName: string,
|
||||||
|
category: MapGen.Layer.Category,
|
||||||
|
defs: MapGen.PeakDef[]
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
@param `layerName` - The name of the layer in which the new peaks will be included.
|
||||||
|
|
||||||
|
@param `category` - Category indicating what will be generated by peaks.
|
||||||
|
|
||||||
|
@param `defs` - Peaks description table, see details `MapGen.PeakDef`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Mark the world points as `MapGen.Peak` and assign them all a specific noise that will affect generation.
|
||||||
|
The Y coordinate will be forced to zero, and the `is2d` group will be added to the groups field.
|
||||||
|
|
||||||
|
Note: The peaks shouldn't overlap. This won't cause any errors, but it might ruin the generation.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.register2DPeaksFromFile
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.register2DPeaksFromFile(
|
||||||
|
layerName: string,
|
||||||
|
map: string,
|
||||||
|
scale: number,
|
||||||
|
zeroPos: Position2d,
|
||||||
|
category: MapGen.Layer.Category,
|
||||||
|
groups: table<string,number>?
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
@param `layerName` - The name of the layer in which the new peaks will be included.
|
||||||
|
|
||||||
|
@param `map` - The name of the image from which the peaks will be extracted. It should be located in the `<mod_name>/textures/maps` folder and have the following format `<image_name>.ff`
|
||||||
|
|
||||||
|
@param `scale` - Multiplier of how many blocks (nodes) will be between image pixels. It is not recommended to set the value below 50 for performance reasons.
|
||||||
|
|
||||||
|
@param `zeroPos` - The position in pixels where the zero world coordinate will be in the image.
|
||||||
|
|
||||||
|
@param `category` - Category indicating what will be generated by peaks.
|
||||||
|
|
||||||
|
@param `groups` - Groups that will be added to all peaks.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Extract the `MapGen.Peak` from the image and assign them all a specific color that will affect the generation.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.registerBiome
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.registerBiome(
|
||||||
|
layerName: string,
|
||||||
|
biomeName: string,
|
||||||
|
def: MapGen.BiomeDef {
|
||||||
|
tempPoint = number,
|
||||||
|
humidityPoint = number,
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
groundNodes = MapGen.Biome.GroundNodes,
|
||||||
|
soilHeight = number,
|
||||||
|
generateAir = generateFunc?,
|
||||||
|
generateCavernAir = generateFunc?,
|
||||||
|
generateWater = generateFunc?,
|
||||||
|
generateRock = generateFunc?,
|
||||||
|
generateTurf = generateFunc?,
|
||||||
|
generateSoil = generateFunc?,
|
||||||
|
generateBottom = generateFunc?,
|
||||||
|
}
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
@param `layerName` - The name of the layer in which the new biome will be included.
|
||||||
|
|
||||||
|
@param `biomeName` - The name to be assigned to the biome. The name must be unique for each biome.
|
||||||
|
|
||||||
|
@param `def` - Biome description table, see details `MapGen.BiomeDef`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Mark a point on the biomes diagram and constrain the world area by height to mark it as `MapGen.Biome`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.registerCavern
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.registerCavern(
|
||||||
|
layerName: string,
|
||||||
|
cavernName: string,
|
||||||
|
def: MapGen.CavernDef {
|
||||||
|
minY = number,
|
||||||
|
maxY = number,
|
||||||
|
noiseParams = NoiseParams,
|
||||||
|
smoothDistance = number,
|
||||||
|
threshold = number?,
|
||||||
|
groups = table<string,number>?,
|
||||||
|
}
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
@param `layerName` - The name of the layer in which the new cavern will be included.
|
||||||
|
|
||||||
|
@param `cavernName` - The name to be assigned to the cavern. The name must be unique for each cavern.
|
||||||
|
|
||||||
|
@param `def` - Cavern description table, see details `MapGen.CavernDef`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Mark the world area between two heights as a `MapGen.Cavern` and assign the noise that the cave will be generated from.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.initLayersTriangultaion
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.initLayersTriangultaion() -> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Divide all layers into triangles whose vertices are the `Mapgen.Peak` belonging to these layers.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.initLayersNoises
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.initLayersNoises() -> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Initialize all layer noises. This should be called after the map object is loaded.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.initBiomesDiagram
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.initBiomesDiagram() -> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Initialization of the biome diagram using the Voronoi method.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.initCavernsNoise
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.initCavernsNoise() -> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Initialize caverns's noises. This should be called after the map object is loaded.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.getNoises2dValue
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.getNoises2dValue(
|
||||||
|
category: MapGen.Layer.Category,
|
||||||
|
layer: MapGen.Layer {
|
||||||
|
name = string,
|
||||||
|
minY = integer,
|
||||||
|
maxY = integer,
|
||||||
|
minTemp = integer,
|
||||||
|
maxTemp = integer,
|
||||||
|
minHumidity = integer,
|
||||||
|
maxHumidity = integer,
|
||||||
|
waterLevel = integer,
|
||||||
|
peaksList = { humidity: MapGen.Peak[], landscape: MapGen.Peak[], temp: MapGen.Peak[] },
|
||||||
|
noisesByColor = { humidity: table<ColorString,ValueNoise>, landscape: table<ColorString,ValueNoise>, temp: table<ColorString,ValueNoise> },
|
||||||
|
noisesParamsByColor = { humidity: table<ColorString,NoiseParams>, landscape: table<ColorString,NoiseParams>, temp: table<ColorString,NoiseParams> },
|
||||||
|
biomesByName = table<string,MapGen.Biome>,
|
||||||
|
biomesList = MapGen.Biome[],
|
||||||
|
biomesDiagram = table,
|
||||||
|
biomesGorizontalScattering = integer,
|
||||||
|
biomesVerticalScattering = integer,
|
||||||
|
cavernsByName = table<string,MapGen.Cavern>,
|
||||||
|
cavernsList = MapGen.Cavern[],
|
||||||
|
trianglesList = { humidity: MapGen.Triangle[], landscape: MapGen.Triangle[], temp: MapGen.Triangle[] },
|
||||||
|
tetrahedronsList = MapGen.Tetrahedron[],
|
||||||
|
calcTemp = function,
|
||||||
|
calcHumidity = function,
|
||||||
|
new = function,
|
||||||
|
addPeak = function,
|
||||||
|
addNoiseParamsColor = function,
|
||||||
|
getNoiseByColor = function,
|
||||||
|
addBiome = function,
|
||||||
|
addCavern = function,
|
||||||
|
initNoises = function,
|
||||||
|
initBiomesDiagram = function,
|
||||||
|
},
|
||||||
|
x: integer,
|
||||||
|
y: integer,
|
||||||
|
z: integer
|
||||||
|
) -> number?
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Calculates a smoothed 2D noise value based on a preliminary space partitioning.
|
||||||
|
|
||||||
|
Returns `nil` if the point is not included in any triangle.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.onMapGenerated
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.onMapGenerated(
|
||||||
|
voxelManip: VoxelManip,
|
||||||
|
minPos: Position,
|
||||||
|
maxPos: Position,
|
||||||
|
blockseed: number
|
||||||
|
) -> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Chunk generation handler.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.run
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
function MapGen.run() -> nil
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Run world generation through this mapgen object
|
||||||
|
|
||||||
|
Note: only one instance of a `MapGen` class can be running.
|
||||||
|
|
||||||
|
**FOR MAPGEN ENVIRONMENT ONLY**
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### MapGen.layersByName
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
MapGen.layersByName : table<string,MapGen.Layer>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.layersList
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
MapGen.layersList : MapGen.Layer[]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.staticsByName
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
MapGen.staticsByName : table<string,MapGen.StaticLayer>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.staticsList
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
MapGen.staticsList : MapGen.StaticLayer[]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.layersNoisesInitialized
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
MapGen.layersNoisesInitialized : boolean
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Is the fractal noise of the layer initialized? This is necessary for a one-time noise initialization.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.cavernsNoiseInitialized
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
MapGen.cavernsNoiseInitialized : boolean
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Is the fractal noise of the caverns initialized? This is necessary for a one-time noise initialization.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.isRunning
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
MapGen.isRunning : boolean
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
A static field that guarantees that only one instance of the `MapGen` class will work.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### MapGen.nodeIDs
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
MapGen.nodeIDs : table<string,number>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
39
docs/docs/types/MapGenDef.md
Normal file
39
docs/docs/types/MapGenDef.md
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
# class MapGenDef
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Definition table for the `MapGen`.
|
||||||
|
|
||||||
|
**Only for EmmyLua.**
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fields
|
||||||
|
---
|
||||||
|
|
||||||
|
### MapGenDef.nodes
|
||||||
|
---
|
||||||
|
```lua
|
||||||
|
MapGenDef.nodes : table<string,string>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
12
docs/docs/types/generateFunc.md
Normal file
12
docs/docs/types/generateFunc.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# alias generateFunc
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```lua
|
||||||
|
(alias) generateFunc = fun(self, mapGenerator: MapGen, data: number[], index: number, x: number, y: number, z: number)
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
80
docs/mkdocs.yml
Normal file
80
docs/mkdocs.yml
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
|
||||||
|
site_name: Docs
|
||||||
|
|
||||||
|
|
||||||
|
theme:
|
||||||
|
name: material
|
||||||
|
font:
|
||||||
|
text: Roboto
|
||||||
|
code: Roboto Mono
|
||||||
|
search: true
|
||||||
|
features:
|
||||||
|
- quick-links
|
||||||
|
- navigation
|
||||||
|
- search
|
||||||
|
- toc
|
||||||
|
- fullscreen
|
||||||
|
- bookmarks
|
||||||
|
- tabs
|
||||||
|
- code
|
||||||
|
- edit-on-github
|
||||||
|
- language-selector
|
||||||
|
- code
|
||||||
|
- cover
|
||||||
|
- footer
|
||||||
|
- social-share
|
||||||
|
- theme-switcher
|
||||||
|
nav:
|
||||||
|
- Home: index.md
|
||||||
|
|
||||||
|
- Types:
|
||||||
|
- alias Category : types/MapGen.Layer.Category.md
|
||||||
|
- alias CircumCircleEnum : types/MapGen.Triangle.CircumCircleEnum.md
|
||||||
|
- alias ColoredDotsTable : types/ColoredDotsTable.md
|
||||||
|
- alias Neighbours : types/MapGen.Triangle.Neighbours.md
|
||||||
|
- alias PastCalcNoiseValue : types/MapGen.PastCalcNoiseValue.md
|
||||||
|
- alias generateFunc : types/generateFunc.md
|
||||||
|
- class Biome : types/MapGen.Biome.md
|
||||||
|
- class BiomeDef : types/MapGen.BiomeDef.md
|
||||||
|
- class Cavern : types/MapGen.Cavern.md
|
||||||
|
- class CavernDef : types/MapGen.CavernDef.md
|
||||||
|
- class Decoration : types/MapGen.Decoration.md
|
||||||
|
- class Edge : types/MapGen.Triangulation.Edge.md
|
||||||
|
- class FakePeak : types/MapGen.Triangulation.FakePeak.md
|
||||||
|
- class GroundNodes : types/MapGen.Biome.GroundNodes.md
|
||||||
|
- class GroundNodesIDs : types/MapGen.Biome.GroundNodesIDs.md
|
||||||
|
- class Layer : types/MapGen.Layer.md
|
||||||
|
- class LayerDef : types/MapGen.LayerDef.md
|
||||||
|
- class MapGen : types/MapGen.md
|
||||||
|
- class MapGenDef : types/MapGenDef.md
|
||||||
|
- class Peak : types/MapGen.Peak.md
|
||||||
|
- class PeakDef : types/MapGen.PeakDef.md
|
||||||
|
- class StaticLayer : types/MapGen.StaticLayer.md
|
||||||
|
- class StaticLayerDef : types/MapGen.StaticLayerDef.md
|
||||||
|
- class Tetrahedron : types/MapGen.Tetrahedron.md
|
||||||
|
- class Triangle : types/MapGen.Triangle.md
|
||||||
|
- class Triangulation : types/MapGen.Triangulation.md
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- Modules:
|
||||||
|
- MapGen : modules/MapGen.md
|
||||||
|
- MapGen.Biome : modules/MapGen.Biome.md
|
||||||
|
- MapGen.Biome.GroundNodes : modules/MapGen.Biome.GroundNodes.md
|
||||||
|
- MapGen.Biome.GroundNodesIds : modules/MapGen.Biome.GroundNodesIds.md
|
||||||
|
- MapGen.Cavern : modules/MapGen.Cavern.md
|
||||||
|
- MapGen.Decoration : modules/MapGen.Decoration.md
|
||||||
|
- MapGen.Layer : modules/MapGen.Layer.md
|
||||||
|
- MapGen.Peak : modules/MapGen.Peak.md
|
||||||
|
- MapGen.StaticLayer : modules/MapGen.StaticLayer.md
|
||||||
|
- MapGen.Tetrahedron : modules/MapGen.Tetrahedron.md
|
||||||
|
- MapGen.Triangle : modules/MapGen.Triangle.md
|
||||||
|
- MapGen.Triangulation : modules/MapGen.Triangulation.md
|
||||||
|
- MapGen.Triangulation.Edge : modules/MapGen.Triangulation.Edge.md
|
||||||
|
- MapGen.Triangulation.FakePeak : modules/MapGen.Triangulation.FakePeak.md
|
||||||
|
- MapGen.ff2luat : modules/MapGen.ff2luat.md
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
extra:
|
||||||
|
footer: ""
|
||||||
@@ -1 +1,4 @@
|
|||||||
title = SMC
|
title = SMC
|
||||||
|
|
||||||
|
allowed_mapgens = singlenode
|
||||||
|
default_mapgen = singlenode
|
||||||
BIN
menu/background.png
Normal file
BIN
menu/background.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 MiB |
BIN
menu/header.png
Normal file
BIN
menu/header.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
BIN
menu/header_scale.png
Normal file
BIN
menu/header_scale.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 770 KiB |
BIN
menu/icon.png
BIN
menu/icon.png
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
menu/last_header.png
Normal file
BIN
menu/last_header.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
@@ -1,91 +0,0 @@
|
|||||||
Api = {}
|
|
||||||
|
|
||||||
---@alias Domain table<string,Mod|SubDomain> Global table for accessing public classes provided by mods.
|
|
||||||
---@alias SubDomain table<string,Mod>
|
|
||||||
|
|
||||||
---@type Domain
|
|
||||||
Core = {}
|
|
||||||
|
|
||||||
---@type Domain
|
|
||||||
Environment = {}
|
|
||||||
|
|
||||||
---@type Domain
|
|
||||||
Game = {}
|
|
||||||
|
|
||||||
---@type SubDomain
|
|
||||||
Game.Items = {}
|
|
||||||
|
|
||||||
---@type SubDomain
|
|
||||||
Game.Mobs = {}
|
|
||||||
|
|
||||||
---@type SubDomain
|
|
||||||
Game.Structures = {}
|
|
||||||
Ui = {}
|
|
||||||
|
|
||||||
local allowedDomains = {
|
|
||||||
Api = true,
|
|
||||||
Core = true,
|
|
||||||
Environment = true,
|
|
||||||
Game = true,
|
|
||||||
Ui = true
|
|
||||||
}
|
|
||||||
|
|
||||||
--- Adds a mod to the global space under specified domain structure
|
|
||||||
---@param mod Mod The mod table containing functionality to expose
|
|
||||||
---@param location string Dot-separated path within domain structure (e.g. "Items.Log")
|
|
||||||
---@param force boolean? Whether to overwrite the target location.
|
|
||||||
Api.addModToGlobalSpace = function(mod, location, force)
|
|
||||||
-- Ensure `mod` type and that it's not empty
|
|
||||||
Ensure.argType(mod, 'table', 1, 'Api.addModToGlobalSpace')
|
|
||||||
|
|
||||||
-- Ensure `location` type and that it's not empty
|
|
||||||
Ensure.argType(location, 'string', 2, 'Api.addModToGlobalSpace')
|
|
||||||
Ensure.stringArgNotEmpty(location, 2, 'Api.addModToGlobalSpace')
|
|
||||||
|
|
||||||
-- Ensure `location` matches this format: 'field.subfield.subsubfield.<...>'
|
|
||||||
-- TODO: баг: ликвидные имена не определяются шаблоном
|
|
||||||
--[[if not location:match('^[%a_][%w_]*([%.][%a_][%w_]*)*$') then
|
|
||||||
error('bad argument #2 to \'Api.addModToGlobalSpace\' (invalid format)')
|
|
||||||
end--]]
|
|
||||||
|
|
||||||
-- Split `location` into fields -- TODO: !!!Make a String function!!!
|
|
||||||
local fields = {}
|
|
||||||
local domain = nil
|
|
||||||
for field in string.gmatch(location, '[^.]+') do
|
|
||||||
if domain ~= nil then
|
|
||||||
table.insert(fields, field)
|
|
||||||
else
|
|
||||||
domain = field
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Ensure the domain is allowed
|
|
||||||
Ensure.argIsAllowed(domain, allowedDomains , 2, 'Api.addModToGlobalSpace')
|
|
||||||
|
|
||||||
-- Handle case where we're modifying the domain root directly
|
|
||||||
if #fields == 0 then
|
|
||||||
error('Not allowed to directly write into the \''.. domain ..'\' domain')
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Start traversing from the domain's table
|
|
||||||
local current = _G[domain]
|
|
||||||
assert(type(current) == 'table', 'The global domain is not a table')
|
|
||||||
|
|
||||||
-- Traverse each field of the location
|
|
||||||
local num_fields = #fields
|
|
||||||
for i = 1, num_fields - 1 do
|
|
||||||
local field = fields[i]
|
|
||||||
if current[field] == nil then
|
|
||||||
current[field] = {}
|
|
||||||
end
|
|
||||||
current = current[field]
|
|
||||||
assert(type(current) == 'table', 'intermediate field is not a table')
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Assign mod to the final field
|
|
||||||
local last_field = fields[num_fields]
|
|
||||||
if force and current[last_field] ~= nil then
|
|
||||||
error(string.format('field \'%s\' already exists in \'%s\'', last_field, location))
|
|
||||||
end
|
|
||||||
current[last_field] = mod
|
|
||||||
end
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
name = smc__api__api_loader
|
|
||||||
description = Include this mod in your `depends` to ensure all necessary APIs are loaded for your mod
|
|
||||||
depends = smc__api__ensure, smc__api__math, smc__api__mod, smc__api__require, smc__api__table, smc__api__string, smc__api__utf8,
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
name = smc__api__ensure
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
name = smc__api__logger
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
local math = math
|
|
||||||
|
|
||||||
math.lerp = function (a, b, t)
|
|
||||||
return a + (b - a) * t
|
|
||||||
end
|
|
||||||
|
|
||||||
math.clamp = function(value, min, max)
|
|
||||||
return math.min(math.max(value, min), max)
|
|
||||||
end
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
name = smc__api__math
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
name = smc__api__mod
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
name = smc__api__require
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
name = smc__api__string
|
|
||||||
depends = smc__api__ensure
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
name = smc__api__table
|
|
||||||
depends = smc__api__ensure
|
|
||||||
Submodule mods/API/Utf8 deleted from d612fc127f
0
mods/API/Utf8/init.lua
Normal file
0
mods/API/Utf8/init.lua
Normal file
@@ -1 +0,0 @@
|
|||||||
name = smc__api
|
|
||||||
4
mods/CORE/Control/init.lua
Normal file
4
mods/CORE/Control/init.lua
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
local modInfo = Mod.getInfo('smc__core__control')
|
||||||
|
local require = modInfo.require
|
||||||
|
|
||||||
|
return require('Control')
|
||||||
2
mods/CORE/Control/mod.conf
Normal file
2
mods/CORE/Control/mod.conf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
name = smc__core__control
|
||||||
|
depends = smc__system__system_loader
|
||||||
140
mods/CORE/Control/src/Control.lua
Normal file
140
mods/CORE/Control/src/Control.lua
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
---@class Events.Control
|
||||||
|
local Control = {}
|
||||||
|
|
||||||
|
-- control.on_press
|
||||||
|
Events.registerEvent('control.on_press')
|
||||||
|
|
||||||
|
---@param callbackFunc fun(player:Player, controlName:string)
|
||||||
|
function Control.subcribeOnPress(callbackFunc)
|
||||||
|
Events.subscribe('control.on_press', callbackFunc)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- control.on_release
|
||||||
|
Events.registerEvent('control.on_release')
|
||||||
|
|
||||||
|
---@param callbackFunc fun(player:Player, controlName:string, holdTime:number)
|
||||||
|
function Control.subcribeOnRelease(callbackFunc)
|
||||||
|
Events.subscribe('control.on_release', callbackFunc)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- control.on_hold
|
||||||
|
Events.registerEvent('control.on_hold')
|
||||||
|
|
||||||
|
---@param callbackFunc fun(player:Player, controlName:string, holdTime:number, dtime:number)
|
||||||
|
function Control.subcribeOnHold(callbackFunc)
|
||||||
|
Events.subscribe('control.on_hold', callbackFunc)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- control.on_wield_change
|
||||||
|
Events.registerEvent('control.on_wield_change')
|
||||||
|
|
||||||
|
---@param callbackFunc fun(player:Player, player_wield_index:number, player_last_wield_index:number)
|
||||||
|
function Control.subcribeOnWieldChange(callbackFunc)
|
||||||
|
Events.subscribe('control.on_wield_change', callbackFunc)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- --- Call events ---
|
||||||
|
|
||||||
|
local ControlPressKeys = {
|
||||||
|
'up', 'down', 'left', 'right', 'jump', 'aux1', 'sneak', 'dig', 'place', 'zoom'
|
||||||
|
}
|
||||||
|
|
||||||
|
local ControlMovementKeys = {
|
||||||
|
'movement_x', 'movement_y'
|
||||||
|
}
|
||||||
|
|
||||||
|
local playersLastControl = {}
|
||||||
|
local playersControlTimer = {}
|
||||||
|
|
||||||
|
core.register_on_joinplayer(function(player, last_login)
|
||||||
|
local playerName = player:get_player_name()
|
||||||
|
if playerName == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local nowControl = player:get_player_control()
|
||||||
|
if nowControl == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local controlTimer = {}
|
||||||
|
for _, key in ipairs(ControlPressKeys) do
|
||||||
|
controlTimer[key] = 0.0
|
||||||
|
end
|
||||||
|
|
||||||
|
playersLastControl[playerName] = nowControl
|
||||||
|
playersControlTimer[playerName] = controlTimer
|
||||||
|
end)
|
||||||
|
|
||||||
|
core.register_on_leaveplayer(function(player, timed_out)
|
||||||
|
local playerName = player:get_player_name()
|
||||||
|
if playerName == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
playersLastControl[playerName] = nil
|
||||||
|
playersControlTimer[playerName] = nil
|
||||||
|
end)
|
||||||
|
|
||||||
|
Smc.registerGlobalStepForEachPlayer(0, function(deltaTime, player)
|
||||||
|
if player == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local playerName = player:get_player_name()
|
||||||
|
if playerName == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local lastControl = playersLastControl[playerName]
|
||||||
|
if lastControl == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local controlTimer = playersControlTimer[playerName]
|
||||||
|
if controlTimer == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local nowControl = player:get_player_control()
|
||||||
|
if nowControl == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
for _, key in ipairs(ControlPressKeys) do
|
||||||
|
local lastPressed = lastControl[key]
|
||||||
|
local nowPressed = nowControl[key]
|
||||||
|
|
||||||
|
-- on_press
|
||||||
|
if not lastPressed and nowPressed then
|
||||||
|
Events.call('control.on_press', key)
|
||||||
|
|
||||||
|
controlTimer[key] = 0
|
||||||
|
|
||||||
|
-- on_release
|
||||||
|
elseif lastPressed and not nowPressed then
|
||||||
|
Events.call('control.on_release', key, controlTimer[key])
|
||||||
|
|
||||||
|
controlTimer[key] = 0
|
||||||
|
|
||||||
|
-- on_hold
|
||||||
|
elseif lastPressed and nowPressed then
|
||||||
|
Events.call('control.on_hold', key, controlTimer[key], deltaTime)
|
||||||
|
|
||||||
|
controlTimer[key] = controlTimer[key] + deltaTime
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--TODO: add player movement callbacks
|
||||||
|
|
||||||
|
--TODO: add mouse movement callbacks on dir
|
||||||
|
|
||||||
|
playersLastControl[playerName] = nowControl
|
||||||
|
playersControlTimer[playerName] = controlTimer
|
||||||
|
end)
|
||||||
|
|
||||||
|
return Control
|
||||||
4
mods/CORE/CraftSystem/init.lua
Normal file
4
mods/CORE/CraftSystem/init.lua
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
local modInfo = Mod.getInfo('smc__core__craft_system')
|
||||||
|
local require = modInfo.require
|
||||||
|
|
||||||
|
return require('CraftSystem')
|
||||||
2
mods/CORE/CraftSystem/mod.conf
Normal file
2
mods/CORE/CraftSystem/mod.conf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
name = smc__core__craft_system
|
||||||
|
depends = smc__system__system_loader
|
||||||
117
mods/CORE/CraftSystem/src/CraftSystem.lua
Normal file
117
mods/CORE/CraftSystem/src/CraftSystem.lua
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
local HASH_SPLITTER = '&'
|
||||||
|
|
||||||
|
local modInfo = Mod.getInfo('smc__core__craft_system')
|
||||||
|
local require = modInfo.require
|
||||||
|
|
||||||
|
---@alias CraftSystem.shapelessCraftsList table<CraftSystem.Craft.Group, table<string, CraftSystem.ShapelessCraft[]>>
|
||||||
|
---@alias CraftSystem.processualCraftsList table<CraftSystem.Craft.Group, table<string, CraftSystem.ProcessualCraft[]>>
|
||||||
|
|
||||||
|
---@class CraftSystem
|
||||||
|
---@field shapelessCraftsList CraftSystem.shapelessCraftsList
|
||||||
|
---@field processualCraftsList CraftSystem.processualCraftsList
|
||||||
|
local CraftSystem = {
|
||||||
|
shapelessCraftsList = {},
|
||||||
|
processualCraftsList = {},
|
||||||
|
}
|
||||||
|
|
||||||
|
---@alias CraftSystem.Craft.Type
|
||||||
|
---|'shapeless'
|
||||||
|
---|'processual'
|
||||||
|
---@alias CraftSystem.Craft.Group string
|
||||||
|
---@alias CraftSystem.Craft.Recipe string[]
|
||||||
|
|
||||||
|
---@alias shapelessCraftFunc fun(self:CraftSystem.ShapelessCraft, input:ItemStack[], workbenchMeta:NodeMetaRef?):boolean
|
||||||
|
---@alias processualCraftFunc fun(self:CraftSystem.ProcessualCraft, input:ItemStack[], workbenchMeta:NodeMetaRef?, processTime:number):boolean
|
||||||
|
|
||||||
|
---@class CraftSystem.BaseCraft
|
||||||
|
---@field type CraftSystem.Craft.Type
|
||||||
|
---@field group CraftSystem.Craft.Group
|
||||||
|
---@field output string
|
||||||
|
---@field recipe CraftSystem.Craft.Recipe
|
||||||
|
---@field return table? TODO: доделать тут тип
|
||||||
|
---@field craftFunc (fun(self, ...):boolean)?
|
||||||
|
|
||||||
|
---@class CraftSystem.ShapelessCraft : CraftSystem.BaseCraft
|
||||||
|
---@field craftFunc shapelessCraftFunc?
|
||||||
|
|
||||||
|
---@class CraftSystem.ProcessualCraft : CraftSystem.BaseCraft
|
||||||
|
---@field processTime number
|
||||||
|
---@field craftFunc processualCraftFunc?
|
||||||
|
|
||||||
|
---@param type CraftSystem.Craft.Type
|
||||||
|
---@return CraftSystem.shapelessCraftsList|CraftSystem.processualCraftsList
|
||||||
|
local function getCraftList(type)
|
||||||
|
local craftList
|
||||||
|
|
||||||
|
if type == 'shapeless' then
|
||||||
|
craftList = CraftSystem.shapelessCraftsList
|
||||||
|
elseif type == 'processual' then
|
||||||
|
craftList = CraftSystem.processualCraftsList
|
||||||
|
else
|
||||||
|
error(string.format('Craft type `%s` does not exist.', type))
|
||||||
|
end
|
||||||
|
|
||||||
|
return craftList
|
||||||
|
end
|
||||||
|
|
||||||
|
---@param type CraftSystem.Craft.Type
|
||||||
|
---@param group CraftSystem.Craft.Group
|
||||||
|
---@return table<string, table>
|
||||||
|
local function getCraftGroup(type, group)
|
||||||
|
local craftList = getCraftList(type)
|
||||||
|
|
||||||
|
---@type table<string, table>?
|
||||||
|
local craftGroup = craftList[group]
|
||||||
|
|
||||||
|
assert(craftGroup ~= nil, string.format('Craft group `%s` does not exist.', type))
|
||||||
|
|
||||||
|
return craftGroup
|
||||||
|
end
|
||||||
|
|
||||||
|
---@param type CraftSystem.Craft.Type
|
||||||
|
---@param group CraftSystem.Craft.Group
|
||||||
|
function CraftSystem.registerCraftGroup(type, group)
|
||||||
|
local craftList = getCraftList(type)
|
||||||
|
|
||||||
|
assert(craftList[group] == nil, string.format('Craft group `%s` is already registered.', type))
|
||||||
|
|
||||||
|
craftList[group] = {}
|
||||||
|
end
|
||||||
|
|
||||||
|
---@param recipe CraftSystem.Craft.Recipe
|
||||||
|
---@return string
|
||||||
|
function CraftSystem.getCraftHash(recipe)
|
||||||
|
table.sort(recipe)
|
||||||
|
|
||||||
|
local hash = ''
|
||||||
|
|
||||||
|
for i = 0, #recipe-1 do
|
||||||
|
hash = hash..recipe[i]..HASH_SPLITTER
|
||||||
|
end
|
||||||
|
|
||||||
|
return hash..recipe[#recipe]
|
||||||
|
end
|
||||||
|
|
||||||
|
---@param craftDef CraftSystem.ShapelessCraft|CraftSystem.ProcessualCraft
|
||||||
|
function CraftSystem.registerCraft(craftDef)
|
||||||
|
local craftGroup = getCraftGroup(craftDef.type, craftDef.group)
|
||||||
|
|
||||||
|
local hash = CraftSystem.getCraftHash(craftDef.recipe)
|
||||||
|
|
||||||
|
table.insert(craftGroup[hash], craftDef)
|
||||||
|
end
|
||||||
|
|
||||||
|
---@param type CraftSystem.Craft.Type
|
||||||
|
---@param group CraftSystem.Craft.Group
|
||||||
|
---@return CraftSystem.ShapelessCraft[] |
|
||||||
|
--- CraftSystem.processualCraftsList[] |
|
||||||
|
--- nil
|
||||||
|
function CraftSystem.getCraftResults(type, group, recipe)
|
||||||
|
local craftGroup = getCraftGroup(type, group)
|
||||||
|
|
||||||
|
local hash = CraftSystem.getCraftHash(recipe)
|
||||||
|
|
||||||
|
return craftGroup[hash]
|
||||||
|
end
|
||||||
|
|
||||||
|
return CraftSystem
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
local Enum = Mod:new()
|
|
||||||
|
|
||||||
Enum.Class = Enum.require('Enum')
|
|
||||||
|
|
||||||
Api.addModToGlobalSpace(Enum, 'Core.Enum')
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
name = smc__core__enum
|
|
||||||
depends = smc__api__api_loader
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
---Abstract class implementing enumeration. It is a table<ENUM_KEY, ENUM_KEY>. Read-only table!
|
|
||||||
---@abstract
|
|
||||||
---@class Enum
|
|
||||||
local Enum = {}
|
|
||||||
|
|
||||||
---@param enum table[]
|
|
||||||
---@return Enum
|
|
||||||
function Enum:new(enum)
|
|
||||||
local metaEnum = {}
|
|
||||||
|
|
||||||
-- Create table<ENUM_KEY, ENUM_KEY>
|
|
||||||
for _, v in ipairs(enum) do
|
|
||||||
metaEnum[v] = v
|
|
||||||
end
|
|
||||||
|
|
||||||
---@type Enum
|
|
||||||
local instance = setmetatable({}, {
|
|
||||||
__index = metaEnum,
|
|
||||||
__newindex = function()
|
|
||||||
error('The Enum table is read only!')
|
|
||||||
end,
|
|
||||||
__metatable = false
|
|
||||||
})
|
|
||||||
|
|
||||||
return instance
|
|
||||||
end
|
|
||||||
|
|
||||||
---@alias Enum.EnumKey string Key from enumeration
|
|
||||||
|
|
||||||
return Enum
|
|
||||||
4
mods/CORE/Formspec/init.lua
Normal file
4
mods/CORE/Formspec/init.lua
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
local modInfo = Mod.getInfo('smc__core__formspec')
|
||||||
|
local require = modInfo.require
|
||||||
|
|
||||||
|
return require('Formspec')
|
||||||
2
mods/CORE/Formspec/mod.conf
Normal file
2
mods/CORE/Formspec/mod.conf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
name = smc__core__formspec
|
||||||
|
depends = smc__system__system_loader
|
||||||
1180
mods/CORE/Formspec/src/Formspec.lua
Normal file
1180
mods/CORE/Formspec/src/Formspec.lua
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,4 @@
|
|||||||
local Item = Mod:new()
|
local modInfo = Mod.getInfo('smc__core__item')
|
||||||
|
local require = modInfo.require
|
||||||
|
|
||||||
Item.Class = Item.require('Item')
|
return require('Item')
|
||||||
|
|
||||||
Api.addModToGlobalSpace(Item, 'Core.Item')
|
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
name = smc__core__item
|
name = smc__core__item
|
||||||
depends = smc__api__api_loader, smc__core__enum, smc__core__item_factory
|
depends = smc__system__system_loader, smc__core__item_factory
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
local modInfo = Mod.getInfo()
|
local getInstance = Class.getInstance
|
||||||
|
|
||||||
|
local modInfo = Mod.getInfo('smc__core__item')
|
||||||
local require = modInfo.require
|
local require = modInfo.require
|
||||||
|
|
||||||
local VisualEnum = require('Item.VisualEnum')
|
local ItemFactory = Mod.getInfo('smc__core__item_factory').require('ItemFactory')
|
||||||
|
|
||||||
---@class Item
|
---@class Item
|
||||||
---@field itemDef Item.ItemDefinition
|
---@field itemDef Item.ItemDefinition
|
||||||
@@ -11,9 +13,12 @@ local VisualEnum = require('Item.VisualEnum')
|
|||||||
local Item = {
|
local Item = {
|
||||||
defaultDef = {
|
defaultDef = {
|
||||||
settings = {
|
settings = {
|
||||||
name = "",
|
name = '',
|
||||||
title = "",
|
title = '',
|
||||||
description = "",
|
description = '',
|
||||||
|
titleColor = '#FFFFFF',
|
||||||
|
descriptionColor = '#C0C0C0',
|
||||||
|
addModName = true,
|
||||||
},
|
},
|
||||||
callbacks = {}
|
callbacks = {}
|
||||||
}
|
}
|
||||||
@@ -28,10 +33,35 @@ end
|
|||||||
---@param itemDef Item.ItemDefinition
|
---@param itemDef Item.ItemDefinition
|
||||||
---@return NodeDefinition|ItemDefinition
|
---@return NodeDefinition|ItemDefinition
|
||||||
local function itemDefToLuantiDef(itemDef)
|
local function itemDefToLuantiDef(itemDef)
|
||||||
|
local modName = Mod.getInfo().shortName
|
||||||
|
local S = core.get_translator(modName)
|
||||||
|
|
||||||
itemDef = table.copy(itemDef)
|
itemDef = table.copy(itemDef)
|
||||||
local s = itemDef.settings
|
local s = itemDef.settings
|
||||||
local c = itemDef.callbacks
|
local c = itemDef.callbacks
|
||||||
local description = s.title .. "\n" .. s.description
|
|
||||||
|
if s.addModName then
|
||||||
|
s.name = modName .. ':' .. s.name
|
||||||
|
end
|
||||||
|
|
||||||
|
local title = s.title
|
||||||
|
local description = s.description
|
||||||
|
|
||||||
|
if title == nil or title == '' then
|
||||||
|
title = string.match(s.name, '%S:(%S+)')..'-title'
|
||||||
|
end
|
||||||
|
|
||||||
|
if description == nil or description == '' then
|
||||||
|
description = string.match(s.name, '%S:(%S+)')..'-desc'
|
||||||
|
end
|
||||||
|
|
||||||
|
if s.titleColor ~= nil and s.descriptionColor ~= nil then
|
||||||
|
description = core.colorize(s.titleColor ,S(title))..'\n'..
|
||||||
|
core.colorize(s.descriptionColor, S(description))
|
||||||
|
else
|
||||||
|
error('Item description color parameters cannot be empty.')
|
||||||
|
end
|
||||||
|
|
||||||
s.title, s.description = nil, description
|
s.title, s.description = nil, description
|
||||||
|
|
||||||
local luantiDef = defMerge(s, c)
|
local luantiDef = defMerge(s, c)
|
||||||
@@ -61,28 +91,28 @@ local defMerge = function(...)
|
|||||||
return table.merge(...)
|
return table.merge(...)
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param itemDef Item.ItemDefinition
|
---@param itemDef Item.ItemDefinition|Node.NodeDefinition
|
||||||
---@return Item
|
---@return Item
|
||||||
function Item:new(itemDef)
|
function Item:new(itemDef)
|
||||||
---Adding default parameters
|
---Adding default parameters
|
||||||
itemDef = defMerge(itemDef, self.defaultDef, true)
|
itemDef = defMerge(itemDef, self.defaultDef, true)
|
||||||
|
|
||||||
---@type Item
|
---@type Item
|
||||||
local instance = setmetatable({}, {__index = self})
|
local instance = getInstance(self, {})
|
||||||
|
|
||||||
local luantiDef = itemDefToLuantiDef(itemDef)
|
local luantiDef = itemDefToLuantiDef(itemDef)
|
||||||
local visual = itemDef.settings.visual
|
local visual = itemDef.settings.visual
|
||||||
|
|
||||||
if visual == nil then
|
if visual == nil then
|
||||||
visual = VisualEnum.ITEM_2D
|
visual = 'item_2d'
|
||||||
end
|
end
|
||||||
|
|
||||||
itemDef.settings.visual = nil
|
itemDef.settings.visual = nil
|
||||||
|
|
||||||
if visual == VisualEnum.ITEM_3D then
|
if visual == 'item_3d' then
|
||||||
register3dItem(luantiDef)
|
register3dItem(luantiDef)
|
||||||
else
|
else
|
||||||
visual = VisualEnum.ITEM_2D
|
visual = 'item_2d'
|
||||||
registerFlatItem(luantiDef)
|
registerFlatItem(luantiDef)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -103,7 +133,7 @@ end
|
|||||||
---@return Item
|
---@return Item
|
||||||
function Item:getExtended(defaultDef)
|
function Item:getExtended(defaultDef)
|
||||||
---@type Item
|
---@type Item
|
||||||
local ChildClass = Mod:getClassExtended(self, {
|
local ChildClass = Class.extend(self, {
|
||||||
defaultDef = defaultDef,
|
defaultDef = defaultDef,
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -119,7 +149,7 @@ function Item:getFactory(defaultDef)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---@type ItemFactory
|
---@type ItemFactory
|
||||||
local instance = Core.ItemFactory():new(self, defaultDef)
|
local instance = ItemFactory:new(self, defaultDef)
|
||||||
|
|
||||||
return instance
|
return instance
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
---@class Item.Callbacks
|
---@class Item.Callbacks
|
||||||
local Callbacks = {}
|
local Callbacks = {}
|
||||||
|
|
||||||
-- TODO: Разобраться с дубликатами аннотаций полей. Приоритетно брать аннотации из util/ide-helper
|
|
||||||
|
|
||||||
---Called when the 'place' key was pressed with the item in hand
|
---Called when the 'place' key was pressed with the item in hand
|
||||||
---and pointing at a node.
|
---and pointing at a node.
|
||||||
---Shall place item and return the leftover itemstack
|
---Shall place item and return the leftover itemstack
|
||||||
|
|||||||
@@ -3,7 +3,11 @@ local Settings = {}
|
|||||||
|
|
||||||
---Technical name of the item. Must be unique and have the format `mod_name:item_name`
|
---Technical name of the item. Must be unique and have the format `mod_name:item_name`
|
||||||
---@type string
|
---@type string
|
||||||
Settings.name = ""
|
Settings.name = ''
|
||||||
|
|
||||||
|
---Whether to add the mod name to the settings.name. Default: `true`
|
||||||
|
---@type boolean?
|
||||||
|
Settings.addModName = nil
|
||||||
|
|
||||||
---Item description. 1st line of item description.
|
---Item description. 1st line of item description.
|
||||||
---@type string?
|
---@type string?
|
||||||
@@ -13,10 +17,25 @@ Settings.title = nil
|
|||||||
---@type string?
|
---@type string?
|
||||||
Settings.description = nil
|
Settings.description = nil
|
||||||
|
|
||||||
|
---Item title color in description.
|
||||||
|
---
|
||||||
|
---Default: `#FFFFFF`
|
||||||
|
---@type ColorString?
|
||||||
|
Settings.titleColor = nil
|
||||||
|
|
||||||
|
---Item description color in description.
|
||||||
|
---
|
||||||
|
---Default: `#C0C0C0`
|
||||||
|
---@type ColorString?
|
||||||
|
Settings.descriptionColor = nil
|
||||||
|
|
||||||
|
---@alias Item.Visual
|
||||||
|
---'item_2d'|
|
||||||
|
---'item_3d'
|
||||||
|
|
||||||
---Visual node type.
|
---Visual node type.
|
||||||
---Values are specified via an enumeration `Item.VisualEnum`.
|
---@type Item.Visual?
|
||||||
---@type Enum.EnumKey?
|
Settings.visual = nil
|
||||||
Settings.visual = ""
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
---@class Item.VisualEnum : Enum
|
|
||||||
---@field ITEM_2D Enum.EnumKey
|
|
||||||
---@field ITEM_3D Enum.EnumKey
|
|
||||||
local VisualEnum = Core.Enum:getModClassInstance({
|
|
||||||
'ITEM_2D',
|
|
||||||
'ITEM_3D',
|
|
||||||
})
|
|
||||||
|
|
||||||
return VisualEnum
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
local ItemFactory = Mod:new()
|
local modInfo = Mod.getInfo('smc__core__item_factory')
|
||||||
|
local require = modInfo.require
|
||||||
|
|
||||||
ItemFactory.Class = ItemFactory.require('ItemFactory')
|
return require('ItemFactory')
|
||||||
|
|
||||||
Api.addModToGlobalSpace(ItemFactory, 'Core.ItemFactory')
|
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
name = smc__core__item_factory
|
name = smc__core__item_factory
|
||||||
depends = smc__api__api_loader
|
depends = smc__system__system_loader
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
local getInstance = Class.getInstance
|
||||||
|
|
||||||
---@class ItemFactory
|
---@class ItemFactory
|
||||||
---@field defaultDef Item.ItemDefinition|Node.NodeDefinition
|
---@field defaultDef Item.ItemDefinition|Node.NodeDefinition
|
||||||
---@field itemClass Item|Node
|
---@field itemClass Item|Node
|
||||||
@@ -8,10 +10,10 @@ local ItemFactory = {}
|
|||||||
---@return ItemFactory
|
---@return ItemFactory
|
||||||
function ItemFactory:new(itemClass, defaultDef)
|
function ItemFactory:new(itemClass, defaultDef)
|
||||||
---@type ItemFactory
|
---@type ItemFactory
|
||||||
local instance = setmetatable({
|
local instance =getInstance(self, {
|
||||||
defaultDef = defaultDef,
|
defaultDef = defaultDef,
|
||||||
itemClass = itemClass,
|
itemClass = itemClass,
|
||||||
}, {__index = self})
|
})
|
||||||
|
|
||||||
return instance
|
return instance
|
||||||
end
|
end
|
||||||
@@ -23,22 +25,11 @@ local defMerge = function(...)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---@param itemDefs Item.ItemDefinition[]|Node.NodeDefinition[] List of nodes with parameters unique to them.
|
---@param itemDefs Item.ItemDefinition[]|Node.NodeDefinition[] List of nodes with parameters unique to them.
|
||||||
---@param addModName boolean? Whether to add the mod name to the settings.name. Default: `true`
|
function ItemFactory:registerItems(itemDefs)
|
||||||
function ItemFactory:registerItems(itemDefs, addModName)
|
|
||||||
if addModName == nil then
|
|
||||||
addModName = true
|
|
||||||
end
|
|
||||||
|
|
||||||
local modName = Mod.getInfo().shortName
|
|
||||||
|
|
||||||
---@param nodeDef Item.ItemDefinition | Node.NodeDefinition
|
---@param nodeDef Item.ItemDefinition | Node.NodeDefinition
|
||||||
for _, itemDef in ipairs(itemDefs) do
|
for _, itemDef in ipairs(itemDefs) do
|
||||||
itemDef = defMerge(itemDef, self.defaultDef, true)
|
itemDef = defMerge(itemDef, self.defaultDef, true)
|
||||||
|
|
||||||
if addModName then
|
|
||||||
itemDef.settings.name = modName .. ':' .. itemDef.settings.name
|
|
||||||
end
|
|
||||||
|
|
||||||
self.itemClass:new(itemDef)
|
self.itemClass:new(itemDef)
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -50,34 +41,20 @@ local defMerge = function(...)
|
|||||||
return table.merge(...)
|
return table.merge(...)
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param shortNodeDefs table Table of the form `{ {name, title, description, tiles}, {name, title, description, tiles}, ...}`
|
---@param shortNodeDefs [string, (string[]|TileDefinition[])?][] Format list {{name, tiles}, {name, tiles}, ...}
|
||||||
---@param addModName boolean? Whether to add the mod name to the settings.name. Default: `true`
|
function ItemFactory:registerNodesByShortDef(shortNodeDefs)
|
||||||
function ItemFactory:registerNodesByShortDef(shortNodeDefs, addModName)
|
|
||||||
if addModName == nil then
|
|
||||||
addModName = true
|
|
||||||
end
|
|
||||||
|
|
||||||
local modName = Mod.getInfo().shortName
|
|
||||||
|
|
||||||
for _, shortNodeDef in ipairs(shortNodeDefs) do
|
for _, shortNodeDef in ipairs(shortNodeDefs) do
|
||||||
---@type Node.NodeDefinition
|
---@type Node.NodeDefinition
|
||||||
local nodeDef = {
|
local nodeDef = {
|
||||||
settings = {
|
settings = {
|
||||||
name = shortNodeDef[1],
|
name = shortNodeDef[1],
|
||||||
title = shortNodeDef[2],
|
tiles = shortNodeDef[2]
|
||||||
description = shortNodeDef[3],
|
|
||||||
tiles = shortNodeDef[4]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nodeDef = defMerge(nodeDef, self.defaultDef, true)
|
nodeDef = defMerge(nodeDef, self.defaultDef, true)
|
||||||
|
|
||||||
if addModName then
|
|
||||||
nodeDef.settings.name = modName .. ':' .. nodeDef.settings.name
|
|
||||||
end
|
|
||||||
|
|
||||||
self.itemClass:new(nodeDef)
|
self.itemClass:new(nodeDef)
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
local MapGen = Mod:new()
|
local modInfo = Mod.getInfo('smc__core__map_gen')
|
||||||
|
local require = modInfo.require
|
||||||
|
|
||||||
MapGen.Class = MapGen.require('MapGen')
|
return require('MapGen')
|
||||||
|
|
||||||
Api.addModToGlobalSpace(MapGen, 'Core.MapGen')
|
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
name = smc__core__map_gen
|
name = smc__core__map_gen
|
||||||
depends = smc__api__api_loader, smc__game__items__rocks, smc__game__items__liquids
|
depends = smc__system__system_loader
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,7 @@
|
|||||||
|
local id = core.get_content_id
|
||||||
|
|
||||||
|
local getInstance = Class.getInstance
|
||||||
|
|
||||||
---@class MapGen.Biome
|
---@class MapGen.Biome
|
||||||
---@field name string
|
---@field name string
|
||||||
---@field tempPoint number
|
---@field tempPoint number
|
||||||
@@ -5,12 +9,19 @@
|
|||||||
---@field minY number
|
---@field minY number
|
||||||
---@field maxY number
|
---@field maxY number
|
||||||
---@field groundNodes MapGen.Biome.GroundNodes
|
---@field groundNodes MapGen.Biome.GroundNodes
|
||||||
|
---@field groundNodesIDs MapGen.Biome.GroundNodesIDs
|
||||||
---@field soilHeight number
|
---@field soilHeight number
|
||||||
---@field generateRock fun(mapGenerator:MapGen, biome:MapGen.Biome, data:number[], index:number, x:number, y:number, z:number)
|
---@field generateAir generateFunc
|
||||||
---@field generateSoil fun(mapGenerator:MapGen, biome:MapGen.Biome, data:number[], index:number, x:number, y:number, z:number)
|
---@field generateCavernAir generateFunc
|
||||||
---@field generateBottom fun(mapGenerator:MapGen, biome:MapGen.Biome, data:number[], index:number, x:number, y:number, z:number)
|
---@field generateWater generateFunc
|
||||||
|
---@field generateRock generateFunc
|
||||||
|
---@field generateTurf generateFunc
|
||||||
|
---@field generateSoil generateFunc
|
||||||
|
---@field generateBottom generateFunc
|
||||||
local Biome = {}
|
local Biome = {}
|
||||||
|
|
||||||
|
---@alias generateFunc fun(self, mapGenerator:MapGen, data:number[], index:number, x:number, y:number, z:number)
|
||||||
|
|
||||||
---Definition table for the `MapGen.Biome`.
|
---Definition table for the `MapGen.Biome`.
|
||||||
---
|
---
|
||||||
---**Only for EmmyLua.**
|
---**Only for EmmyLua.**
|
||||||
@@ -21,44 +32,92 @@ local Biome = {}
|
|||||||
---@field maxY number
|
---@field maxY number
|
||||||
---@field groundNodes MapGen.Biome.GroundNodes
|
---@field groundNodes MapGen.Biome.GroundNodes
|
||||||
---@field soilHeight number
|
---@field soilHeight number
|
||||||
---@field generateRock fun(mapGenerator:MapGen, biome:MapGen.Biome, data:number[], index:number, x:number, y:number, z:number)?
|
---@field generateAir generateFunc?
|
||||||
---@field generateSoil fun(mapGenerator:MapGen, biome:MapGen.Biome, data:number[], index:number, x:number, y:number, z:number)?
|
---@field generateCavernAir generateFunc?
|
||||||
---@field generateBottom fun(mapGenerator:MapGen, biome:MapGen.Biome, data:number[], index:number, x:number, y:number, z:number)?
|
---@field generateWater generateFunc?
|
||||||
|
---@field generateRock generateFunc?
|
||||||
|
---@field generateTurf generateFunc?
|
||||||
|
---@field generateSoil generateFunc?
|
||||||
|
---@field generateBottom generateFunc?
|
||||||
|
|
||||||
|
|
||||||
-- Default generate functions
|
-- Default generate functions
|
||||||
|
|
||||||
|
---@param self MapGen.Biome
|
||||||
---@param mapGenerator MapGen
|
---@param mapGenerator MapGen
|
||||||
---@param biome MapGen.Biome
|
|
||||||
---@param data number[]
|
---@param data number[]
|
||||||
---@param index number
|
---@param index number
|
||||||
---@param x number
|
---@param x number
|
||||||
---@param y number
|
---@param y number
|
||||||
---@param z number
|
---@param z number
|
||||||
local defaultGenerateRock = function(mapGenerator, biome, data, index, x, y, z)
|
local defaultGenerateAir = function(self, mapGenerator, data, index, x, y, z)
|
||||||
--TODO: минимальную логику генерации прописать
|
data[index] = mapGenerator.nodeIDs.air
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@param self MapGen.Biome
|
||||||
---@param mapGenerator MapGen
|
---@param mapGenerator MapGen
|
||||||
---@param biome MapGen.Biome
|
|
||||||
---@param data number[]
|
---@param data number[]
|
||||||
---@param index number
|
---@param index number
|
||||||
---@param x number
|
---@param x number
|
||||||
---@param y number
|
---@param y number
|
||||||
---@param z number
|
---@param z number
|
||||||
local defaultGenerateSoil = function(mapGenerator, biome, data, index, x, y, z)
|
local defaultGenerateCavernAir = function(self, mapGenerator, data, index, x, y, z)
|
||||||
--TODO: минимальную логику генерации прописать
|
self:generateAir(mapGenerator, data, index, x, y, z)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@param self MapGen.Biome
|
||||||
---@param mapGenerator MapGen
|
---@param mapGenerator MapGen
|
||||||
---@param biome MapGen.Biome
|
|
||||||
---@param data number[]
|
---@param data number[]
|
||||||
---@param index number
|
---@param index number
|
||||||
---@param x number
|
---@param x number
|
||||||
---@param y number
|
---@param y number
|
||||||
---@param z number
|
---@param z number
|
||||||
local defaultGenerateBottom = function(mapGenerator, biome, data, index, x, y, z)
|
local defaultGenerateWater = function(self, mapGenerator, data, index, x, y, z)
|
||||||
--TODO: минимальную логику генерации прописать
|
data[index] = mapGenerator.nodeIDs.water
|
||||||
|
end
|
||||||
|
|
||||||
|
---@param self MapGen.Biome
|
||||||
|
---@param mapGenerator MapGen
|
||||||
|
---@param data number[]
|
||||||
|
---@param index number
|
||||||
|
---@param x number
|
||||||
|
---@param y number
|
||||||
|
---@param z number
|
||||||
|
local defaultGenerateRock = function(self, mapGenerator, data, index, x, y, z)
|
||||||
|
data[index] = self.groundNodesIDs.rock
|
||||||
|
end
|
||||||
|
|
||||||
|
---@param self MapGen.Biome
|
||||||
|
---@param mapGenerator MapGen
|
||||||
|
---@param data number[]
|
||||||
|
---@param index number
|
||||||
|
---@param x number
|
||||||
|
---@param y number
|
||||||
|
---@param z number
|
||||||
|
local defaultGenerateTurf = function(self, mapGenerator, data, index, x, y, z)
|
||||||
|
data[index] = self.groundNodesIDs.turf
|
||||||
|
end
|
||||||
|
|
||||||
|
---@param self MapGen.Biome
|
||||||
|
---@param mapGenerator MapGen
|
||||||
|
---@param data number[]
|
||||||
|
---@param index number
|
||||||
|
---@param x number
|
||||||
|
---@param y number
|
||||||
|
---@param z number
|
||||||
|
local defaultGenerateSoil = function(self, mapGenerator,data, index, x, y, z)
|
||||||
|
data[index] = self.groundNodesIDs.soil
|
||||||
|
end
|
||||||
|
|
||||||
|
---@param self MapGen.Biome
|
||||||
|
---@param mapGenerator MapGen
|
||||||
|
---@param data number[]
|
||||||
|
---@param index number
|
||||||
|
---@param x number
|
||||||
|
---@param y number
|
||||||
|
---@param z number
|
||||||
|
local defaultGenerateBottom = function(self, mapGenerator, data, index, x, y, z)
|
||||||
|
data[index] = self.groundNodesIDs.bottom
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -66,34 +125,65 @@ end
|
|||||||
---@param def MapGen.BiomeDef
|
---@param def MapGen.BiomeDef
|
||||||
---@return MapGen.Biome
|
---@return MapGen.Biome
|
||||||
function Biome:new(name, def)
|
function Biome:new(name, def)
|
||||||
|
if def.generateAir == nil then
|
||||||
|
Logger.infoLog('MapGen.Biome: The `%s` biome does not have a specified `generateAir()` function. The default function is used.', name)
|
||||||
|
def.generateAir = defaultGenerateAir
|
||||||
|
end
|
||||||
|
|
||||||
|
if def.generateCavernAir == nil then
|
||||||
|
Logger.infoLog('MapGen.Biome: The `%s` biome does not have a specified `generateCavernAir()` function. The default function is used.', name)
|
||||||
|
def.generateCavernAir = defaultGenerateCavernAir
|
||||||
|
end
|
||||||
|
|
||||||
|
if def.generateWater == nil then
|
||||||
|
Logger.infoLog('MapGen.Biome: The `%s` biome does not have a specified `generateWater()` function. The default function is used.', name)
|
||||||
|
def.generateWater = defaultGenerateWater
|
||||||
|
end
|
||||||
|
|
||||||
if def.generateRock == nil then
|
if def.generateRock == nil then
|
||||||
Logger.warningLog('MapGen.Biome: The `%s` biome does not have a specified `generateRock()` function. The default function is used.', name)
|
Logger.infoLog('MapGen.Biome: The `%s` biome does not have a specified `generateRock()` function. The default function is used.', name)
|
||||||
def.generateRock = defaultGenerateRock
|
def.generateRock = defaultGenerateRock
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if def.generateTurf == nil then
|
||||||
|
Logger.infoLog('MapGen.Biome: The `%s` biome does not have a specified `generateTurf()` function. The default function is used.', name)
|
||||||
|
def.generateTurf = defaultGenerateTurf
|
||||||
|
end
|
||||||
|
|
||||||
if def.generateSoil == nil then
|
if def.generateSoil == nil then
|
||||||
Logger.warningLog('MapGen.Biome: The `%s` biome does not have a specified `generateSoil()` function. The default function is used.', name)
|
Logger.infoLog('MapGen.Biome: The `%s` biome does not have a specified `generateSoil()` function. The default function is used.', name)
|
||||||
def.generateSoil = defaultGenerateSoil
|
def.generateSoil = defaultGenerateSoil
|
||||||
end
|
end
|
||||||
|
|
||||||
if def.generateBottom == nil then
|
if def.generateBottom == nil then
|
||||||
Logger.warningLog('MapGen.Biome: The `%s` biome does not have a specified `generateBottom()` function. The default function is used.', name)
|
Logger.infoLog('MapGen.Biome: The `%s` biome does not have a specified `generateBottom()` function. The default function is used.', name)
|
||||||
def.generateBottom = defaultGenerateBottom
|
def.generateBottom = defaultGenerateBottom
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local groundNodesIDs = {}
|
||||||
|
-- Converting node names to IDs
|
||||||
|
for k, v in pairs(def.groundNodes) do
|
||||||
|
groundNodesIDs[k] = id(v)
|
||||||
|
end
|
||||||
|
|
||||||
---@type MapGen.Biome
|
---@type MapGen.Biome
|
||||||
local instance = setmetatable({
|
local instance = getInstance(self, {
|
||||||
name = name,
|
name = name,
|
||||||
tempPoint = def.tempPoint,
|
tempPoint = def.tempPoint,
|
||||||
humidityPoint = def.humidityPoint,
|
humidityPoint = def.humidityPoint,
|
||||||
minY = def.minY,
|
minY = def.minY,
|
||||||
maxY = def.maxY,
|
maxY = def.maxY,
|
||||||
groundNodes = def.groundNodes,
|
groundNodes = def.groundNodes,
|
||||||
|
groundNodesIDs = groundNodesIDs,
|
||||||
soilHeight = def.soilHeight,
|
soilHeight = def.soilHeight,
|
||||||
generateRock = def.generateRock or defaultGenerateRock,
|
generateAir = def.generateAir,
|
||||||
generateSoil = def.generateSoil or defaultGenerateSoil,
|
generateCavernAir = def.generateCavernAir,
|
||||||
generateBottom = def.generateBottom or defaultGenerateBottom,
|
generateWater = def.generateWater,
|
||||||
}, {__index = self})
|
generateRock = def.generateRock,
|
||||||
|
generateSoil = def.generateSoil,
|
||||||
|
generateTurf = def.generateTurf,
|
||||||
|
generateBottom = def.generateBottom,
|
||||||
|
})
|
||||||
|
|
||||||
return instance
|
return instance
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
---@class MapGen.Biome.GroundNodes
|
---@class MapGen.Biome.GroundNodes
|
||||||
---@field turf string The soil covering the surface of the biome
|
---@field turf string The soil covering the surface of the biome
|
||||||
---@field soil string The soil beneath the turf. The height of this layer depends on `Biome.soilHeight`
|
---@field soil string The soil beneath the turf. The height of this layer depends on `Biome.soilHeight`
|
||||||
|
---@field rock string The rock found beneath the soil of a biome.
|
||||||
|
---@field bottom string Covering the bottom of reservoirs.
|
||||||
local GroundNodes = {}
|
local GroundNodes = {}
|
||||||
|
|
||||||
return GroundNodes
|
return GroundNodes
|
||||||
|
|||||||
11
mods/CORE/MapGen/src/MapGen/Biome/GroundNodesIds.lua
Normal file
11
mods/CORE/MapGen/src/MapGen/Biome/GroundNodesIds.lua
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
--- Only for EmmyLua
|
||||||
|
|
||||||
|
---**Only for EmmyLua.**
|
||||||
|
---@class MapGen.Biome.GroundNodesIDs
|
||||||
|
---@field turf number The soil covering the surface of the biome
|
||||||
|
---@field soil number The soil beneath the turf. The height of this layer depends on `Biome.soilHeight`
|
||||||
|
---@field rock number The rock found beneath the soil of a biome.
|
||||||
|
---@field bottom number Covering the bottom of reservoirs.
|
||||||
|
local GroundNodes = {}
|
||||||
|
|
||||||
|
return GroundNodes
|
||||||
@@ -1,8 +1,11 @@
|
|||||||
local mathMin, mathMax, mathAbs
|
local mathMin, mathMax, mathAbs, mathClamp
|
||||||
= math.min, math.max, math.abs
|
= math.min, math.max, math.abs, math.clamp
|
||||||
|
|
||||||
|
local getInstance = Class.getInstance
|
||||||
|
|
||||||
---@class MapGen.Cavern
|
---@class MapGen.Cavern
|
||||||
---@field name string
|
---@field name string
|
||||||
|
---@field isRegional boolean
|
||||||
---@field minY number
|
---@field minY number
|
||||||
---@field maxY number
|
---@field maxY number
|
||||||
---@field smoothDistance number
|
---@field smoothDistance number
|
||||||
@@ -16,6 +19,7 @@ local Cavern = {}
|
|||||||
---
|
---
|
||||||
---**Only for EmmyLua.**
|
---**Only for EmmyLua.**
|
||||||
---@class MapGen.CavernDef
|
---@class MapGen.CavernDef
|
||||||
|
---@field isRegional boolean?
|
||||||
---@field minY number
|
---@field minY number
|
||||||
---@field maxY number
|
---@field maxY number
|
||||||
---@field noiseParams NoiseParams
|
---@field noiseParams NoiseParams
|
||||||
@@ -50,13 +54,14 @@ function Cavern:new(name, def)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---@type MapGen.Cavern
|
---@type MapGen.Cavern
|
||||||
local instance = setmetatable({
|
local instance = getInstance(self, {
|
||||||
name = name,
|
name = name,
|
||||||
minY = def.minY,
|
minY = def.minY,
|
||||||
maxY = def.maxY,
|
maxY = def.maxY,
|
||||||
smoothDistance = def.smoothDistance,
|
smoothDistance = def.smoothDistance,
|
||||||
threshold = def.threshold,
|
threshold = def.threshold,
|
||||||
}, {__index = self})
|
isRegional = def.isRegional or false,
|
||||||
|
})
|
||||||
|
|
||||||
function instance:getNoise()
|
function instance:getNoise()
|
||||||
return _noise
|
return _noise
|
||||||
@@ -77,32 +82,49 @@ function Cavern:new(name, def)
|
|||||||
return instance
|
return instance
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param y number
|
---@param distance number
|
||||||
---@param minY number
|
|
||||||
---@param maxY number
|
|
||||||
---@param smoothDistance number
|
|
||||||
---@return number
|
---@return number
|
||||||
local function calcCavernWeight(y, smoothDistance, minY, maxY)
|
function Cavern:calcCavernWeight(distance)
|
||||||
local maxDist = maxY - y
|
return mathClamp(distance / self.smoothDistance, 0, 1)
|
||||||
local minDist = y - minY
|
|
||||||
|
|
||||||
return mathMax(0, mathMin(maxDist / smoothDistance, minDist / smoothDistance, 1))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---Returns `true` if there is a cavern at the specified coordinates.
|
---Returns `true` if there is a cavern at the specified coordinates.
|
||||||
---@param x number
|
---@param x integer
|
||||||
---@param y number
|
---@param y integer
|
||||||
---@param z number
|
---@param z integer
|
||||||
|
---@param distance number
|
||||||
---@return boolean
|
---@return boolean
|
||||||
function Cavern:isCavern(x, y, z)
|
function Cavern:isCavern(x, y, z, distance)
|
||||||
|
local minY, maxY = self.minY, self.maxY
|
||||||
|
|
||||||
|
if y >= maxY or y <= minY then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
distance = mathMin(maxY - y, y - minY, distance)
|
||||||
|
|
||||||
|
local noise = self:getNoise()
|
||||||
|
local weight = self:calcCavernWeight(distance)
|
||||||
|
|
||||||
|
return noise:get_3d({x = x, y = y, z = z}) * weight > self.threshold
|
||||||
|
end
|
||||||
|
|
||||||
|
---Returns `true` if there is a cavern at the specified coordinates.
|
||||||
|
---@param x integer
|
||||||
|
---@param y integer
|
||||||
|
---@param z integer
|
||||||
|
---@return boolean
|
||||||
|
function Cavern:isLayeredCavern(x, y, z)
|
||||||
local minY, maxY = self.minY, self.maxY
|
local minY, maxY = self.minY, self.maxY
|
||||||
|
|
||||||
if y > maxY or y < minY then
|
if y > maxY or y < minY then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local distance = mathMin(maxY - y, y - minY)
|
||||||
|
|
||||||
local noise = self:getNoise()
|
local noise = self:getNoise()
|
||||||
local weight = calcCavernWeight(y, self.smoothDistance, minY, maxY)
|
local weight = self:calcCavernWeight(distance)
|
||||||
|
|
||||||
return noise:get_3d({x = x, y = y, z = z}) * weight > self.threshold
|
return noise:get_3d({x = x, y = y, z = z}) * weight > self.threshold
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
local getInstance = Class.getInstance
|
||||||
|
|
||||||
---**NOT IMPLEMENTED**
|
---**NOT IMPLEMENTED**
|
||||||
---@class MapGen.Decoration
|
---@class MapGen.Decoration
|
||||||
local Decoration = {}
|
local Decoration = {}
|
||||||
@@ -5,9 +7,9 @@ local Decoration = {}
|
|||||||
---@return MapGen.Decoration
|
---@return MapGen.Decoration
|
||||||
function Decoration:new()
|
function Decoration:new()
|
||||||
---@type MapGen.Decoration
|
---@type MapGen.Decoration
|
||||||
local instance = setmetatable({
|
local instance = getInstance(self, {
|
||||||
|
|
||||||
}, {__index = self})
|
})
|
||||||
|
|
||||||
return instance
|
return instance
|
||||||
end
|
end
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user