genshin-engine 4.3.1 → 4.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { Color, MathUtils } from "three";
2
- //#region src/random/createSeededRandom.ts
2
+ // src/random/createSeededRandom.ts
3
3
  const createSeededRandom = (seed) => {
4
4
  let state = seed;
5
5
  return () => {
@@ -9,8 +9,7 @@ const createSeededRandom = (seed) => {
9
9
  return ((mixed ^ mixed >>> 14) >>> 0) / 2 ** 32;
10
10
  };
11
11
  };
12
- //#endregion
13
- //#region src/models/terrain/GroundLayer.ts
12
+ // src/models/terrain/GroundLayer.ts
14
13
  let GroundLayer = /* @__PURE__ */ function(GroundLayer) {
15
14
  GroundLayer["Earth"] = "Earth";
16
15
  GroundLayer["Grass"] = "Grass";
@@ -21,16 +20,14 @@ let GroundLayer = /* @__PURE__ */ function(GroundLayer) {
21
20
  return GroundLayer;
22
21
  }({});
23
22
  const GroundLayers = Object.values(GroundLayer);
24
- //#endregion
25
- //#region src/models/terrain/TerrainFeatureKind.ts
23
+ // src/models/terrain/TerrainFeatureKind.ts
26
24
  let TerrainFeatureKind = /* @__PURE__ */ function(TerrainFeatureKind) {
27
25
  TerrainFeatureKind["Cliff"] = "cliff";
28
26
  TerrainFeatureKind["Plateau"] = "plateau";
29
27
  TerrainFeatureKind["Ridge"] = "ridge";
30
28
  return TerrainFeatureKind;
31
29
  }({});
32
- //#endregion
33
- //#region src/noise/createSimplexNoise.ts
30
+ // src/noise/createSimplexNoise.ts
34
31
  const SKEW = (Math.sqrt(3) - 1) / 2;
35
32
  const UNSKEW = (3 - Math.sqrt(3)) / 6;
36
33
  const GRADIENTS_X = [
@@ -82,8 +79,7 @@ const createSimplexNoise = (seed) => {
82
79
  return NOISE_SCALE * (getCornerContribution(permutation[tableX + (permutation[tableY] ?? 0)] ?? 0, offsetX, offsetY) + getCornerContribution(permutation[tableX + middleX + (permutation[tableY + middleY] ?? 0)] ?? 0, offsetX - middleX + UNSKEW, offsetY - middleY + UNSKEW) + getCornerContribution(permutation[tableX + 1 + (permutation[tableY + 1] ?? 0)] ?? 0, offsetX - 1 + 2 * UNSKEW, offsetY - 1 + 2 * UNSKEW));
83
80
  };
84
81
  };
85
- //#endregion
86
- //#region src/terrain/constants.ts
82
+ // src/terrain/constants.ts
87
83
  const TILE_INDEX_OFFSET = 2 ** 19;
88
84
  const TILE_INDEX_SPAN = 2 ** 20;
89
85
  const TERRAIN_LAYER = 1;
@@ -91,11 +87,9 @@ const TERRAIN_RING_INITIAL_TILE_COUNT = 64;
91
87
  const TERRAIN_CELL_SIZE = 64;
92
88
  const GAUSSIAN_REACH_WIDTHS = 3;
93
89
  const TERRAIN_HEIGHT_PADDING = 2;
94
- //#endregion
95
- //#region src/terrain/getTerrainTileLevel.ts
90
+ // src/terrain/getTerrainTileLevel.ts
96
91
  const getTerrainTileLevel = (key) => Math.floor(key / TILE_INDEX_SPAN / TILE_INDEX_SPAN);
97
- //#endregion
98
- //#region src/terrain/measureSegment.ts
92
+ // src/terrain/measureSegment.ts
99
93
  const measurement = /* @__PURE__ */ new Float64Array(2);
100
94
  const measureSegment = ({ endX, endZ, startX, startZ }, x, z) => {
101
95
  const directionX = endX - startX;
@@ -108,8 +102,7 @@ const measureSegment = ({ endX, endZ, startX, startZ }, x, z) => {
108
102
  measurement[1] = Math.max(0, -along, along - length);
109
103
  return measurement;
110
104
  };
111
- //#endregion
112
- //#region src/terrain/getCliffBlend.ts
105
+ // src/terrain/getCliffBlend.ts
113
106
  const getCliffBlend = (feature, x, z) => {
114
107
  const measurement = measureSegment(feature, x, z);
115
108
  const across = measurement[0] ?? 0;
@@ -117,14 +110,12 @@ const getCliffBlend = (feature, x, z) => {
117
110
  const { falloff, width } = feature;
118
111
  return MathUtils.smoothstep(across, -falloff, falloff) * (1 - MathUtils.smoothstep(across, width, width + falloff)) * (1 - MathUtils.smoothstep(beyond, 0, falloff));
119
112
  };
120
- //#endregion
121
- //#region src/terrain/getPlateauBlend.ts
113
+ // src/terrain/getPlateauBlend.ts
122
114
  const getPlateauBlend = (feature, x, z) => {
123
115
  const { falloff, radius, x: centreX, z: centreZ } = feature;
124
116
  return 1 - MathUtils.smoothstep(Math.hypot(x - centreX, z - centreZ), radius, radius + falloff);
125
117
  };
126
- //#endregion
127
- //#region src/terrain/getRidgeBlend.ts
118
+ // src/terrain/getRidgeBlend.ts
128
119
  const getRidgeBlend = (feature, x, z) => {
129
120
  const measurement = measureSegment(feature, x, z);
130
121
  const across = measurement[0] ?? 0;
@@ -132,15 +123,13 @@ const getRidgeBlend = (feature, x, z) => {
132
123
  const { width } = feature;
133
124
  return Math.exp(-(across ** 2 + beyond ** 2) / (2 * width * width));
134
125
  };
135
- //#endregion
136
- //#region src/terrain/TerrainFeatureKindBlendMap.ts
126
+ // src/terrain/TerrainFeatureKindBlendMap.ts
137
127
  const TerrainFeatureKindBlendMap = {
138
128
  ["cliff"]: getCliffBlend,
139
129
  ["plateau"]: getPlateauBlend,
140
130
  ["ridge"]: getRidgeBlend
141
131
  };
142
- //#endregion
143
- //#region src/terrain/blendGridNodes.ts
132
+ // src/terrain/blendGridNodes.ts
144
133
  const blendGridNodes = (values, sizeX, sizeZ, column, row) => {
145
134
  const left = Math.floor(column);
146
135
  const near = Math.floor(row);
@@ -150,14 +139,11 @@ const blendGridNodes = (values, sizeX, sizeZ, column, row) => {
150
139
  const along = row - near;
151
140
  return ((values[near * sizeX + left] ?? 0) * (1 - across) + (values[near * sizeX + right] ?? 0) * across) * (1 - along) + ((values[far * sizeX + left] ?? 0) * (1 - across) + (values[far * sizeX + right] ?? 0) * across) * along;
152
141
  };
153
- //#endregion
154
- //#region src/terrain/getTerrainTileColumn.ts
142
+ // src/terrain/getTerrainTileColumn.ts
155
143
  const getTerrainTileColumn = (key) => key % TILE_INDEX_SPAN - TILE_INDEX_OFFSET;
156
- //#endregion
157
- //#region src/terrain/getTerrainTileRow.ts
144
+ // src/terrain/getTerrainTileRow.ts
158
145
  const getTerrainTileRow = (key) => Math.floor(key / TILE_INDEX_SPAN) % TILE_INDEX_SPAN - TILE_INDEX_OFFSET;
159
- //#endregion
160
- //#region src/terrain/computeTerrainTile.ts
146
+ // src/terrain/computeTerrainTile.ts
161
147
  const writeNormal = (normals, offset, heights, paddedIndex, paddedSide, reach, step) => {
162
148
  const height = heights[paddedIndex] ?? 0;
163
149
  const normalX = (heights[paddedIndex - reach] ?? height) - (heights[paddedIndex + reach] ?? height);
@@ -224,8 +210,7 @@ const computeTerrainTile = ({ cellsPerSide, finestTileSize, getHeight, key, writ
224
210
  positions
225
211
  };
226
212
  };
227
- //#endregion
228
- //#region src/terrain/fileByCell.ts
213
+ // src/terrain/fileByCell.ts
229
214
  const NO_ITEMS = [];
230
215
  const toCellKey = (column, row) => `${column},${row}`;
231
216
  const fileByCell = (items, getBounds) => {
@@ -241,8 +226,7 @@ const fileByCell = (items, getBounds) => {
241
226
  }
242
227
  return (x, z) => cellItemsMap.get(toCellKey(Math.floor(x / 64), Math.floor(z / 64))) ?? NO_ITEMS;
243
228
  };
244
- //#endregion
245
- //#region src/terrain/getGaussianHillBlend.ts
229
+ // src/terrain/getGaussianHillBlend.ts
246
230
  const getGaussianHillBlend = ({ width, x: hillX, z: hillZ }, x, z) => {
247
231
  const reach = 3 * width;
248
232
  const acrossX = x - hillX;
@@ -250,8 +234,7 @@ const getGaussianHillBlend = ({ width, x: hillX, z: hillZ }, x, z) => {
250
234
  if (Math.abs(acrossX) > reach || Math.abs(acrossZ) > reach) return 0;
251
235
  return Math.exp(-(acrossX ** 2 + acrossZ ** 2) / (2 * width * width));
252
236
  };
253
- //#endregion
254
- //#region src/terrain/createGaussianHillsHeight.ts
237
+ // src/terrain/createGaussianHillsHeight.ts
255
238
  const createGaussianHillsHeight = ({ base, hills }) => {
256
239
  const getHills = fileByCell(hills, ({ width, x, z }) => {
257
240
  const reach = 3 * width;
@@ -268,16 +251,14 @@ const createGaussianHillsHeight = ({ base, hills }) => {
268
251
  return total;
269
252
  };
270
253
  };
271
- //#endregion
272
- //#region src/terrain/getSegmentBounds.ts
254
+ // src/terrain/getSegmentBounds.ts
273
255
  const getSegmentBounds = (startX, startZ, endX, endZ, reach) => ({
274
256
  maxX: Math.max(startX, endX) + reach,
275
257
  maxZ: Math.max(startZ, endZ) + reach,
276
258
  minX: Math.min(startX, endX) - reach,
277
259
  minZ: Math.min(startZ, endZ) - reach
278
260
  });
279
- //#endregion
280
- //#region src/terrain/sampleGroundLayerField.ts
261
+ // src/terrain/sampleGroundLayerField.ts
281
262
  const sampleGroundLayerField = ({ cellSize, layers, origin, size }, x, z, weights) => {
282
263
  const sizeX = size[0] ?? 1;
283
264
  const sizeZ = size[1] ?? 1;
@@ -296,8 +277,7 @@ const sampleGroundLayerField = ({ cellSize, layers, origin, size }, x, z, weight
296
277
  }
297
278
  for (const layer of GroundLayers) weights[layer] /= total;
298
279
  };
299
- //#endregion
300
- //#region src/terrain/createGroundLayerWeights.ts
280
+ // src/terrain/createGroundLayerWeights.ts
301
281
  const getBandAmount = ({ end, start }, value) => end >= start ? MathUtils.smoothstep(value, start, end) : 1 - MathUtils.smoothstep(value, end, start);
302
282
  const layOver = (weights, layer, amount) => {
303
283
  if (amount === 0) return;
@@ -335,8 +315,7 @@ const createGroundLayerWeights = ({ earthSlope, layerField, pathFalloff, paths,
335
315
  return weights;
336
316
  };
337
317
  };
338
- //#endregion
339
- //#region src/terrain/createGroundPaintColor.ts
318
+ // src/terrain/createGroundPaintColor.ts
340
319
  const createGroundPaintColor = (groundPaint, seed) => {
341
320
  const { layerColors, patchScale } = groundPaint;
342
321
  const getWeights = createGroundLayerWeights(groundPaint);
@@ -366,8 +345,7 @@ const createGroundPaintColor = (groundPaint, seed) => {
366
345
  colors[offset + 2] = blue;
367
346
  };
368
347
  };
369
- //#endregion
370
- //#region src/terrain/sampleTerrainResidualFade.ts
348
+ // src/terrain/sampleTerrainResidualFade.ts
371
349
  const sampleTerrainResidualFade = ({ cellSize, clearings, origin, size, weights }, x, z) => {
372
350
  const sizeX = size[0] ?? 1;
373
351
  const sizeZ = size[1] ?? 1;
@@ -378,8 +356,7 @@ const sampleTerrainResidualFade = ({ cellSize, clearings, origin, size, weights
378
356
  for (const { falloff, radius, x: centreX, z: centreZ } of clearings) weight *= MathUtils.smoothstep(Math.hypot(x - centreX, z - centreZ), radius, radius + falloff);
379
357
  return weight;
380
358
  };
381
- //#endregion
382
- //#region src/terrain/createResidualHeight.ts
359
+ // src/terrain/createResidualHeight.ts
383
360
  const createResidualHeight = ({ amplitude, fade, octaves, scale, seed }) => {
384
361
  const noise = createSimplexNoise(seed);
385
362
  return (x, z) => {
@@ -396,8 +373,7 @@ const createResidualHeight = ({ amplitude, fade, octaves, scale, seed }) => {
396
373
  return weight * total;
397
374
  };
398
375
  };
399
- //#endregion
400
- //#region src/terrain/getTerrainFeatureBounds.ts
376
+ // src/terrain/getTerrainFeatureBounds.ts
401
377
  const TerrainFeatureKindBoundsMap = {
402
378
  ["cliff"]: (feature) => {
403
379
  const { endX, endZ, falloff, startX, startZ, width } = feature;
@@ -419,8 +395,7 @@ const TerrainFeatureKindBoundsMap = {
419
395
  }
420
396
  };
421
397
  const getTerrainFeatureBounds = (feature) => TerrainFeatureKindBoundsMap[feature.kind](feature);
422
- //#endregion
423
- //#region src/terrain/createTerrainFeaturesBlend.ts
398
+ // src/terrain/createTerrainFeaturesBlend.ts
424
399
  const createTerrainFeaturesBlend = (features) => {
425
400
  const getFeatures = fileByCell(features, getTerrainFeatureBounds);
426
401
  return (x, z) => {
@@ -429,8 +404,7 @@ const createTerrainFeaturesBlend = (features) => {
429
404
  return blend;
430
405
  };
431
406
  };
432
- //#endregion
433
- //#region src/terrain/createTerrainFeaturesHeight.ts
407
+ // src/terrain/createTerrainFeaturesHeight.ts
434
408
  const createTerrainFeaturesHeight = (features) => {
435
409
  const getFeatures = fileByCell(features, getTerrainFeatureBounds);
436
410
  return (x, z) => {
@@ -439,8 +413,7 @@ const createTerrainFeaturesHeight = (features) => {
439
413
  return total;
440
414
  };
441
415
  };
442
- //#endregion
443
- //#region src/terrain/getTerrainShapeLevel.ts
416
+ // src/terrain/getTerrainShapeLevel.ts
444
417
  const getTerrainShapeLevel = ({ base, hills }, baseUnder) => {
445
418
  if (hills.length === 0) return void 0;
446
419
  let minX = Infinity;
@@ -464,8 +437,7 @@ const getTerrainShapeLevel = ({ base, hills }, baseUnder) => {
464
437
  z: (minZ + maxZ) / 2
465
438
  };
466
439
  };
467
- //#endregion
468
- //#region src/terrain/createTerrainShapeHeight.ts
440
+ // src/terrain/createTerrainShapeHeight.ts
469
441
  const createTerrainShapeHeight = (shape, ...overlays) => {
470
442
  const shapes = [shape, ...overlays];
471
443
  const features = shapes.flatMap((layer) => layer.features ?? []);
@@ -485,8 +457,7 @@ const createTerrainShapeHeight = (shape, ...overlays) => {
485
457
  return getHillsHeight(x, z) + getFeaturesHeight(x, z) + residualHeight;
486
458
  };
487
459
  };
488
- //#endregion
489
- //#region src/vegetation/computeScatterPoints.ts
460
+ // src/vegetation/computeScatterPoints.ts
490
461
  const CELL_SIZE_PER_SPACING = 1 / Math.SQRT2;
491
462
  const CELL_REACH = Math.ceil(Math.SQRT2);
492
463
  const checkIsCrowded = (cells, cellsPerSide, points, spacing, column, row, x, z) => {
@@ -516,5 +487,4 @@ const computeScatterPoints = ({ candidateCount, checkIsAccepted, seed, size, spa
516
487
  }
517
488
  return Float32Array.from(points);
518
489
  };
519
- //#endregion
520
490
  export { TERRAIN_RING_INITIAL_TILE_COUNT as A, getCliffBlend as C, TERRAIN_CELL_SIZE as D, GAUSSIAN_REACH_WIDTHS as E, GroundLayer as F, GroundLayers as I, createSeededRandom as L, TILE_INDEX_SPAN as M, createSimplexNoise as N, TERRAIN_HEIGHT_PADDING as O, TerrainFeatureKind as P, getPlateauBlend as S, getTerrainTileLevel as T, getTerrainTileRow as _, createTerrainFeaturesBlend as a, TerrainFeatureKindBlendMap as b, sampleTerrainResidualFade as c, sampleGroundLayerField as d, getSegmentBounds as f, computeTerrainTile as g, fileByCell as h, createTerrainFeaturesHeight as i, TILE_INDEX_OFFSET as j, TERRAIN_LAYER as k, createGroundPaintColor as l, getGaussianHillBlend as m, createTerrainShapeHeight as n, getTerrainFeatureBounds as o, createGaussianHillsHeight as p, getTerrainShapeLevel as r, createResidualHeight as s, computeScatterPoints as t, createGroundLayerWeights as u, getTerrainTileColumn as v, measureSegment as w, getRidgeBlend as x, blendGridNodes as y };
@@ -1,11 +1,8 @@
1
- //#region src/models/terrain/TerrainFeatureKind.d.ts
2
1
  declare enum TerrainFeatureKind {
3
2
  Cliff = "cliff",
4
3
  Plateau = "plateau",
5
4
  Ridge = "ridge"
6
5
  }
7
- //#endregion
8
- //#region src/models/terrain/CliffFeature.d.ts
9
6
  interface CliffFeature {
10
7
  endX: number;
11
8
  endZ: number;
@@ -16,28 +13,20 @@ interface CliffFeature {
16
13
  startZ: number;
17
14
  width: number;
18
15
  }
19
- //#endregion
20
- //#region src/models/terrain/GaussianHill.d.ts
21
16
  interface GaussianHill {
22
17
  height: number;
23
18
  width: number;
24
19
  x: number;
25
20
  z: number;
26
21
  }
27
- //#endregion
28
- //#region src/models/terrain/GaussianHills.d.ts
29
22
  interface GaussianHills {
30
23
  base: number;
31
24
  hills: GaussianHill[];
32
25
  }
33
- //#endregion
34
- //#region src/models/terrain/GroundBand.d.ts
35
26
  interface GroundBand {
36
27
  end: number;
37
28
  start: number;
38
29
  }
39
- //#endregion
40
- //#region src/models/terrain/GroundLayer.d.ts
41
30
  declare enum GroundLayer {
42
31
  Earth = "Earth",
43
32
  Grass = "Grass",
@@ -47,22 +36,16 @@ declare enum GroundLayer {
47
36
  Snow = "Snow"
48
37
  }
49
38
  declare const GroundLayers: readonly GroundLayer[];
50
- //#endregion
51
- //#region src/models/terrain/GroundLayerColors.d.ts
52
39
  interface GroundLayerColors {
53
40
  color: number;
54
41
  patchColor: number;
55
42
  }
56
- //#endregion
57
- //#region src/models/terrain/GroundLayerField.d.ts
58
43
  interface GroundLayerField {
59
44
  cellSize: number;
60
45
  layers: Partial<Record<GroundLayer, readonly number[]>>;
61
46
  origin: readonly number[];
62
47
  size: readonly number[];
63
48
  }
64
- //#endregion
65
- //#region src/models/terrain/GroundPathSegment.d.ts
66
49
  interface GroundPathSegment {
67
50
  endX: number;
68
51
  endZ: number;
@@ -70,8 +53,6 @@ interface GroundPathSegment {
70
53
  startZ: number;
71
54
  width: number;
72
55
  }
73
- //#endregion
74
- //#region src/models/terrain/GroundPaint.d.ts
75
56
  interface GroundPaint {
76
57
  earthSlope?: GroundBand;
77
58
  layerColors: Record<GroundLayer, GroundLayerColors>;
@@ -83,8 +64,6 @@ interface GroundPaint {
83
64
  sandHeight?: GroundBand;
84
65
  snowHeight?: GroundBand;
85
66
  }
86
- //#endregion
87
- //#region src/models/terrain/PlateauFeature.d.ts
88
67
  interface PlateauFeature {
89
68
  falloff: number;
90
69
  height: number;
@@ -93,8 +72,6 @@ interface PlateauFeature {
93
72
  x: number;
94
73
  z: number;
95
74
  }
96
- //#endregion
97
- //#region src/models/terrain/RidgeFeature.d.ts
98
75
  interface RidgeFeature {
99
76
  endX: number;
100
77
  endZ: number;
@@ -104,11 +81,7 @@ interface RidgeFeature {
104
81
  startZ: number;
105
82
  width: number;
106
83
  }
107
- //#endregion
108
- //#region src/models/terrain/TerrainFeature.d.ts
109
84
  type TerrainFeature = CliffFeature | PlateauFeature | RidgeFeature;
110
- //#endregion
111
- //#region src/models/terrain/TerrainOptions.d.ts
112
85
  interface TerrainOptions {
113
86
  cellsPerSide: number;
114
87
  finestRange: number;
@@ -117,16 +90,12 @@ interface TerrainOptions {
117
90
  maxHeight: number;
118
91
  minHeight: number;
119
92
  }
120
- //#endregion
121
- //#region src/models/terrain/TerrainResidualClearing.d.ts
122
93
  interface TerrainResidualClearing {
123
94
  falloff: number;
124
95
  radius: number;
125
96
  x: number;
126
97
  z: number;
127
98
  }
128
- //#endregion
129
- //#region src/models/terrain/TerrainResidualFade.d.ts
130
99
  interface TerrainResidualFade {
131
100
  cellSize: number;
132
101
  clearings: readonly TerrainResidualClearing[];
@@ -134,8 +103,6 @@ interface TerrainResidualFade {
134
103
  size: readonly number[];
135
104
  weights: readonly number[];
136
105
  }
137
- //#endregion
138
- //#region src/models/terrain/TerrainResidual.d.ts
139
106
  interface TerrainResidual {
140
107
  amplitude: number;
141
108
  fade?: TerrainResidualFade;
@@ -143,8 +110,6 @@ interface TerrainResidual {
143
110
  scale: number;
144
111
  seed: number;
145
112
  }
146
- //#endregion
147
- //#region src/models/terrain/TerrainTile.d.ts
148
113
  interface TerrainTile {
149
114
  coarseColors: Float32Array;
150
115
  coarseNormals: Float32Array;
@@ -154,21 +119,15 @@ interface TerrainTile {
154
119
  normals: Float32Array;
155
120
  positions: Float32Array;
156
121
  }
157
- //#endregion
158
- //#region src/models/terrain/TerrainShape.d.ts
159
122
  interface TerrainShape extends GaussianHills {
160
123
  features?: TerrainFeature[];
161
124
  residual?: TerrainResidual;
162
125
  }
163
- //#endregion
164
- //#region src/models/terrain/TerrainTileOptions.d.ts
165
126
  interface TerrainTileOptions extends Pick<TerrainOptions, "cellsPerSide" | "finestTileSize"> {
166
127
  getHeight: (x: number, z: number) => number;
167
128
  key: number;
168
129
  writeColor: (colors: Float32Array, offset: number, height: number, slope: number, x: number, z: number) => void;
169
130
  }
170
- //#endregion
171
- //#region src/models/vegetation/ScatterOptions.d.ts
172
131
  interface ScatterOptions {
173
132
  candidateCount: number;
174
133
  checkIsAccepted: (x: number, z: number) => boolean;
@@ -176,32 +135,13 @@ interface ScatterOptions {
176
135
  size: number;
177
136
  spacing: number;
178
137
  }
179
- //#endregion
180
- //#region src/random/createSeededRandom.d.ts
181
138
  declare const createSeededRandom: (seed: number) => (() => number);
182
- //#endregion
183
- //#region src/terrain/computeTerrainTile.d.ts
184
139
  declare const computeTerrainTile: ({ cellsPerSide, finestTileSize, getHeight, key, writeColor }: TerrainTileOptions) => TerrainTile;
185
- //#endregion
186
- //#region src/terrain/createGroundLayerWeights.d.ts
187
140
  declare const createGroundLayerWeights: ({ earthSlope, layerField, pathFalloff, paths, rockSlope, sandHeight, snowHeight }: Pick<GroundPaint, "earthSlope" | "layerField" | "pathFalloff" | "paths" | "rockSlope" | "sandHeight" | "snowHeight">) => ((height: number, slope: number, x: number, z: number) => Readonly<Record<GroundLayer, number>>);
188
- //#endregion
189
- //#region src/terrain/createGroundPaintColor.d.ts
190
141
  declare const createGroundPaintColor: (groundPaint: GroundPaint, seed: number) => TerrainTileOptions["writeColor"];
191
- //#endregion
192
- //#region src/terrain/createTerrainShapeHeight.d.ts
193
142
  declare const createTerrainShapeHeight: (shape: TerrainShape, ...overlays: TerrainShape[]) => ((x: number, z: number) => number);
194
- //#endregion
195
- //#region src/terrain/getTerrainTileColumn.d.ts
196
143
  declare const getTerrainTileColumn: (key: number) => number;
197
- //#endregion
198
- //#region src/terrain/getTerrainTileLevel.d.ts
199
144
  declare const getTerrainTileLevel: (key: number) => number;
200
- //#endregion
201
- //#region src/terrain/getTerrainTileRow.d.ts
202
145
  declare const getTerrainTileRow: (key: number) => number;
203
- //#endregion
204
- //#region src/vegetation/computeScatterPoints.d.ts
205
146
  declare const computeScatterPoints: ({ candidateCount, checkIsAccepted, seed, size, spacing }: ScatterOptions) => Float32Array;
206
- //#endregion
207
147
  export { CliffFeature as A, GroundLayerField as C, GroundBand as D, GroundLayers as E, GaussianHills as O, GroundPathSegment as S, GroundLayer as T, TerrainOptions as _, createTerrainShapeHeight as a, PlateauFeature as b, computeTerrainTile as c, TerrainTileOptions as d, TerrainShape as f, TerrainResidualClearing as g, TerrainResidualFade as h, getTerrainTileColumn as i, TerrainFeatureKind as j, GaussianHill as k, createSeededRandom as l, TerrainResidual as m, getTerrainTileRow as n, createGroundPaintColor as o, TerrainTile as p, getTerrainTileLevel as r, createGroundLayerWeights as s, computeScatterPoints as t, ScatterOptions as u, TerrainFeature as v, GroundLayerColors as w, GroundPaint as x, RidgeFeature as y };
@@ -1,2 +1,2 @@
1
- import { E as GroundLayers, T as GroundLayer, a as createTerrainShapeHeight, c as computeTerrainTile, i as getTerrainTileColumn, l as createSeededRandom, n as getTerrainTileRow, o as createGroundPaintColor, r as getTerrainTileLevel, s as createGroundLayerWeights, t as computeScatterPoints } from "./terrainWorker-CLOYYKT1.js";
1
+ import { E as GroundLayers, T as GroundLayer, a as createTerrainShapeHeight, c as computeTerrainTile, i as getTerrainTileColumn, l as createSeededRandom, n as getTerrainTileRow, o as createGroundPaintColor, r as getTerrainTileLevel, s as createGroundLayerWeights, t as computeScatterPoints } from "./terrainWorker-BjxpqdfH.js";
2
2
  export { GroundLayer, GroundLayers, computeScatterPoints, computeTerrainTile, createGroundLayerWeights, createGroundPaintColor, createSeededRandom, createTerrainShapeHeight, getTerrainTileColumn, getTerrainTileLevel, getTerrainTileRow };
@@ -1 +1 @@
1
- export { F as GroundLayer, I as GroundLayers, t as computeScatterPoints, g as computeTerrainTile, u as createGroundLayerWeights, l as createGroundPaintColor, L as createSeededRandom, n as createTerrainShapeHeight, v as getTerrainTileColumn, T as getTerrainTileLevel, _ as getTerrainTileRow } from "./terrainWorker-DZ04cA3m.js";
1
+ export { F as GroundLayer, I as GroundLayers, t as computeScatterPoints, g as computeTerrainTile, u as createGroundLayerWeights, l as createGroundPaintColor, L as createSeededRandom, n as createTerrainShapeHeight, v as getTerrainTileColumn, T as getTerrainTileLevel, _ as getTerrainTileRow } from "./terrainWorker-Bgj3rmZs.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genshin-engine",
3
- "version": "4.3.1",
3
+ "version": "4.3.3",
4
4
  "description": "An anime-style open-world engine for the browser on three.js WebGPU — toon materials, outlines, post-processing, streamed terrain, parametric world kits and a Web Audio synthesizer, as plain TypeScript and TSL modules.",
5
5
  "keywords": [
6
6
  "anime",
@@ -54,15 +54,15 @@
54
54
  "three-mesh-bvh": "^0.9.16"
55
55
  },
56
56
  "devDependencies": {
57
- "@esposter/configuration": "4.3.1",
58
- "@esposter/shared-node": "4.3.1",
57
+ "@esposter/configuration": "4.3.3",
58
+ "@esposter/shared-node": "4.3.3",
59
59
  "@types/node": "^26.6.5",
60
60
  "@types/three": "^0.186.0",
61
61
  "tsdown": "^0.23.1",
62
- "vite": "^8.3.4"
62
+ "vite": "^8.3.5"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "three": "^0.186.1"
66
66
  },
67
- "gitHead": "777a39636b789c13af33ed13370246ccf6dbaf31"
67
+ "gitHead": "955bbc130ad9b28877fd4ae8efc73a045141ce01"
68
68
  }