implement basic tectonics + tectonic direction and velocity

This commit is contained in:
Dobidop 2026-03-22 12:04:48 +01:00
parent f2fc42799b
commit 6bda3c3c16
10 changed files with 2010 additions and 9 deletions

View file

@ -0,0 +1,60 @@
export interface TectonicPlate {
id: number;
cells: Set<number>;
isOceanic: boolean;
velocity: [number, number, number]; // 3D velocity vector on sphere surface
baseElevation: number;
seedCell: number;
}
export type BoundarySubtype =
| "cont-cont"
| "ocean-cont"
| "ocean-ocean"
| "cont-rift"
| "ocean-rift"
| "transform";
export interface PlateBoundary {
plateA: number;
plateB: number;
cells: number[];
convergence: number;
subtype: BoundarySubtype;
}
export interface TectonicConfig {
plateCount: number;
continentalRatio: number;
collisionIntensity: number;
noiseLevel: number;
hotspotCount: number;
smoothingPasses: number;
erosionPasses: number;
seaLevel: number; // elevation shift: 0 = default, positive = more water, negative = more land
}
export const DEFAULT_TECTONIC_CONFIG: TectonicConfig = {
plateCount: 12,
continentalRatio: 0.35,
collisionIntensity: 1.0,
noiseLevel: 0.3,
hotspotCount: 3,
smoothingPasses: 3,
erosionPasses: 2,
seaLevel: 0
};
export interface TectonicMetadata {
plateIds: Uint8Array;
boundaryType: Int8Array;
roughness: Float32Array;
isOceanic: Uint8Array;
plates: TectonicPlate[];
boundaries: PlateBoundary[];
}
declare global {
var tectonicMetadata: TectonicMetadata | null;
var tectonicGenerator: import("../modules/tectonic-generator").TectonicPlateGenerator | null;
}

View file

@ -15,6 +15,7 @@ declare global {
var options: any;
var heightmapTemplates: any;
var tectonicTemplates: any;
var Routes: any;
var populationRate: number;
var urbanDensity: number;