mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 18:11:24 +01:00
fix for parameters
This commit is contained in:
parent
1a3d7dbcf1
commit
85a2308cd7
2 changed files with 5 additions and 6 deletions
|
|
@ -1,15 +1,14 @@
|
||||||
import { ERROR } from "config/logging";
|
import { ERROR } from "config/logging";
|
||||||
import { aleaPRNG } from "scripts/aleaPRNG";
|
import { aleaPRNG } from "scripts/aleaPRNG";
|
||||||
import { clipPoly, getGridPolygonWithGrid, last, normalize, P, rn } from "utils";
|
import { clipPoly, getGridPolygonLocal, last, normalize, P, rn } from "utils";
|
||||||
|
|
||||||
export function generateIce(
|
export function generateIce(
|
||||||
gridCells: Pick<IGrid["cells"],"i" | "h" | "c"| "v" | "f" | "t" | "temp">,
|
grid: IGrid,
|
||||||
vertices: IGraphVertices,
|
|
||||||
gridPoints: TPoints,
|
|
||||||
features: TGridFeatures,
|
features: TGridFeatures,
|
||||||
): IIce {
|
): IIce {
|
||||||
const shieldMin = -8; // max temp to form ice shield (glacier)
|
const shieldMin = -8; // max temp to form ice shield (glacier)
|
||||||
const icebergMax = 1; // max temp to form an iceberg
|
const icebergMax = 1; // max temp to form an iceberg
|
||||||
|
const { cells: gridCells, points: gridPoints, vertices } = grid;
|
||||||
const nOfCells = gridCells.i.length;
|
const nOfCells = gridCells.i.length;
|
||||||
const used = new Uint8Array(gridCells.i.length);
|
const used = new Uint8Array(gridCells.i.length);
|
||||||
|
|
||||||
|
|
@ -52,7 +51,7 @@ export function generateIce(
|
||||||
// Helper functions
|
// Helper functions
|
||||||
function generateIceberg(i: number, size: number): IiceBerg {
|
function generateIceberg(i: number, size: number): IiceBerg {
|
||||||
const cellMidPoint = gridPoints[i];
|
const cellMidPoint = gridPoints[i];
|
||||||
const points: TPoints = getGridPolygonWithGrid(i, gridCells, vertices)
|
const points: TPoints = getGridPolygonLocal(i, grid)
|
||||||
.map((point) => [
|
.map((point) => [
|
||||||
(point[0] + (cellMidPoint[0] - point[0]) * size) | 0,
|
(point[0] + (cellMidPoint[0] - point[0]) * size) | 0,
|
||||||
(point[1] + (cellMidPoint[1] - point[1]) * size) | 0,
|
(point[1] + (cellMidPoint[1] - point[1]) * size) | 0,
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,7 @@ export function createPack(grid: IGrid): IPack {
|
||||||
|
|
||||||
const rivers = specifyRivers(rawRivers, cultureIds, cultures);
|
const rivers = specifyRivers(rawRivers, cultureIds, cultures);
|
||||||
const features = generateLakeNames(mergedFeatures, cultureIds, cultures);
|
const features = generateLakeNames(mergedFeatures, cultureIds, cultures);
|
||||||
const ice = generateIce(grid.cells, grid.vertices, grid.points, features);
|
const ice = generateIce(grid, features);
|
||||||
|
|
||||||
// Military.generate();
|
// Military.generate();
|
||||||
// Markers.generate();
|
// Markers.generate();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue