roamwright 0.61.27 → 0.61.29
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.
- package/README.md +2 -1
- package/examples/set-pieces.html +52 -0
- package/examples/set-pieces.js +284 -0
- package/geometry/builder.js +7 -12
- package/geometry/camp-layout.js +150 -0
- package/geometry/cavern-rock.js +309 -0
- package/geometry/cliff-sheets.js +457 -0
- package/geometry/creased-sheet.js +39 -0
- package/geometry/curtain-sheets.js +67 -0
- package/geometry/ice-cliff.js +339 -0
- package/geometry/ice-shards.js +247 -0
- package/geometry/index.js +35 -3
- package/geometry/instances.js +50 -1
- package/geometry/part-ops.js +152 -0
- package/geometry/plant-roots.js +115 -0
- package/geometry/primitives.js +4 -0
- package/geometry/rock-sheets.js +259 -0
- package/geometry/strata-rocks.js +4 -3
- package/math/index.js +1 -0
- package/math/scalar.js +3 -1
- package/package.json +1 -1
- package/rendering/camp-layout.js +55 -0
- package/rendering/curtain-sheets.js +271 -0
- package/rendering/flame-sources.js +105 -0
- package/rendering/flier-long-body-company.js +2 -0
- package/rendering/flocks.js +27 -22
- package/rendering/height-probe.js +7 -4
- package/rendering/house-kit-meshes.js +15 -10
- package/rendering/ice-material.js +143 -0
- package/rendering/index.js +24 -1
- package/rendering/lamp-wash.js +2 -0
- package/rendering/material-lod.js +50 -26
- package/rendering/rock-materials.js +27 -0
- package/rendering/ruins-fittings.js +110 -17
- package/rendering/scene-projectiles.js +3 -0
- package/rendering/settlement-town.js +6 -1
- package/rendering/ship-meshes.js +10 -7
- package/rendering/street-lamps.js +4 -1
- package/rendering/surface-material.js +60 -24
- package/rendering/surface-snippets.js +83 -45
- package/rendering/vehicle-train.js +1 -0
- package/rendering/water-material.js +9 -0
- package/runtime/index.js +1 -1
- package/runtime/lazy-sets.js +24 -0
- package/scripts/build.py +5 -3
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fractured glacial ice cliff and shard geometry: shard-faceted leaning ice wall with clear break
|
|
3
|
+
* windows, removable central ice plug with jagged rim teeth, hollow backing cavity with internal
|
|
4
|
+
* crack veils and socket, fallen and burst ice blocks, brittle puddle sheets, and entombed silhouette
|
|
5
|
+
* figures. Pure geometry assembly into `GB` builders; worker-safe.
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { clamp, lerp, sstep } from '../math/scalar.js';
|
|
10
|
+
import { defaultRockHash as defaultHash, defaultRockNoise as defaultNoise } from './creased-sheet.js';
|
|
11
|
+
import { jointed } from './strata-rocks.js';
|
|
12
|
+
|
|
13
|
+
/** Default dimensions, shard cell size, clear-window patch, plug cavity and veil depths (metres). */
|
|
14
|
+
export const ICE_CLIFF_DEFAULTS = Object.freeze({
|
|
15
|
+
half: 33,
|
|
16
|
+
ends: 12,
|
|
17
|
+
tall: 21,
|
|
18
|
+
lean: 0.24,
|
|
19
|
+
bury: 1.2,
|
|
20
|
+
bow: 9,
|
|
21
|
+
top: 6,
|
|
22
|
+
back: 17,
|
|
23
|
+
step: 0.5,
|
|
24
|
+
shard: Object.freeze([3.6, 5]),
|
|
25
|
+
clear: Object.freeze({ x: 1.5, y: 4.2, rx: 12.5, ry: 6.6 }),
|
|
26
|
+
plug: Object.freeze({ x: 1, half: 2.6, top: 6.4 }),
|
|
27
|
+
deep: 6.5,
|
|
28
|
+
veils: Object.freeze([0.36, 0.68]),
|
|
29
|
+
bodies: 13,
|
|
30
|
+
fleshHex: 0x14161a,
|
|
31
|
+
depthsHex: 0x1c4660,
|
|
32
|
+
ups: Object.freeze([...Array.from({ length: 25 }, (_, i) => (i / 24) * 0.56), ...Array.from({ length: 11 }, (_, i) => 0.6 + i * 0.04)]),
|
|
33
|
+
topRows: 3,
|
|
34
|
+
backRows: 4,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const _n = [0, 0, 0];
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Emit one flat-shaded triangle `(a, b, c)` (in local coordinates offset by `origin`) with per-vertex
|
|
41
|
+
* linear RGB / skin channels `(toneA, toneB, toneC)`.
|
|
42
|
+
*
|
|
43
|
+
* @param {Pick<import('./builder.js').GB, 'raw'>} builder - Destination geometry builder.
|
|
44
|
+
* @param {{ x: number, z: number }} origin - World origin offset `{ x, z }`.
|
|
45
|
+
* @param {number[]} a - First vertex `[x, y, z]`.
|
|
46
|
+
* @param {number[]} b - Second vertex `[x, y, z]`.
|
|
47
|
+
* @param {number[]} c - Third vertex `[x, y, z]`.
|
|
48
|
+
* @param {number[]} toneA - First vertex colour/channel triple.
|
|
49
|
+
* @param {number[]} toneB - Second vertex colour/channel triple.
|
|
50
|
+
* @param {number[]} toneC - Third vertex colour/channel triple.
|
|
51
|
+
*/
|
|
52
|
+
export function iceFacet(builder, origin, a, b, c, toneA, toneB, toneC) {
|
|
53
|
+
const ux = b[0] - a[0];
|
|
54
|
+
const uy = b[1] - a[1];
|
|
55
|
+
const uz = b[2] - a[2];
|
|
56
|
+
const vx = c[0] - a[0];
|
|
57
|
+
const vy = c[1] - a[1];
|
|
58
|
+
const vz = c[2] - a[2];
|
|
59
|
+
_n[0] = uy * vz - uz * vy;
|
|
60
|
+
_n[1] = uz * vx - ux * vz;
|
|
61
|
+
_n[2] = ux * vy - uy * vx;
|
|
62
|
+
const len = Math.hypot(_n[0], _n[1], _n[2]) || 1;
|
|
63
|
+
builder.raw(origin.x + a[0], a[1], origin.z + a[2], _n[0] / len, _n[1] / len, _n[2] / len, toneA[0], toneA[1], toneA[2]);
|
|
64
|
+
builder.raw(origin.x + b[0], b[1], origin.z + b[2], _n[0] / len, _n[1] / len, _n[2] / len, toneB[0], toneB[1], toneB[2]);
|
|
65
|
+
builder.raw(origin.x + c[0], c[1], origin.z + c[2], _n[0] / len, _n[1] / len, _n[2] / len, toneC[0], toneC[1], toneC[2]);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Compute finite-difference vertex normals across a column-major `[point, tone]` grid, storing each
|
|
70
|
+
* unit normal as `entry[2]`.
|
|
71
|
+
*
|
|
72
|
+
* @param {Array<Array<[number[], number[], number[]?]>>} grid - Column-major surface grid.
|
|
73
|
+
* @returns {Array<Array<[number[], number[], number[]]>>} The same grid with normals attached.
|
|
74
|
+
*/
|
|
75
|
+
export function computeGridNormals(grid) {
|
|
76
|
+
const last = grid.length - 1;
|
|
77
|
+
const top = grid[0].length - 1;
|
|
78
|
+
grid.forEach((column, i) =>
|
|
79
|
+
column.forEach((entry, r) => {
|
|
80
|
+
const a = grid[Math.min(last, i + 1)][r][0];
|
|
81
|
+
const b = grid[Math.max(0, i - 1)][r][0];
|
|
82
|
+
const c = column[Math.min(top, r + 1)][0];
|
|
83
|
+
const d = column[Math.max(0, r - 1)][0];
|
|
84
|
+
const ux = a[0] - b[0];
|
|
85
|
+
const uy = a[1] - b[1];
|
|
86
|
+
const uz = a[2] - b[2];
|
|
87
|
+
const vx = c[0] - d[0];
|
|
88
|
+
const vy = c[1] - d[1];
|
|
89
|
+
const vz = c[2] - d[2];
|
|
90
|
+
const n = [uy * vz - uz * vy, uz * vx - ux * vz, ux * vy - uy * vx];
|
|
91
|
+
const len = Math.hypot(n[0], n[1], n[2]) || 1;
|
|
92
|
+
entry[2] = [n[0] / len, n[1] / len, n[2] / len];
|
|
93
|
+
}),
|
|
94
|
+
);
|
|
95
|
+
return grid;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Emit the two smooth-shaded triangles of cell `(i, r)` from a normal-populated column-major `grid`.
|
|
100
|
+
*
|
|
101
|
+
* @param {Pick<import('./builder.js').GB, 'raw'>} builder - Destination geometry builder.
|
|
102
|
+
* @param {{ x: number, z: number }} origin - World origin offset `{ x, z }`.
|
|
103
|
+
* @param {Array<Array<[number[], number[], number[]]>>} grid - Normal-populated grid.
|
|
104
|
+
* @param {number} i - Column index.
|
|
105
|
+
* @param {number} r - Row index.
|
|
106
|
+
*/
|
|
107
|
+
export function emitGridCell(builder, origin, grid, i, r) {
|
|
108
|
+
const a = grid[i][r];
|
|
109
|
+
const b = grid[i + 1][r];
|
|
110
|
+
const c = grid[i + 1][r + 1];
|
|
111
|
+
const d = grid[i][r + 1];
|
|
112
|
+
for (const [p, tone, n] of [a, b, c, a, c, d]) {
|
|
113
|
+
builder.raw(origin.x + p[0], p[1], origin.z + p[2], n[0], n[1], n[2], tone[0], tone[1], tone[2]);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Create the deterministic surface field for a fractured ice cliff (height, plan taper, clear-ice
|
|
119
|
+
* patch mask, crevasses, faceted Voronoi-like shard planes, leaning face depth, and skin channels).
|
|
120
|
+
*
|
|
121
|
+
* @param {Partial<typeof ICE_CLIFF_DEFAULTS> & {
|
|
122
|
+
* noise?: (x: number, z: number, salt: number) => number,
|
|
123
|
+
* hash?: (x: number, y: number, salt: number) => number,
|
|
124
|
+
* }} [options]
|
|
125
|
+
* @returns {{
|
|
126
|
+
* cfg: typeof ICE_CLIFF_DEFAULTS,
|
|
127
|
+
* plan: (x: number) => number,
|
|
128
|
+
* rise: (x: number) => number,
|
|
129
|
+
* heightAt: (x: number) => number,
|
|
130
|
+
* clearAt: (x: number, y: number) => number,
|
|
131
|
+
* crevasse: (x: number, y: number) => number,
|
|
132
|
+
* inPlug: (x: number, y: number) => boolean,
|
|
133
|
+
* depthAt: (x: number, y: number) => number,
|
|
134
|
+
* shardAt: (x: number, y: number) => number,
|
|
135
|
+
* faceZ: (x: number, y: number) => number,
|
|
136
|
+
* skinAt: (x: number, y: number, h: number) => [number, number, number],
|
|
137
|
+
* }}
|
|
138
|
+
*/
|
|
139
|
+
export function createIceCliffField(options = {}) {
|
|
140
|
+
const cfg = { ...ICE_CLIFF_DEFAULTS, ...options };
|
|
141
|
+
const vnoise = options.noise ?? defaultNoise();
|
|
142
|
+
const hash2 = options.hash ?? defaultHash();
|
|
143
|
+
const { half: HALF, ends: ENDS, tall: TALL, lean: LEAN, bow: BOW, shard: SHARD, clear: CLEAR, plug: PLUG, deep: DEEP } = cfg;
|
|
144
|
+
|
|
145
|
+
const blocky = (n, steps) => jointed(n, steps, 0.72);
|
|
146
|
+
const plan = x => Math.sqrt(Math.max(0, 1 - (x / HALF) ** 2));
|
|
147
|
+
const rise = x => blocky(sstep(HALF, HALF - ENDS, Math.abs(x)), 3);
|
|
148
|
+
const heightAt = x => TALL * rise(x) * (0.86 + 0.22 * blocky(vnoise(x * 0.07, 4.4, 707), 3));
|
|
149
|
+
const clearAt = (x, y) =>
|
|
150
|
+
1 -
|
|
151
|
+
Math.hypot((x - CLEAR.x) / CLEAR.rx, (y - CLEAR.y) / CLEAR.ry) +
|
|
152
|
+
0.4 * (vnoise(x * 0.16, y * 0.2, 733) - 0.5) +
|
|
153
|
+
0.18 * (vnoise(x * 0.5, y * 0.5, 734) - 0.5);
|
|
154
|
+
const crevasse = (x, y) => sstep(0.12, 0.03, Math.abs(vnoise(x * 0.11, 9.1, 704) - 0.5)) * sstep(0.3, 2.5, y);
|
|
155
|
+
const inPlug = (x, y) => y < PLUG.top && Math.abs(x - PLUG.x) < PLUG.half * (1 - 0.3 * (Math.max(0, y) / PLUG.top) ** 2);
|
|
156
|
+
const depthAt = (x, y) => 0.35 + DEEP * sstep(-0.05, 0.55, clearAt(x, y));
|
|
157
|
+
|
|
158
|
+
function shardAt(x, y) {
|
|
159
|
+
const gx = x / SHARD[0];
|
|
160
|
+
const gy = y / SHARD[1];
|
|
161
|
+
const ix = Math.floor(gx);
|
|
162
|
+
const iy = Math.floor(gy);
|
|
163
|
+
let furthest = -1e9;
|
|
164
|
+
for (let dx = -1; dx <= 1; dx++)
|
|
165
|
+
for (let dy = -1; dy <= 1; dy++) {
|
|
166
|
+
const jx = ix + dx;
|
|
167
|
+
const jy = iy + dy;
|
|
168
|
+
const ox = gx - jx - hash2(jx, jy, 741);
|
|
169
|
+
const oy = gy - jy - hash2(jx, jy, 742);
|
|
170
|
+
const tilted = 1.1 * (hash2(jx, jy, 744) - 0.5) * ox * SHARD[0] + 0.7 * (hash2(jx, jy, 745) - 0.5) * oy * SHARD[1];
|
|
171
|
+
furthest = Math.max(furthest, 2.2 * hash2(jx, jy, 743) + tilted - 9 * Math.max(0, Math.hypot(ox, oy) - 0.85));
|
|
172
|
+
}
|
|
173
|
+
return furthest - 1.4;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function faceZ(x, y) {
|
|
177
|
+
const broken = sstep(0.3, -0.25, clearAt(x, y));
|
|
178
|
+
const tower = 3.4 * (blocky(vnoise(x * 0.075, 2.3, 701), 3) - 0.45);
|
|
179
|
+
const ledge = 1.5 * blocky(clamp(y / TALL + 0.2 * (vnoise(x * 0.06, 6.6, 702) - 0.5), 0, 1), 4);
|
|
180
|
+
const swell = 0.5 * (vnoise(x * 0.12, y * 0.12, 708) - 0.5);
|
|
181
|
+
return -BOW * (1 - plan(x)) - LEAN * Math.max(0, y) + (tower - ledge + shardAt(x, y) - 3 * crevasse(x, y)) * broken + swell;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function skinAt(x, y, h) {
|
|
185
|
+
const c = clearAt(x, y);
|
|
186
|
+
const ring = c > 0 ? sstep(0.3, 0, c) : sstep(-0.22, 0, c);
|
|
187
|
+
const rotten =
|
|
188
|
+
(0.12 + 0.8 * sstep(0.3, 0.7, vnoise(x * 0.13, y * 0.13, 709)) + 0.3 * sstep(0.55, 1, y / h)) * (1 - 0.85 * crevasse(x, y));
|
|
189
|
+
const quiet = c > 0.1 ? 0.28 : 1;
|
|
190
|
+
return [
|
|
191
|
+
clamp(Math.max(rotten * sstep(0.05, -0.2, c), ring * 0.9), 0, 1),
|
|
192
|
+
0.9 * quiet * sstep(0.56, 0.74, vnoise(x * 0.045 + y * 0.03, y * 0.3, 705)),
|
|
193
|
+
quiet * sstep(0.55, 0.8, vnoise(x * 0.19, y * 0.06, 706)) * sstep(0.75, 0.1, y / h),
|
|
194
|
+
];
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
return { cfg, vnoise, blocky, plan, rise, heightAt, clearAt, crevasse, inPlug, depthAt, shardAt, faceZ, skinAt };
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Populate the ice cliff's outer sheet builders (`into.solid`, `into.pane`, `into.plug`, `into.teeth`)
|
|
202
|
+
* from an ice cliff field.
|
|
203
|
+
*
|
|
204
|
+
* @param {ReturnType<typeof createIceCliffField>} field - Ice cliff surface field.
|
|
205
|
+
* @param {{ x: number, z: number }} origin - Cliff world origin.
|
|
206
|
+
* @param {(x: number, z: number) => number} ground - Local ground elevation sampler `(x, z) => y` in metres.
|
|
207
|
+
* @param {() => number} random - Deterministic PRNG in `[0, 1)`.
|
|
208
|
+
* @param {{ solid: object, pane: object, plug: object, teeth: object }} into - Destination builders.
|
|
209
|
+
*/
|
|
210
|
+
export function buildIceCliffSheet(field, origin, ground, random, into) {
|
|
211
|
+
const { cfg, vnoise, blocky, plan, rise, heightAt, clearAt, inPlug, faceZ, skinAt } = field;
|
|
212
|
+
const { half: HALF, bury: BURY, bow: BOW, top: TOP, back: BACK, step: STEP, ups: UPS, topRows: TOP_ROWS, backRows: BACK_ROWS } = cfg;
|
|
213
|
+
const columns = [];
|
|
214
|
+
for (let x = -HALF; x <= HALF + 1e-6; x += STEP) columns.push(x);
|
|
215
|
+
const rows = UPS.length + TOP_ROWS + BACK_ROWS;
|
|
216
|
+
const footAt = x => ground(x, -BOW * (1 - plan(x)));
|
|
217
|
+
const grid = computeGridNormals(
|
|
218
|
+
columns.map(x => {
|
|
219
|
+
const foot = footAt(x);
|
|
220
|
+
const h = heightAt(x);
|
|
221
|
+
const top = foot + h;
|
|
222
|
+
const brow = faceZ(x, h);
|
|
223
|
+
const far = brow - TOP * plan(x) - 1;
|
|
224
|
+
const end = far - BACK * plan(x) - 2;
|
|
225
|
+
const crust = [0.95, 0.15, 0];
|
|
226
|
+
return Array.from({ length: rows }, (_, r) => {
|
|
227
|
+
if (r < UPS.length) {
|
|
228
|
+
const y = -BURY + (h + BURY) * UPS[r];
|
|
229
|
+
return [[x, foot + y, faceZ(x, y)], skinAt(x, y, Math.max(h, 1))];
|
|
230
|
+
}
|
|
231
|
+
if (r < UPS.length + TOP_ROWS) {
|
|
232
|
+
const z = lerp(brow, far, (r - UPS.length + 1) / TOP_ROWS);
|
|
233
|
+
return [[x, top + 1.3 * (vnoise(x * 0.23, z * 0.23, 710) - 0.5) * rise(x), z], crust];
|
|
234
|
+
}
|
|
235
|
+
const t = (r - UPS.length - TOP_ROWS + 1) / BACK_ROWS;
|
|
236
|
+
return [[x, lerp(top, ground(x, end) - BURY, 0.45 * t + 0.55 * blocky(t, 3)), lerp(far, end, t)], crust];
|
|
237
|
+
});
|
|
238
|
+
}),
|
|
239
|
+
);
|
|
240
|
+
const NEAR = 0.06;
|
|
241
|
+
grid.forEach((column, i) => {
|
|
242
|
+
const x = columns[i];
|
|
243
|
+
const h = heightAt(x);
|
|
244
|
+
for (let r = 1; r < UPS.length - 1; r++) {
|
|
245
|
+
const y = -BURY + (h + BURY) * UPS[r];
|
|
246
|
+
const n = [-(faceZ(x + NEAR, y) - faceZ(x - NEAR, y)), -(faceZ(x, y + NEAR) - faceZ(x, y - NEAR)), 2 * NEAR];
|
|
247
|
+
const len = Math.hypot(n[0], n[1], n[2]);
|
|
248
|
+
column[r][2] = [n[0] / len, n[1] / len, n[2] / len];
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
const plugged = new Set();
|
|
252
|
+
for (let i = 0; i < columns.length - 1; i++)
|
|
253
|
+
for (let r = 0; r < rows - 1; r++) {
|
|
254
|
+
const x = columns[i] + STEP / 2;
|
|
255
|
+
const y = r < UPS.length - 1 ? -BURY + (heightAt(x) + BURY) * (UPS[r] + UPS[r + 1]) * 0.5 : 1e3;
|
|
256
|
+
const clear = clearAt(x, y) > 0;
|
|
257
|
+
if (clear && inPlug(x, y)) plugged.add(i + ',' + r);
|
|
258
|
+
emitGridCell(clear ? (inPlug(x, y) ? into.plug : into.pane) : into.solid, origin, grid, i, r);
|
|
259
|
+
}
|
|
260
|
+
const sharp = [0.3, 0.1, 0.5];
|
|
261
|
+
for (const key of plugged) {
|
|
262
|
+
const [i, r] = key.split(',').map(Number);
|
|
263
|
+
const corners = [grid[i][r], grid[i + 1][r], grid[i + 1][r + 1], grid[i][r + 1]];
|
|
264
|
+
const mid = [0, 1, 2].map(k => (corners[0][0][k] + corners[2][0][k]) / 2);
|
|
265
|
+
[
|
|
266
|
+
[i, r - 1],
|
|
267
|
+
[i + 1, r],
|
|
268
|
+
[i, r + 1],
|
|
269
|
+
[i - 1, r],
|
|
270
|
+
].forEach(([ni, nr], side) => {
|
|
271
|
+
if (plugged.has(ni + ',' + nr) || nr < 0) return;
|
|
272
|
+
const a = corners[side];
|
|
273
|
+
const b = corners[(side + 1) % 4];
|
|
274
|
+
const reach = 0.5 + random() * 1.1;
|
|
275
|
+
const tip = [0, 1, 2].map(
|
|
276
|
+
k => lerp((a[0][k] + b[0][k]) / 2, mid[k], reach) + (k === 2 ? (random() - 0.5) * 0.5 : (random() - 0.5) * 0.3),
|
|
277
|
+
);
|
|
278
|
+
iceFacet(into.teeth, origin, a[0], b[0], tip, a[1], b[1], sharp);
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Populate the hollow cavity behind the clear ice pane (`into.deep`, `into.veils`, `into.socket`):
|
|
285
|
+
* back wall, ice floor, internal hanging crack veils, and recessed cavity socket behind the plug.
|
|
286
|
+
*
|
|
287
|
+
* @param {ReturnType<typeof createIceCliffField>} field - Ice cliff surface field.
|
|
288
|
+
* @param {{ x: number, z: number }} origin - Cliff world origin.
|
|
289
|
+
* @param {(x: number, z: number) => number} ground - Local ground elevation sampler `(x, z) => y` in metres.
|
|
290
|
+
* @param {{ deep: object, socket: object, veils: object[] }} into - Destination builders.
|
|
291
|
+
*/
|
|
292
|
+
export function buildIceHollow(field, origin, ground, into) {
|
|
293
|
+
const { cfg, vnoise, clearAt, depthAt, faceZ } = field;
|
|
294
|
+
const { bury: BURY, step: STEP, clear: CLEAR, plug: PLUG, veils: VEILS } = cfg;
|
|
295
|
+
const x0 = CLEAR.x - CLEAR.rx * 1.25;
|
|
296
|
+
const x1 = CLEAR.x + CLEAR.rx * 1.25;
|
|
297
|
+
const y1 = CLEAR.y + CLEAR.ry * 1.25;
|
|
298
|
+
const columns = [];
|
|
299
|
+
const heights = [];
|
|
300
|
+
for (let x = x0; x <= x1; x += STEP) columns.push(x);
|
|
301
|
+
for (let y = -BURY; y <= y1; y += 0.7) heights.push(y);
|
|
302
|
+
const sheet = (share, tone) =>
|
|
303
|
+
computeGridNormals(columns.map(x => heights.map(y => [[x, ground(x, 0) + y, faceZ(x, y) - depthAt(x, y) * share], tone(x, y)])));
|
|
304
|
+
const wall = sheet(1, (x, y) => [0.1 + 0.25 * vnoise(x * 0.4, y * 0.4, 721), 0.25 * sstep(0.6, 0.8, vnoise(x * 0.07, y * 0.4, 722)), 0]);
|
|
305
|
+
for (let i = 0; i < columns.length - 1; i++)
|
|
306
|
+
for (let r = 0; r < heights.length - 1; r++)
|
|
307
|
+
if (clearAt(columns[i] + STEP / 2, heights[r] + 0.35) > -0.14) emitGridCell(into.deep, origin, wall, i, r);
|
|
308
|
+
VEILS.forEach((share, k) => {
|
|
309
|
+
const veil = sheet(share, (x, y) => [
|
|
310
|
+
0.06 * vnoise(x * 0.5, y * 0.5, 723 + k),
|
|
311
|
+
0,
|
|
312
|
+
0.2 * sstep(0.6, 0.85, vnoise(x * 0.2, y * 0.1, 725 + k)),
|
|
313
|
+
]);
|
|
314
|
+
for (let i = 0; i < columns.length - 1; i++)
|
|
315
|
+
for (let r = 0; r < heights.length - 1; r++) {
|
|
316
|
+
const x = columns[i] + STEP / 2;
|
|
317
|
+
const y = heights[r] + 0.35;
|
|
318
|
+
if (clearAt(x, y) > 0.14 && !(Math.abs(x - PLUG.x) < PLUG.half + 1.4 && y < PLUG.top + 1.2))
|
|
319
|
+
emitGridCell(into.veils[k], origin, veil, i, r);
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
const socket = sheet(0, (x, y) => [0.04, 0.1, 0.5 + 0.4 * vnoise(x * 0.6, y * 0.6, 727)]);
|
|
323
|
+
const within = (x, y) => 1 - Math.max(Math.abs(x - PLUG.x) / (PLUG.half * (1 - 0.3 * (Math.max(0, y) / PLUG.top) ** 2)), y / PLUG.top);
|
|
324
|
+
socket.forEach((column, i) => column.forEach(([point], r) => (point[2] -= 0.02 + 3.2 * sstep(0, 0.4, within(columns[i], heights[r])))));
|
|
325
|
+
computeGridNormals(socket);
|
|
326
|
+
for (let i = 0; i < columns.length - 1; i++)
|
|
327
|
+
for (let r = 0; r < heights.length - 1; r++)
|
|
328
|
+
if (within(columns[i] + STEP / 2, heights[r] + 0.35) > 0.02) emitGridCell(into.socket, origin, socket, i, r);
|
|
329
|
+
const floor = computeGridNormals(
|
|
330
|
+
columns.map(x =>
|
|
331
|
+
[0, 0.5, 1].map(t => [
|
|
332
|
+
[x, ground(x, 0) + 0.05, faceZ(x, 0) - depthAt(x, 0) * t],
|
|
333
|
+
[0.35, 0.2, 0.3],
|
|
334
|
+
]),
|
|
335
|
+
),
|
|
336
|
+
);
|
|
337
|
+
for (let i = 0; i < columns.length - 1; i++)
|
|
338
|
+
if (clearAt(columns[i] + STEP / 2, 0) > -0.14) for (const r of [0, 1]) emitGridCell(into.deep, origin, floor, i, r);
|
|
339
|
+
}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Glacial ice shards, fallen and burst ice blocks, brittle frost puddles, and entombed silhouette
|
|
3
|
+
* figures accompanying {@link module:geometry/ice-cliff}. Pure geometry assembly into `GB` builders;
|
|
4
|
+
* worker-safe.
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import * as THREE from 'three';
|
|
9
|
+
import { mulberry32 } from '../math/random.js';
|
|
10
|
+
import { lerp, TAU } from '../math/scalar.js';
|
|
11
|
+
import { iceFacet } from './ice-cliff.js';
|
|
12
|
+
import { C as defaultColor, TRS as defaultTransform, defaultUnitShapes as defaultShapes, stick as defaultStick } from './primitives.js';
|
|
13
|
+
|
|
14
|
+
const _at = new THREE.Vector3();
|
|
15
|
+
const _frame = new THREE.Matrix4();
|
|
16
|
+
const CORNERS = [0, 1, 2, 3, 4, 5, 6, 7].map(k => [k & 1 ? 0.5 : -0.5, k & 2 ? 1 : 0, k & 4 ? 0.5 : -0.5]);
|
|
17
|
+
const FACES = Object.freeze([
|
|
18
|
+
[0, 4, 6, 2],
|
|
19
|
+
[1, 3, 7, 5],
|
|
20
|
+
[0, 1, 5, 4],
|
|
21
|
+
[2, 6, 7, 3],
|
|
22
|
+
[0, 2, 3, 1],
|
|
23
|
+
[4, 5, 7, 6],
|
|
24
|
+
]);
|
|
25
|
+
const ZERO_ORIGIN = Object.freeze({ x: 0, z: 0 });
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Emit a broken, skewed six-faced block of ice at `(x, y, z)` in the cliff frame with scale
|
|
29
|
+
* `(sx, sy, sz)` and ice skin channel triple `tone`.
|
|
30
|
+
*
|
|
31
|
+
* @param {Pick<import('./builder.js').GB, 'raw'>} builder - Destination geometry builder.
|
|
32
|
+
* @param {{ x: number, z: number }} origin - Cliff world origin.
|
|
33
|
+
* @param {() => number} random - Deterministic PRNG in `[0, 1)`.
|
|
34
|
+
* @param {number} x - Local X in metres.
|
|
35
|
+
* @param {number} y - World Y in metres.
|
|
36
|
+
* @param {number} z - Local Z in metres.
|
|
37
|
+
* @param {number} sx - Block width in metres.
|
|
38
|
+
* @param {number} sy - Block height in metres.
|
|
39
|
+
* @param {number} sz - Block depth in metres.
|
|
40
|
+
* @param {[number, number, number]} tone - Ice skin `[white, dirt, stain]` channels.
|
|
41
|
+
* @param {object} [options]
|
|
42
|
+
* @param {Function} [options.transform] - Transform matrix helper (`TRS`).
|
|
43
|
+
*/
|
|
44
|
+
export function buildIceBlock(builder, origin, random, x, y, z, sx, sy, sz, tone, options = {}) {
|
|
45
|
+
const transform = options.transform ?? defaultTransform;
|
|
46
|
+
_frame.copy(transform(origin.x + x, y, origin.z + z, sx, sy, sz, random() * TAU, (random() - 0.5) * 0.9, (random() - 0.5) * 0.9));
|
|
47
|
+
const corners = CORNERS.map(corner => {
|
|
48
|
+
_at
|
|
49
|
+
.set(corner[0] + (random() - 0.5) * 0.5, corner[1] + (random() - 0.5) * 0.4, corner[2] + (random() - 0.5) * 0.5)
|
|
50
|
+
.applyMatrix4(_frame);
|
|
51
|
+
return [_at.x, _at.y, _at.z];
|
|
52
|
+
});
|
|
53
|
+
for (const [a, b, c, d] of FACES) {
|
|
54
|
+
iceFacet(builder, ZERO_ORIGIN, corners[a], corners[b], corners[c], tone, tone, tone);
|
|
55
|
+
iceFacet(builder, ZERO_ORIGIN, corners[a], corners[c], corners[d], tone, tone, tone);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Scatter fallen angular blocks of ice heaped along the foot of an ice cliff, leaving a clearing
|
|
61
|
+
* directly before the plug opening.
|
|
62
|
+
*
|
|
63
|
+
* @param {ReturnType<import('./ice-cliff.js').createIceCliffField>} field - Ice cliff surface field.
|
|
64
|
+
* @param {Pick<import('./builder.js').GB, 'raw'>} builder - Destination geometry builder.
|
|
65
|
+
* @param {{ x: number, z: number }} origin - Cliff world origin.
|
|
66
|
+
* @param {(x: number, z: number) => number} ground - Local ground elevation sampler `(x, z) => y` in metres.
|
|
67
|
+
* @param {() => number} [random] - Deterministic PRNG in `[0, 1)`.
|
|
68
|
+
* @param {object} [options]
|
|
69
|
+
* @param {number} [options.count=150] - Candidate fallen blocks.
|
|
70
|
+
* @param {Function} [options.transform] - Transform matrix helper (`TRS`).
|
|
71
|
+
*/
|
|
72
|
+
export function buildFallenIceBlocks(field, builder, origin, ground, random = mulberry32(1), options = {}) {
|
|
73
|
+
const count = options.count ?? 150;
|
|
74
|
+
const { half: HALF, plug: PLUG } = field.cfg;
|
|
75
|
+
const { faceZ, clearAt } = field;
|
|
76
|
+
for (let i = 0; i < count; i++) {
|
|
77
|
+
const x = (random() * 2 - 1) * (HALF - 3);
|
|
78
|
+
const out = random() ** 2 * 8 + 0.4;
|
|
79
|
+
const z = faceZ(x, 0.5) + out;
|
|
80
|
+
const size = (0.35 + random() ** 2 * 2.3) * (1 - out / 13) * (clearAt(x, 0.5) > 0 ? 0.55 : 1);
|
|
81
|
+
if (Math.abs(x - PLUG.x) < PLUG.half && out < 5) continue;
|
|
82
|
+
const squat = 0.45 + random() * 0.7;
|
|
83
|
+
buildIceBlock(
|
|
84
|
+
builder,
|
|
85
|
+
origin,
|
|
86
|
+
random,
|
|
87
|
+
x,
|
|
88
|
+
ground(x, z) - size * 0.22,
|
|
89
|
+
z,
|
|
90
|
+
size * (0.7 + random() * 0.8),
|
|
91
|
+
size * squat,
|
|
92
|
+
size * (0.7 + random() * 0.8),
|
|
93
|
+
[0.35 + random() * 0.55, random() < 0.3 ? 0.6 * random() : 0, random() < 0.2 ? 0.7 * random() : 0],
|
|
94
|
+
options,
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Scatter stained ice shards flung outward across the ground when a cliff's plug bursts open.
|
|
101
|
+
*
|
|
102
|
+
* @param {ReturnType<import('./ice-cliff.js').createIceCliffField>} field - Ice cliff surface field.
|
|
103
|
+
* @param {Pick<import('./builder.js').GB, 'raw'>} builder - Destination geometry builder.
|
|
104
|
+
* @param {{ x: number, z: number }} origin - Cliff world origin.
|
|
105
|
+
* @param {(x: number, z: number) => number} ground - Local ground elevation sampler `(x, z) => y` in metres.
|
|
106
|
+
* @param {() => number} [random] - Deterministic PRNG in `[0, 1)`.
|
|
107
|
+
* @param {object} [options]
|
|
108
|
+
* @param {number} [options.count=46] - Number of burst shards.
|
|
109
|
+
* @param {Function} [options.transform] - Transform matrix helper (`TRS`).
|
|
110
|
+
*/
|
|
111
|
+
export function buildBurstIceBlocks(field, builder, origin, ground, random = mulberry32(1), options = {}) {
|
|
112
|
+
const count = options.count ?? 46;
|
|
113
|
+
const { plug: PLUG } = field.cfg;
|
|
114
|
+
for (let i = 0; i < count; i++) {
|
|
115
|
+
const a = (random() - 0.5) * 2.2;
|
|
116
|
+
const out = 0.8 + random() ** 1.5 * 9;
|
|
117
|
+
const x = PLUG.x + Math.sin(a) * out;
|
|
118
|
+
const z = Math.cos(a) * out;
|
|
119
|
+
const size = (0.25 + random() ** 2 * 1.3) * (1 - out / 16);
|
|
120
|
+
buildIceBlock(
|
|
121
|
+
builder,
|
|
122
|
+
origin,
|
|
123
|
+
random,
|
|
124
|
+
x,
|
|
125
|
+
ground(x, z) - size * 0.2,
|
|
126
|
+
z,
|
|
127
|
+
size * (0.7 + random() * 0.9),
|
|
128
|
+
size * (0.4 + random() * 0.6),
|
|
129
|
+
size * (0.7 + random() * 0.9),
|
|
130
|
+
[0.15 + random() * 0.35, 0.1, 0.35 + random() * 0.6],
|
|
131
|
+
options,
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const way = (pitch, turn) => [Math.sin(pitch) * Math.sin(turn), Math.cos(pitch), Math.sin(pitch) * Math.cos(turn)];
|
|
137
|
+
const along = (from, to, far) => [from[0] + to[0] * far, from[1] + to[1] * far, from[2] + to[2] * far];
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Emit a dark, twisted silhouette figure trapped in ice around its hips at `(x, y, z)`.
|
|
141
|
+
*
|
|
142
|
+
* @param {import('./builder.js').GB} builder - Destination geometry builder.
|
|
143
|
+
* @param {() => number} random - Deterministic PRNG in `[0, 1)`.
|
|
144
|
+
* @param {number} x - World X in metres.
|
|
145
|
+
* @param {number} y - World Y in metres.
|
|
146
|
+
* @param {number} z - World Z in metres.
|
|
147
|
+
* @param {[number, number, number]} flesh - Linear RGB silhouette tint.
|
|
148
|
+
* @param {object} [options]
|
|
149
|
+
* @param {object} [options.shapes] - Unit shapes containing `sph` and `head`.
|
|
150
|
+
* @param {Function} [options.transform] - Transform matrix helper (`TRS`).
|
|
151
|
+
* @param {Function} [options.stickFn] - Tapered limb helper (`stick`).
|
|
152
|
+
*/
|
|
153
|
+
export function buildFrozenFigure(builder, random, x, y, z, flesh, options = {}) {
|
|
154
|
+
const shapes = options.shapes ?? defaultShapes();
|
|
155
|
+
const transform = options.transform ?? defaultTransform;
|
|
156
|
+
const stickFn = options.stickFn ?? defaultStick;
|
|
157
|
+
builder.M = transform(x, y, z, 1, 1, 1, random() * TAU, (random() - 0.5) * 2.4, (random() - 0.5) * 2.4).clone();
|
|
158
|
+
const hips = [0, 0, 0];
|
|
159
|
+
const spine = way(random() * 0.5, random() * TAU);
|
|
160
|
+
const chest = along(hips, spine, 0.46);
|
|
161
|
+
const head = along(chest, way(0.15 + random() * 0.8, random() * TAU), 0.27);
|
|
162
|
+
stickFn(builder, along(hips, spine, -0.1), along(chest, spine, 0.08), 0.31, flesh);
|
|
163
|
+
builder.add(shapes.sph, flesh, transform(chest[0], chest[1], chest[2], 0.42, 0.24, 0.26));
|
|
164
|
+
builder.add(shapes.sph, flesh, transform(0, -0.02, 0, 0.34, 0.24, 0.24));
|
|
165
|
+
stickFn(builder, chest, head, 0.11, flesh);
|
|
166
|
+
builder.add(shapes.head ?? shapes.sph, flesh, transform(head[0], head[1], head[2], 0.2, 0.24, 0.22));
|
|
167
|
+
for (const side of [-1, 1]) {
|
|
168
|
+
const shoulder = [chest[0] + side * 0.2, chest[1] - 0.02, chest[2]];
|
|
169
|
+
const elbow = along(shoulder, way(Math.PI * (0.2 + random() * 0.8), random() * TAU), 0.31);
|
|
170
|
+
const hand = along(elbow, way(Math.PI * random(), random() * TAU), 0.28);
|
|
171
|
+
const hip = [side * 0.1, -0.05, 0];
|
|
172
|
+
const knee = along(hip, way(Math.PI * (0.6 + random() * 0.4), random() * TAU), 0.45);
|
|
173
|
+
const foot = along(knee, way(Math.PI * (0.45 + random() * 0.55), random() * TAU), 0.44);
|
|
174
|
+
stickFn(builder, shoulder, elbow, 0.105, flesh);
|
|
175
|
+
stickFn(builder, elbow, hand, 0.085, flesh);
|
|
176
|
+
builder.add(shapes.sph, flesh, transform(hand[0], hand[1], hand[2], 0.1, 0.12, 0.08));
|
|
177
|
+
stickFn(builder, hip, knee, 0.15, flesh);
|
|
178
|
+
stickFn(builder, knee, foot, 0.11, flesh);
|
|
179
|
+
builder.add(shapes.sph, flesh, transform(foot[0], foot[1], foot[2] + 0.06, 0.1, 0.09, 0.24));
|
|
180
|
+
}
|
|
181
|
+
builder.M = null;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Scatter entombed silhouette figures suspended behind the clear-ice window of an ice cliff, tinted
|
|
186
|
+
* deeper blue with burial depth and kept clear of the central plug opening.
|
|
187
|
+
*
|
|
188
|
+
* @param {ReturnType<import('./ice-cliff.js').createIceCliffField>} field - Ice cliff surface field.
|
|
189
|
+
* @param {import('./builder.js').GB} builder - Destination geometry builder.
|
|
190
|
+
* @param {{ x: number, z: number }} origin - Cliff world origin.
|
|
191
|
+
* @param {(x: number, z: number) => number} ground - Local ground elevation sampler `(x, z) => y` in metres.
|
|
192
|
+
* @param {() => number} [random] - Deterministic PRNG in `[0, 1)`.
|
|
193
|
+
* @param {object} [options]
|
|
194
|
+
* @param {Function} [options.color] - Linear RGB colour helper (`C`).
|
|
195
|
+
* @param {object} [options.shapes] - Unit shapes containing `sph` and `head`.
|
|
196
|
+
* @param {Function} [options.transform] - Transform matrix helper (`TRS`).
|
|
197
|
+
* @param {Function} [options.stickFn] - Tapered limb helper (`stick`).
|
|
198
|
+
*/
|
|
199
|
+
export function buildFrozenFigures(field, builder, origin, ground, random = mulberry32(1), options = {}) {
|
|
200
|
+
const color = options.color ?? defaultColor;
|
|
201
|
+
const { clear: CLEAR, plug: PLUG, bodies: BODIES, fleshHex, depthsHex } = field.cfg;
|
|
202
|
+
const { clearAt, faceZ, depthAt } = field;
|
|
203
|
+
const flesh = color(fleshHex);
|
|
204
|
+
const depths = color(depthsHex);
|
|
205
|
+
for (let made = 0, tries = 0; made < BODIES && tries < 400; tries++) {
|
|
206
|
+
const x = CLEAR.x + (random() * 2 - 1) * CLEAR.rx * 0.85;
|
|
207
|
+
const y = 0.9 + random() * (CLEAR.y + CLEAR.ry - 1.6);
|
|
208
|
+
const deep = 0.3 + random() * 0.6;
|
|
209
|
+
if (clearAt(x, y) < 0.22 || (Math.abs(x - PLUG.x) < PLUG.half + 1.8 && y < PLUG.top + 1.4)) continue;
|
|
210
|
+
buildFrozenFigure(
|
|
211
|
+
builder,
|
|
212
|
+
random,
|
|
213
|
+
origin.x + x,
|
|
214
|
+
ground(x, 0) + y,
|
|
215
|
+
origin.z + faceZ(x, y) - depthAt(x, y) * deep,
|
|
216
|
+
flesh.map((v, k) => lerp(v, depths[k], deep * 0.85)),
|
|
217
|
+
options,
|
|
218
|
+
);
|
|
219
|
+
made++;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Emit a ragged polygonal sheet of thin puddle ice lying flat on the ground at `(x, z)` with
|
|
225
|
+
* nominal radius `radius` metres (clear in its centre, frosted white at its rim).
|
|
226
|
+
*
|
|
227
|
+
* @param {Pick<import('./builder.js').GB, 'raw'>} builder - Destination geometry builder.
|
|
228
|
+
* @param {{ x: number, z: number }} origin - World origin offset `{ x, z }`.
|
|
229
|
+
* @param {(x: number, z: number) => number} ground - Local ground elevation sampler `(x, z) => y` in metres.
|
|
230
|
+
* @param {() => number} random - Deterministic PRNG in `[0, 1)`.
|
|
231
|
+
* @param {number} x - Local X in metres.
|
|
232
|
+
* @param {number} z - Local Z in metres.
|
|
233
|
+
* @param {number} radius - Nominal puddle radius in metres.
|
|
234
|
+
*/
|
|
235
|
+
export function buildPuddleIce(builder, origin, ground, random, x, z, radius) {
|
|
236
|
+
const n = 5 + Math.floor(random() * 3);
|
|
237
|
+
const turn = random() * TAU;
|
|
238
|
+
const rim = Array.from({ length: n }, (_, k) => {
|
|
239
|
+
const a = turn + (k / n) * TAU;
|
|
240
|
+
const d = radius * (0.6 + random() * 0.6);
|
|
241
|
+
const px = x + Math.sin(a) * d;
|
|
242
|
+
const pz = z + Math.cos(a) * d * 0.7;
|
|
243
|
+
return [px, ground(px, pz) + 0.05, pz];
|
|
244
|
+
});
|
|
245
|
+
const mid = [x, ground(x, z) + 0.05, z];
|
|
246
|
+
for (let k = 0; k < n; k++) iceFacet(builder, origin, mid, rim[k], rim[(k + 1) % n], [0.08, 0, 0.15], [0.7, 0.1, 0], [0.7, 0.1, 0]);
|
|
247
|
+
}
|
package/geometry/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// ── Context, math & core geometry ────────────────────────────────────────
|
|
7
|
-
export { GB as GeometryBuilder, geometryOf } from './builder.js';
|
|
7
|
+
export { GB as GeometryBuilder, flatNormals, geometryOf, padParts } from './builder.js';
|
|
8
8
|
export { stillMesh } from './still-mesh.js';
|
|
9
9
|
export { createUnitShapes, createFigureUnitShapes } from './primitives.js';
|
|
10
10
|
|
|
@@ -17,7 +17,37 @@ export { createMoundFaces } from './land-mound-faces.js';
|
|
|
17
17
|
export { createTownGround } from './land-town-ground.js';
|
|
18
18
|
export { createDryBasin } from './land-dry-basin.js';
|
|
19
19
|
export { landEdgeGrid } from './land-edge.js';
|
|
20
|
-
export { rockSheet } from './creased-sheet.js';
|
|
20
|
+
export { rockSheet, sampleRockSheet } from './creased-sheet.js';
|
|
21
|
+
export { OUTCROP_DUST, OUTCROP_SANDSTONE, buildOutcrop, buildTalusApron, outcropReach } from './rock-sheets.js';
|
|
22
|
+
export {
|
|
23
|
+
CAVERN_ROCK_PALETTE,
|
|
24
|
+
CRYSTAL_PALETTE,
|
|
25
|
+
buildCavernCrystal,
|
|
26
|
+
buildCrystalCluster,
|
|
27
|
+
buildRockDome,
|
|
28
|
+
buildRockRoof,
|
|
29
|
+
buildRockWall,
|
|
30
|
+
domeReach,
|
|
31
|
+
} from './cavern-rock.js';
|
|
32
|
+
export { BEDDED_BUTTE_DEFAULTS, ESCARPMENT_CLIFF_DEFAULTS, createBeddedButte, createEscarpmentCliff } from './cliff-sheets.js';
|
|
33
|
+
export {
|
|
34
|
+
ICE_CLIFF_DEFAULTS,
|
|
35
|
+
buildIceCliffSheet,
|
|
36
|
+
buildIceHollow,
|
|
37
|
+
computeGridNormals,
|
|
38
|
+
createIceCliffField,
|
|
39
|
+
emitGridCell,
|
|
40
|
+
iceFacet,
|
|
41
|
+
} from './ice-cliff.js';
|
|
42
|
+
export {
|
|
43
|
+
buildBurstIceBlocks,
|
|
44
|
+
buildFallenIceBlocks,
|
|
45
|
+
buildFrozenFigure,
|
|
46
|
+
buildFrozenFigures,
|
|
47
|
+
buildIceBlock,
|
|
48
|
+
buildPuddleIce,
|
|
49
|
+
} from './ice-shards.js';
|
|
50
|
+
export { ROOT_TIP_SHARE, buildRootTube, growRootBranch, rootRadius } from './plant-roots.js';
|
|
21
51
|
export { planTalusStones } from './strata-talus.js';
|
|
22
52
|
export {
|
|
23
53
|
OUTCROP_SEEDS,
|
|
@@ -59,7 +89,7 @@ export {
|
|
|
59
89
|
drapeGroundPatch,
|
|
60
90
|
scatterPatchBits,
|
|
61
91
|
} from './ground-drape.js';
|
|
62
|
-
export { createShapeBatches } from './instances.js';
|
|
92
|
+
export { createShapeBatches, placeInstances } from './instances.js';
|
|
63
93
|
export { planStreamBanks } from './stream-banks.js';
|
|
64
94
|
export { SPRING_COLOURS, SPRING_HEAD, planSpringRocks, planSprings, springFrame, springWetGround } from './stream-springs.js';
|
|
65
95
|
export { planShoreReeds } from './shore-reeds.js';
|
|
@@ -166,6 +196,8 @@ export { farCrowdFigure } from './crowd-far.js';
|
|
|
166
196
|
|
|
167
197
|
// ── Effects, audio, pacing & runtime ─────────────────────────────────────
|
|
168
198
|
export { STORM_WALL_DEFAULTS, stormWallArrays } from './storm-wall.js';
|
|
199
|
+
export { DUST_CURTAIN_SHAPE, dustCurtainArrays } from './curtain-sheets.js';
|
|
200
|
+
export { CAMP_DEFAULTS, buildTentLines, buildWagonLine } from './camp-layout.js';
|
|
169
201
|
|
|
170
202
|
// ── Scene playback, melee, projectiles, beams, props & markers ───────────
|
|
171
203
|
export { buildArrowGeometry, buildKnifeGeometry, buildQuarrelGeometry } from './projectile-shapes.js';
|