mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 17:51:24 +01:00
refactor: rivers generation
This commit is contained in:
parent
c1e7d6f54a
commit
3215b6f0d2
18 changed files with 739 additions and 704 deletions
|
|
@ -2,7 +2,7 @@ import * as d3 from "d3";
|
|||
|
||||
import {DISTANCE_FIELD, MIN_LAND_HEIGHT} from "config/generation";
|
||||
import {TIME} from "config/logging";
|
||||
import {INT8_MAX} from "constants";
|
||||
import {INT8_MAX} from "config/constants";
|
||||
import {aleaPRNG} from "scripts/aleaPRNG";
|
||||
import {getFeatureVertices} from "scripts/connectVertices";
|
||||
import {createTypedArray, unique} from "utils/arrayUtils";
|
||||
|
|
@ -254,7 +254,7 @@ function addFeature({
|
|||
function getLakeElevation() {
|
||||
const MIN_ELEVATION_DELTA = 0.1;
|
||||
const minShoreHeight = d3.min(shoreline.map(cellId => heights[cellId])) || MIN_LAND_HEIGHT;
|
||||
return minShoreHeight - MIN_ELEVATION_DELTA;
|
||||
return rn(minShoreHeight - MIN_ELEVATION_DELTA, 2);
|
||||
}
|
||||
|
||||
const feature: IPackFeatureLake = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue