@threenative/core 0.3.15 → 0.3.16
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/capabilities.json +652 -16
- package/dist/{chunk-VBBYWGAT.js → chunk-5C4TCWI3.js} +1 -1
- package/dist/{chunk-GEMQJBY4.js → chunk-FQURMC2F.js} +53 -1
- package/dist/{chunk-QAMSM3Z5.js → chunk-OMGIYWW7.js} +47 -2
- package/dist/hot.js +10 -2
- package/dist/index.d.ts +4 -10
- package/dist/index.js +70 -30
- package/dist/{model-lod-DPTzeCcD.d.ts → model-lod-B921F6kQ.d.ts} +0 -10
- package/dist/playtest.js +2 -2
- package/dist/world.d.ts +1 -1
- package/dist/world.js +2 -2
- package/mcp/animation-server.mjs +1 -1
- package/mcp/engine-server.mjs +13 -12
- package/mcp/servers.mjs +4 -4
- package/package.json +6 -6
- package/patches/three@0.187.0-prd269-upgrade.patch +126 -2
- package/patches/three@0.187.0.patch +108 -21
- package/src/engine-hooks.ts +29 -0
- package/src/grounding.ts +19 -10
- package/src/hot.ts +18 -2
- package/src/index.ts +1 -1
- package/src/instanced-batch-lod.ts +54 -0
- package/src/model-lod.ts +77 -1
- package/src/pose-measure.ts +27 -2
- package/src/scatter-field.ts +1 -0
- package/src/static-transform.ts +34 -0
- package/src/version.ts +1 -1
package/capabilities.json
CHANGED
|
@@ -3412,7 +3412,7 @@
|
|
|
3412
3412
|
"symbol": "RippleField"
|
|
3413
3413
|
},
|
|
3414
3414
|
{
|
|
3415
|
-
"aliases": [],
|
|
3415
|
+
"aliases": ["scatter rocks, debris and plants over terrain"],
|
|
3416
3416
|
"constraints": [
|
|
3417
3417
|
"call `update(follow)` once per rendered frame",
|
|
3418
3418
|
"`place` runs once per candidate per tile build: return false for paths and clearings",
|
|
@@ -3424,7 +3424,7 @@
|
|
|
3424
3424
|
"overrides": [],
|
|
3425
3425
|
"package": "@threenative/core",
|
|
3426
3426
|
"requires": [
|
|
3427
|
-
"npm i -D @threenative/procedural-
|
|
3427
|
+
"npm i -D @threenative/procedural-environment for the bake these instances come from"
|
|
3428
3428
|
],
|
|
3429
3429
|
"signature": "export class ScatterField3D extends Group { … }",
|
|
3430
3430
|
"situations": [
|
|
@@ -8421,21 +8421,85 @@
|
|
|
8421
8421
|
"symbol": "bakeWolfToFile"
|
|
8422
8422
|
},
|
|
8423
8423
|
{
|
|
8424
|
-
"aliases": [],
|
|
8424
|
+
"aliases": ["city kit", "modular road tiles", "low poly city buildings", "cars and vehicles"],
|
|
8425
|
+
"constraints": [
|
|
8426
|
+
"fails closed: an unknown module throws naming the nearest ids; seed is an integer 0 to 4294967295, detail 0 to 2, wet 0 to 100, floors an integer 2 to 12, text at most 24 characters, dressing a boolean",
|
|
8427
|
+
"the same options write identical bytes on one Node major and machine (fonts draw the sign text); files are written atomically (temporary file, then rename)",
|
|
8428
|
+
"units are metres, +Y up; stock roads fit a 24 m grid, and custom straights and bends export updated socket positions, directions, widths and lane centres in the root node's extras",
|
|
8429
|
+
"roadWidth and markings apply to straight and curve; roadLength applies to straight; bendAngle, bendRadius and bendSide apply to curve; roadSurface applies to socketed road modules",
|
|
8430
|
+
"bake-time only, so keep it a dev dependency; textures are capped at 1024 px like the page's export"
|
|
8431
|
+
],
|
|
8432
|
+
"example": "await bakeCity({ module: \"cross\", out: \"assets/city\" });\nawait bakeCity({ module: \"curve\", bendAngle: 55, bendRadius: 24, bendSide: \"left\", roadWidth: 12, sidewalk: false, curb: false, out: \"assets/city\" });\nawait bakeCity({ module: \"apartments\", seed: 7, floors: 8, out: \"assets/city\" });",
|
|
8433
|
+
"importPath": "@threenative/procedural-environment",
|
|
8434
|
+
"kind": "function",
|
|
8435
|
+
"overrides": [],
|
|
8436
|
+
"package": "@threenative/procedural-environment",
|
|
8437
|
+
"requires": ["npm i -D @threenative/procedural-environment"],
|
|
8438
|
+
"signature": "export async function bakeCity(options: IBakeCityOptions): Promise<IEnvironmentBake[]> { … }",
|
|
8439
|
+
"situations": [
|
|
8440
|
+
"generate a modular city street, intersection, roundabout or highway tile as a GLB",
|
|
8441
|
+
"a procedural building, storefront, office tower, apartment block, house or warehouse for a city level",
|
|
8442
|
+
"street props for a city: traffic signal, streetlight, bus shelter, hydrant, bench, mailbox, dumpster",
|
|
8443
|
+
"a race track kit: starting grid, timing gantry, barriers, tire wall, kerbs, pit lane; or a car, van, kart or formula car"
|
|
8444
|
+
],
|
|
8445
|
+
"summary": "Bake an Apex City Kit module to one GLB: a road tile, a building, a street prop, a vehicle, a race kit piece, a block or lot, a sidewalk, transit, a public space, a utility or a decal. The page's own generator and GLTFExporter run headless, so the GLB carries its merged meshes, its materials and textures (Poly Haven CC0 PBR maps and the canvas-drawn signs, liveries and markings) and its road sockets in the root node's extras.",
|
|
8446
|
+
"supersedes": [],
|
|
8447
|
+
"symbol": "bakeCity"
|
|
8448
|
+
},
|
|
8449
|
+
{
|
|
8450
|
+
"aliases": ["rocks and boulders", "cliffs and mountains"],
|
|
8451
|
+
"constraints": [
|
|
8452
|
+
"fails closed: an unknown form or biome throws naming the nearest ids, as do unknown traits or surface keys, a non-integer seed, a lod outside 0 to 2 and a detail outside 0 to 1",
|
|
8453
|
+
"the same options write identical bytes; files are written atomically (temporary file, then rename)",
|
|
8454
|
+
"each GLB carries POSITION, NORMAL and COLOR_0 (linear RGB, rock and cover already blended) on one `rock` material; units are metres, +Y up, the rock rests on y = 0",
|
|
8455
|
+
"a `cliff` module shows a cut face at each end: bake a run with one seed and `offset: [n * width, 0, 0]`, stand the modules one width apart and bury the two ends of the run",
|
|
8456
|
+
"bake-time only, so keep it a dev dependency; the game owns the material and can re-material by the glTF material name `rock`"
|
|
8457
|
+
],
|
|
8458
|
+
"example": "await bakeRock({ form: \"cliff\", biome: \"coastal\", seed: 7, lods: [0, 1], out: \"assets/rocks\" });\nawait bakeRock({ form: \"boulder\", biome: \"forest\", traits: { weathering: 0.8 }, out: \"assets/rocks\" });\nfor (const n of [0, 1, 2]) await bakeRock({ form: \"cliff\", biome: \"desert\", seed: 7, offset: [n * 10, 0, 0], out: \"assets/rocks\" }); // three modules of one wall",
|
|
8459
|
+
"importPath": "@threenative/procedural-environment",
|
|
8460
|
+
"kind": "function",
|
|
8461
|
+
"overrides": [],
|
|
8462
|
+
"package": "@threenative/procedural-environment",
|
|
8463
|
+
"requires": ["npm i -D @threenative/procedural-environment"],
|
|
8464
|
+
"signature": "export async function bakeRock(options: IBakeRockOptions): Promise<IEnvironmentBake[]> { … }",
|
|
8465
|
+
"situations": [
|
|
8466
|
+
"generate a procedural rock, boulder or cliff as a GLB for a game level",
|
|
8467
|
+
"desert mesa, hoodoo or sandstone arch; coastal sea stack; alpine spire; volcanic basalt columns",
|
|
8468
|
+
"a procedural mountain mesh for the horizon, with snow at altitude"
|
|
8469
|
+
],
|
|
8470
|
+
"summary": "Bake a procedural rock (Outcrop) to GLBs, one per level of detail: a boulder, slab, spire, hoodoo, sea stack, mesa, arch, tileable cliff module or a mountain, weathered and coloured for its biome (moss in a forest, snow in the tundra, sand in the desert, algae below the tide line).",
|
|
8471
|
+
"supersedes": [],
|
|
8472
|
+
"symbol": "bakeRock"
|
|
8473
|
+
},
|
|
8474
|
+
{
|
|
8475
|
+
"aliases": [
|
|
8476
|
+
"trees",
|
|
8477
|
+
"palm trees",
|
|
8478
|
+
"street trees along a road",
|
|
8479
|
+
"bushes and shrubs",
|
|
8480
|
+
"grass, flowers and ferns as ground cover",
|
|
8481
|
+
"dead trees, fallen logs and stumps",
|
|
8482
|
+
"low poly tree with level of detail",
|
|
8483
|
+
"realistic textured tree model",
|
|
8484
|
+
"foliage and vegetation models",
|
|
8485
|
+
"pine, oak or spruce forest trees",
|
|
8486
|
+
"grass tufts and clumps"
|
|
8487
|
+
],
|
|
8425
8488
|
"constraints": [
|
|
8426
8489
|
"fails closed: an unknown preset throws naming the nearest ids, the seed must be an integer and each lod 0 to 2",
|
|
8427
8490
|
"the same preset, seed and lods write identical bytes; files are written atomically (temporary file, then rename)",
|
|
8428
8491
|
"bake-time only, so keep it a dev dependency; the game owns the look and the sway (a TSL render/wind.ts reading _WIND), because Arbor.three is not shipped",
|
|
8429
8492
|
"_WIND is vec4 (trunk sway, branch sway, flutter, phase): forest-kit sway is flutter in z, and debris writes all four zero",
|
|
8430
|
-
"
|
|
8493
|
+
"textures default to \"scans\" (the bake's `scan` and `leafScan` name them); nine presets with no fitting CC0 leaf scan (ginkgo, palms, banana, joshua, flowers, elephantear) keep Arbor's drawn leaf card; textures: \"generated\" keeps every generator texture byte for byte",
|
|
8494
|
+
"form, leafImage, barkImage and barkNormalImage patch an Arbor preset only; a forest-kit debris or cover preset throws when given any"
|
|
8431
8495
|
],
|
|
8432
8496
|
"example": "await bakeVegetation({ preset: \"oak\", seed: 7, lods: [0, 1], out: \"assets/trees\" });\nawait bakeVegetation({ preset: \"log\", seed: 3, out: \"assets/debris\" });",
|
|
8433
|
-
"importPath": "@threenative/procedural-
|
|
8497
|
+
"importPath": "@threenative/procedural-environment",
|
|
8434
8498
|
"kind": "function",
|
|
8435
8499
|
"overrides": [],
|
|
8436
|
-
"package": "@threenative/procedural-
|
|
8437
|
-
"requires": ["npm i -D @threenative/procedural-
|
|
8438
|
-
"signature": "export async function bakeVegetation(options: IBakeVegetationOptions): Promise<
|
|
8500
|
+
"package": "@threenative/procedural-environment",
|
|
8501
|
+
"requires": ["npm i -D @threenative/procedural-environment"],
|
|
8502
|
+
"signature": "export async function bakeVegetation(options: IBakeVegetationOptions): Promise<IEnvironmentBake[]> { … }",
|
|
8439
8503
|
"situations": [
|
|
8440
8504
|
"generate a procedural tree, an oak, pine, spruce, palm or any forest species as a GLB",
|
|
8441
8505
|
"procedural oak tree GLB with level of detail for a game forest",
|
|
@@ -8443,21 +8507,68 @@
|
|
|
8443
8507
|
"a fallen mossy log and leaf litter on the forest floor, with a stump, twigs and boulders",
|
|
8444
8508
|
"reeds and cattails at a pond edge, or sedge tussocks, clover and seeding grass as cover"
|
|
8445
8509
|
],
|
|
8446
|
-
"summary": "Bake a procedural tree (Arbor) to GLBs, one per level of detail, ready for ctx.assets.model. Each GLB carries the _WIND vertex attribute, COLOR_0 and TEXCOORD_0
|
|
8510
|
+
"summary": "Bake a procedural tree (Arbor) to GLBs, one per level of detail, ready for ctx.assets.model. Each GLB carries the _WIND vertex attribute, COLOR_0 and TEXCOORD_0 and embeds WebP textures: Arbor trees and cover wear a CC0 bark scan and alpha-masked leaves, blades, fronds and needles painted from CC0 leaf scans; forest-kit wood and stone wear a grey CC0 detail scan, and forest-kit cover and leaf litter a grey CC0 blade or leaf scan, each over the kit's COLOR_0 palette.",
|
|
8447
8511
|
"supersedes": [],
|
|
8448
8512
|
"symbol": "bakeVegetation"
|
|
8449
8513
|
},
|
|
8514
|
+
{
|
|
8515
|
+
"aliases": [],
|
|
8516
|
+
"constraints": [
|
|
8517
|
+
"ids match the Strata terrain kits where they overlap (forest, coastal, alpine, desert, tundra)"
|
|
8518
|
+
],
|
|
8519
|
+
"example": "environmentBiomes().map((biome) => biome.id);",
|
|
8520
|
+
"importPath": "@threenative/procedural-environment",
|
|
8521
|
+
"kind": "function",
|
|
8522
|
+
"overrides": [],
|
|
8523
|
+
"package": "@threenative/procedural-environment",
|
|
8524
|
+
"requires": ["npm i -D @threenative/procedural-environment"],
|
|
8525
|
+
"signature": "export function environmentBiomes(): IEnvironmentBiome[] { … }",
|
|
8526
|
+
"situations": [
|
|
8527
|
+
"which biomes can I bake nature for: forest, desert, jungle, tundra, coast, volcano",
|
|
8528
|
+
"what trees, plants, debris and rocks belong in a desert or an alpine biome"
|
|
8529
|
+
],
|
|
8530
|
+
"summary": "Every biome: its id, name, the request words that mean it, the rock surface its rocks wear and the element ids that belong there.",
|
|
8531
|
+
"supersedes": [],
|
|
8532
|
+
"symbol": "environmentBiomes"
|
|
8533
|
+
},
|
|
8534
|
+
{
|
|
8535
|
+
"aliases": [
|
|
8536
|
+
"nature props for a level",
|
|
8537
|
+
"jungle and tropical plants",
|
|
8538
|
+
"desert cactus",
|
|
8539
|
+
"vegetation for a biome"
|
|
8540
|
+
],
|
|
8541
|
+
"constraints": [
|
|
8542
|
+
"fails closed: an unknown biome or kind throws naming the nearest ids",
|
|
8543
|
+
"biome takes an id or one of its words, so \"jungle\" finds tropical and \"swamp\" finds wetland"
|
|
8544
|
+
],
|
|
8545
|
+
"example": "environmentElements({ biome: \"desert\", kind: \"rock\" }).map((element) => element.bake);\nenvironmentElements({ search: \"palm\" });",
|
|
8546
|
+
"importPath": "@threenative/procedural-environment",
|
|
8547
|
+
"kind": "function",
|
|
8548
|
+
"overrides": [],
|
|
8549
|
+
"package": "@threenative/procedural-environment",
|
|
8550
|
+
"requires": ["npm i -D @threenative/procedural-environment"],
|
|
8551
|
+
"signature": "export function environmentElements(filter: IEnvironmentFilter = { … }",
|
|
8552
|
+
"situations": [
|
|
8553
|
+
"what can I bake for a desert, a jungle, a coast, a tundra or a volcanic island",
|
|
8554
|
+
"list the rocks, cliffs and mountains for a biome, or every plant that grows there",
|
|
8555
|
+
"find a tree or plant by name or latin name, such as pine, palm, cactus or fern"
|
|
8556
|
+
],
|
|
8557
|
+
"summary": "Find the nature elements to bake, by biome, kind or words: trees, ground cover, forest-floor debris and rock forms (boulders, cliffs, sea stacks, mesas, arches, mountains), each with the exact bake call.",
|
|
8558
|
+
"supersedes": [],
|
|
8559
|
+
"symbol": "environmentElements"
|
|
8560
|
+
},
|
|
8450
8561
|
{
|
|
8451
8562
|
"aliases": [],
|
|
8452
8563
|
"constraints": [
|
|
8453
8564
|
"ids come from the vendored Arbor and forest-kit presets; trees are kind \"tree\", grass, ferns and flowers are kind \"cover\", deadwood, litter and stone are kind \"debris\""
|
|
8454
8565
|
],
|
|
8455
8566
|
"example": "vegetationPresets().filter((p) => p.kind === \"debris\").map((p) => p.id);",
|
|
8456
|
-
"importPath": "@threenative/procedural-
|
|
8567
|
+
"importPath": "@threenative/procedural-environment",
|
|
8457
8568
|
"kind": "function",
|
|
8458
8569
|
"overrides": [],
|
|
8459
|
-
"package": "@threenative/procedural-
|
|
8460
|
-
"requires": ["npm i -D @threenative/procedural-
|
|
8570
|
+
"package": "@threenative/procedural-environment",
|
|
8571
|
+
"requires": ["npm i -D @threenative/procedural-environment"],
|
|
8461
8572
|
"signature": "export function vegetationPresets(): IVegetationPreset[] { … }",
|
|
8462
8573
|
"situations": [
|
|
8463
8574
|
"list the oak, pine, spruce, palm and other tree species a bake can grow",
|
|
@@ -9378,6 +9489,25 @@
|
|
|
9378
9489
|
"supersedes": [],
|
|
9379
9490
|
"symbol": "orderedScatterRules"
|
|
9380
9491
|
},
|
|
9492
|
+
{
|
|
9493
|
+
"aliases": [],
|
|
9494
|
+
"constraints": [
|
|
9495
|
+
"`crowns` is metres of crown radius per unit of placement scale, keyed by asset; other assets paint nothing"
|
|
9496
|
+
],
|
|
9497
|
+
"example": "paintCanopyCover(values, { size: 512, resolution: 257 }, placements, { spruce: 7 });",
|
|
9498
|
+
"importPath": "@threenative/terrain",
|
|
9499
|
+
"kind": "function",
|
|
9500
|
+
"overrides": [],
|
|
9501
|
+
"package": "@threenative/terrain",
|
|
9502
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
9503
|
+
"signature": "export function paintCanopyCover( values: Float32Array, world: { … }",
|
|
9504
|
+
"situations": [
|
|
9505
|
+
"shade the ground under a baked stand, at bake time or after a placement edit"
|
|
9506
|
+
],
|
|
9507
|
+
"summary": "Paint each placed tree's crown into a per-vertex canopy grid, so the ground under a stand reads as forest floor rather than open turf. `values` is row-major Z then X, centred on the origin, at the heightfield's own spacing; each vertex keeps the strongest crown that reaches it (0 to 1).",
|
|
9508
|
+
"supersedes": [],
|
|
9509
|
+
"symbol": "paintCanopyCover"
|
|
9510
|
+
},
|
|
9381
9511
|
{
|
|
9382
9512
|
"aliases": [],
|
|
9383
9513
|
"constraints": [
|
|
@@ -9480,6 +9610,23 @@
|
|
|
9480
9610
|
"supersedes": [],
|
|
9481
9611
|
"symbol": "scatterProps"
|
|
9482
9612
|
},
|
|
9613
|
+
{
|
|
9614
|
+
"aliases": [],
|
|
9615
|
+
"constraints": [
|
|
9616
|
+
"offline: about 0.4 s of CPU for a 257² field; bake it, do not run it per frame"
|
|
9617
|
+
],
|
|
9618
|
+
"example": "const sky = skyVisibility(heights, 257, 512);",
|
|
9619
|
+
"importPath": "@threenative/terrain",
|
|
9620
|
+
"kind": "function",
|
|
9621
|
+
"overrides": [],
|
|
9622
|
+
"package": "@threenative/terrain",
|
|
9623
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
9624
|
+
"signature": "export function skyVisibility( heights: ArrayLike<number>, resolution: number, size: number, { … }",
|
|
9625
|
+
"situations": ["bake a heightfield's sky occlusion for the ground's ambient light"],
|
|
9626
|
+
"summary": "The share of the sky each heightfield vertex sees past the terrain around it: 1 on open ground, lower on a valley floor, at a cliff foot or in a crater. The logic follows TerraForge3D's horizon ambient pass (MIT, `heightfield/ambient/compute.glsl`): march outward along evenly spaced azimuths, keep the highest horizon each one meets, and integrate the cosine-weighted sky above it, which is `cos²` of the horizon angle per azimuth. Only ground that rises over both the vertex's tangent plane and the horizontal occludes, so a straight slope and a steep face over a flat floor stay open: the lighting already counts the slope's own tilt. Heights are row-major Z then X, centred on the origin, as the baked world stores them. Every node marches: a strided march filled bilinearly erred by 0.13 at p99 on the alpine survey's creases. About 0.4 s of CPU a world, so `bakeKit` runs it and the game loads `<world>.sky.bin`.",
|
|
9627
|
+
"supersedes": [],
|
|
9628
|
+
"symbol": "skyVisibility"
|
|
9629
|
+
},
|
|
9483
9630
|
{
|
|
9484
9631
|
"aliases": [],
|
|
9485
9632
|
"constraints": ["authoring data only; the game owns appearance, physics and rendering"],
|
|
@@ -10188,7 +10335,7 @@
|
|
|
10188
10335
|
"overrides": [],
|
|
10189
10336
|
"package": "@threenative/terrain",
|
|
10190
10337
|
"requires": ["npm i -D @threenative/terrain"],
|
|
10191
|
-
"signature": "export async function bakeKit( url: string, { … }",
|
|
10338
|
+
"signature": "export async function bakeKit( url: string, options: IBakeKitOptions | IBakeKitWorldOptions, ): Promise<void> { … }",
|
|
10192
10339
|
"situations": ["bake a copied terrain starter kit into its offline world package"],
|
|
10193
10340
|
"summary": "Bake a copied kit, optionally using the caller's installed world cook.",
|
|
10194
10341
|
"supersedes": [],
|
|
@@ -10228,6 +10375,217 @@
|
|
|
10228
10375
|
"supersedes": [],
|
|
10229
10376
|
"symbol": "addStarterWorld"
|
|
10230
10377
|
},
|
|
10378
|
+
{
|
|
10379
|
+
"aliases": [],
|
|
10380
|
+
"constraints": ["the game supplies the height, the collar, its curve and the tile material"],
|
|
10381
|
+
"example": "const ground = addStreamedGround({ ctx, name, size, resolution, height, collar, curve, reach, stream, surface, follow, report });",
|
|
10382
|
+
"importPath": "@threenative/terrain/starter",
|
|
10383
|
+
"kind": "function",
|
|
10384
|
+
"overrides": [],
|
|
10385
|
+
"package": "@threenative/terrain",
|
|
10386
|
+
"requires": ["npm i -D @threenative/terrain @threenative/physics"],
|
|
10387
|
+
"signature": "export function addStreamedGround(options: IStreamedGroundOptions): { … }",
|
|
10388
|
+
"situations": ["stream an authored square's ground past its edge, out to a drawn collar"],
|
|
10389
|
+
"summary": "PRD-790: the ground past the playable square, streamed around the player by `TerrainTiles` out to the collar's reach. Tiles sample the kit's own height function, the surface the square and the collar's vertices stand on, so a tile meets the square and its neighbours with no step. The tile material slides the outermost tile onto the collar's drawn height (`collarMorph`), so at the collar every tile vertex stands on it; `?tnTerrainValidate=1` reports `streamCollarGap`. The largest block of resident tiles around the player is written to the stream each frame: the tiles draw inside it, the collar everywhere else, so a tile that is still building leaves the collar showing, never a hole.",
|
|
10390
|
+
"supersedes": [],
|
|
10391
|
+
"symbol": "addStreamedGround"
|
|
10392
|
+
},
|
|
10393
|
+
{
|
|
10394
|
+
"aliases": [],
|
|
10395
|
+
"constraints": [],
|
|
10396
|
+
"example": "const quaternion = authoredQuaternion(placement);",
|
|
10397
|
+
"importPath": "@threenative/terrain/starter",
|
|
10398
|
+
"kind": "function",
|
|
10399
|
+
"overrides": [],
|
|
10400
|
+
"package": "@threenative/terrain",
|
|
10401
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10402
|
+
"signature": "export function authoredQuaternion( placement: IPlacement, ): readonly [number, number, number, number] { … }",
|
|
10403
|
+
"situations": ["compose a placement's authored rotation before grounding it"],
|
|
10404
|
+
"summary": "The quaternion a placement's own scatter numbers describe: the normal tilt, then the yaw.",
|
|
10405
|
+
"supersedes": [],
|
|
10406
|
+
"symbol": "authoredQuaternion"
|
|
10407
|
+
},
|
|
10408
|
+
{
|
|
10409
|
+
"aliases": [],
|
|
10410
|
+
"constraints": [],
|
|
10411
|
+
"example": "beginScene(\"forest\");",
|
|
10412
|
+
"importPath": "@threenative/terrain/starter",
|
|
10413
|
+
"kind": "function",
|
|
10414
|
+
"overrides": [],
|
|
10415
|
+
"package": "@threenative/terrain",
|
|
10416
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10417
|
+
"signature": "export function beginScene(world: string): void { … }",
|
|
10418
|
+
"situations": ["start the run's view accounting when a scene enters"],
|
|
10419
|
+
"summary": "Start a scene's view accounting: the player view it opens in, and nothing measured yet.",
|
|
10420
|
+
"supersedes": [],
|
|
10421
|
+
"symbol": "beginScene"
|
|
10422
|
+
},
|
|
10423
|
+
{
|
|
10424
|
+
"aliases": [],
|
|
10425
|
+
"constraints": ["the curve must be the one the collar was built with"],
|
|
10426
|
+
"example": "const y = collarArithmeticHeight(collar, { power: 1.65, reach: 2100 }, x, z);",
|
|
10427
|
+
"importPath": "@threenative/terrain/starter",
|
|
10428
|
+
"kind": "function",
|
|
10429
|
+
"overrides": [],
|
|
10430
|
+
"package": "@threenative/terrain",
|
|
10431
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10432
|
+
"signature": "export function collarArithmeticHeight( collar: HeightfieldCollar, curve: ICollarRingCurve, x: number, z: number, ): number { … }",
|
|
10433
|
+
"situations": ["answer a collar height on the CPU exactly as its tile shader computes it"],
|
|
10434
|
+
"summary": "The collar triangle under `(x, z)` found by arithmetic alone, as the tile shader finds it: the ring from the ring spacing, the perimeter step from the face the point projects onto, and the triangle from the point's place in the quad. On one face the world point is an affine map of `(scale, share * scale)`, so weights read there are the drawn triangle's own.",
|
|
10435
|
+
"supersedes": [],
|
|
10436
|
+
"symbol": "collarArithmeticHeight"
|
|
10437
|
+
},
|
|
10438
|
+
{
|
|
10439
|
+
"aliases": [],
|
|
10440
|
+
"constraints": [
|
|
10441
|
+
"reads the collar it is given; never resamples the square or builds a surface"
|
|
10442
|
+
],
|
|
10443
|
+
"example": "const y = collarDrawnHeight(collar, x, z);",
|
|
10444
|
+
"importPath": "@threenative/terrain/starter",
|
|
10445
|
+
"kind": "function",
|
|
10446
|
+
"overrides": [],
|
|
10447
|
+
"package": "@threenative/terrain",
|
|
10448
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10449
|
+
"signature": "export function collarDrawnHeight(collar: HeightfieldCollar, x: number, z: number): number | null { … }",
|
|
10450
|
+
"situations": ["measure or collide against the triangles a collar actually draws"],
|
|
10451
|
+
"summary": "The collar's drawn height under `(x, z)`; null where there is no collar.",
|
|
10452
|
+
"supersedes": [],
|
|
10453
|
+
"symbol": "collarDrawnHeight"
|
|
10454
|
+
},
|
|
10455
|
+
{
|
|
10456
|
+
"aliases": [],
|
|
10457
|
+
"constraints": [
|
|
10458
|
+
"the curve must be the one the collar was built with; the band is one tile wide"
|
|
10459
|
+
],
|
|
10460
|
+
"example": "tile.positionNode = collarMorph(collar, { power: 1.65, reach: 2100 }, stream, 64);",
|
|
10461
|
+
"importPath": "@threenative/terrain/starter",
|
|
10462
|
+
"kind": "function",
|
|
10463
|
+
"overrides": [],
|
|
10464
|
+
"package": "@threenative/terrain",
|
|
10465
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10466
|
+
"signature": "export function collarMorph( collar: HeightfieldCollar, curve: ICollarRingCurve, stream: ICollarStream, band: number, ): Node<\"vec3\"> { … }",
|
|
10467
|
+
"situations": ["slide the streamed ground's outer tile onto a drawn collar without a seam"],
|
|
10468
|
+
"summary": "PRD-790 box 2: the streamed tiles' vertex shift. Only the outermost tile of the square the tiles draw slides onto the collar's drawn height, smoothly over that tile, so at the square's edge every tile vertex stands on the collar; the ground inside keeps the survey's smooth surface. The collar's heights go to the GPU once, as a float texture of rings by perimeter steps.",
|
|
10469
|
+
"supersedes": [],
|
|
10470
|
+
"symbol": "collarMorph"
|
|
10471
|
+
},
|
|
10472
|
+
{
|
|
10473
|
+
"aliases": [],
|
|
10474
|
+
"constraints": [
|
|
10475
|
+
"the caller supplies the height the tiles draw; a coarser `step` samples faster"
|
|
10476
|
+
],
|
|
10477
|
+
"example": "const { gap, fold } = collarSeamGap(collar, tilesHeight, x, z, 288, 2);",
|
|
10478
|
+
"importPath": "@threenative/terrain/starter",
|
|
10479
|
+
"kind": "function",
|
|
10480
|
+
"overrides": [],
|
|
10481
|
+
"package": "@threenative/terrain",
|
|
10482
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10483
|
+
"signature": "export function collarSeamGap( collar: HeightfieldCollar, height: (x: number, z: number) => number, centreX: number, centreZ: number, half: number, spacing: number, step = 0.1, ): { … }",
|
|
10484
|
+
"situations": ["prove a streamed ground and its collar meet without a step"],
|
|
10485
|
+
"summary": "PRD-790: where streamed tiles meet the collar. The tiles draw inside the square `(centreX, centreZ, half)` and the collar outside it, so the seam is that square's edge, past the playable square. `gap` is the largest step at the tiles' edge vertices (`spacing` apart), as core measures a tile-to-tile seam; `fold` is the largest step between them, where a fold of the collar's coarser triangles crosses a tile's straight edge.",
|
|
10486
|
+
"supersedes": [],
|
|
10487
|
+
"symbol": "collarSeamGap"
|
|
10488
|
+
},
|
|
10489
|
+
{
|
|
10490
|
+
"aliases": [],
|
|
10491
|
+
"constraints": [
|
|
10492
|
+
"the world name is the one this state measures; a blank name fails rather than reporting \"\""
|
|
10493
|
+
],
|
|
10494
|
+
"example": "const state = { ...createDiagnosticsState(\"forest\"), showcase: false };",
|
|
10495
|
+
"importPath": "@threenative/terrain/starter",
|
|
10496
|
+
"kind": "function",
|
|
10497
|
+
"overrides": [],
|
|
10498
|
+
"package": "@threenative/terrain",
|
|
10499
|
+
"requires": ["npm i -D @threenative/terrain @threenative/physics"],
|
|
10500
|
+
"signature": "export function createDiagnosticsState(world: string) { … }",
|
|
10501
|
+
"situations": [
|
|
10502
|
+
"start a kit's game state with the measurements every streamed starter world reports"
|
|
10503
|
+
],
|
|
10504
|
+
"summary": "The state one world's measurements are reported through, with its own name in it. The game spreads this into its own state and adds the look values it also reports; the counters live here. The window groups and the drawn-frame counts are module-level on purpose: `ctx.goto` builds a new scene for the next world, and the numbers a run reports are the run's, not one scene's.",
|
|
10505
|
+
"supersedes": [],
|
|
10506
|
+
"symbol": "createDiagnosticsState"
|
|
10507
|
+
},
|
|
10508
|
+
{
|
|
10509
|
+
"aliases": [],
|
|
10510
|
+
"constraints": [
|
|
10511
|
+
"the game supplies the actor, the player body and the probe fixture; it owns no look"
|
|
10512
|
+
],
|
|
10513
|
+
"example": "const measure = createMeasure({ world, physics: ctx.physics, raycast, actor, player, ...options });",
|
|
10514
|
+
"importPath": "@threenative/terrain/starter",
|
|
10515
|
+
"kind": "function",
|
|
10516
|
+
"overrides": [],
|
|
10517
|
+
"package": "@threenative/terrain",
|
|
10518
|
+
"requires": ["npm i -D @threenative/terrain @threenative/physics"],
|
|
10519
|
+
"signature": "export function createMeasure(options: IMeasureOptions): IMeasure { … }",
|
|
10520
|
+
"situations": ["measure one played starter world every fixed step"],
|
|
10521
|
+
"summary": "The per-world measurement: contacts, travel, edge overshoot, water and the frame facts a run reports.",
|
|
10522
|
+
"supersedes": [],
|
|
10523
|
+
"symbol": "createMeasure"
|
|
10524
|
+
},
|
|
10525
|
+
{
|
|
10526
|
+
"aliases": [],
|
|
10527
|
+
"constraints": ["mirrors `collarMorph`'s weight exactly; both read the same curve and band"],
|
|
10528
|
+
"example": "const height = createMorphedHeight(collar, curve, surveyHeight, x, z, 288, 64);",
|
|
10529
|
+
"importPath": "@threenative/terrain/starter",
|
|
10530
|
+
"kind": "function",
|
|
10531
|
+
"overrides": [],
|
|
10532
|
+
"package": "@threenative/terrain",
|
|
10533
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10534
|
+
"signature": "export function createMorphedHeight( collar: HeightfieldCollar, curve: ICollarRingCurve, height: (x: number, z: number) => number, centreX: number, centreZ: number, half: number, band: number, ): (x: number, z: number) => number { … }",
|
|
10535
|
+
"situations": ["check on the CPU the surface the tile shader draws after its morph"],
|
|
10536
|
+
"summary": "The height a tile vertex stands at once `collarMorph` moved it: the survey inside the band, the collar's arithmetic height at the drawn square's edge. The seam measure reads this.",
|
|
10537
|
+
"supersedes": [],
|
|
10538
|
+
"symbol": "createMorphedHeight"
|
|
10539
|
+
},
|
|
10540
|
+
{
|
|
10541
|
+
"aliases": [],
|
|
10542
|
+
"constraints": [
|
|
10543
|
+
"the game builds the camera and the wall probe; the package owns only their wiring"
|
|
10544
|
+
],
|
|
10545
|
+
"example": "const rig = createPlayerRig({ at, field, mannequin, clips, gait, camera, probe, ...options });",
|
|
10546
|
+
"importPath": "@threenative/terrain/starter",
|
|
10547
|
+
"kind": "function",
|
|
10548
|
+
"overrides": [],
|
|
10549
|
+
"package": "@threenative/terrain",
|
|
10550
|
+
"requires": ["npm i -D @threenative/terrain @threenative/physics"],
|
|
10551
|
+
"signature": "export function createPlayerRig(options: IPlayerRigOptions): IPlayerRig { … }",
|
|
10552
|
+
"situations": ["give a copied starter kit its player capsule, mannequin and follow camera"],
|
|
10553
|
+
"summary": "The player: the capsule the solver moves, the mannequin that rides it, and the third-person camera that follows with the terrain as its walls. The stepped world is the authority for both the ground the player stands on and the wall the orbit camera cannot pass, which is why both queries mask to the game's ground layer: what the player can walk on. Every appearance value — the mannequin, its clips, the gait speeds, the capsule and the camera framing — comes from the game.",
|
|
10554
|
+
"supersedes": [],
|
|
10555
|
+
"symbol": "createPlayerRig"
|
|
10556
|
+
},
|
|
10557
|
+
{
|
|
10558
|
+
"aliases": [],
|
|
10559
|
+
"constraints": [],
|
|
10560
|
+
"example": "const reveal = createRevealProbe({ camera, covered, phase, released, ...options });",
|
|
10561
|
+
"importPath": "@threenative/terrain/starter",
|
|
10562
|
+
"kind": "function",
|
|
10563
|
+
"overrides": [],
|
|
10564
|
+
"package": "@threenative/terrain",
|
|
10565
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10566
|
+
"signature": "export function createRevealProbe(options: IRevealProbeOptions): IRevealProbe { … }",
|
|
10567
|
+
"situations": ["measure whether the spawn drew before the curtain released it"],
|
|
10568
|
+
"summary": "What the loading reveal showed once the curtain lifts: drawn batches, pipelines and impostor readiness, measured against the reveal's own baseline.",
|
|
10569
|
+
"supersedes": [],
|
|
10570
|
+
"symbol": "createRevealProbe"
|
|
10571
|
+
},
|
|
10572
|
+
{
|
|
10573
|
+
"aliases": [],
|
|
10574
|
+
"constraints": [
|
|
10575
|
+
"Every value it reports is supplied by the game; a failure writes one `TN_` line"
|
|
10576
|
+
],
|
|
10577
|
+
"example": "const gate = createSpawnGate(ctx, { world, progress, witness, released });",
|
|
10578
|
+
"importPath": "@threenative/terrain/starter",
|
|
10579
|
+
"kind": "function",
|
|
10580
|
+
"overrides": [],
|
|
10581
|
+
"package": "@threenative/terrain",
|
|
10582
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10583
|
+
"signature": "export function createSpawnGate(ctx: SpawnGateHost, options: ISpawnGateOptions): ISpawnGate { … }",
|
|
10584
|
+
"situations": ["hold a streamed starter world's loading screen until its spawn has landed"],
|
|
10585
|
+
"summary": "The spawn gate: one deadline, one settlement, one failure report. `WorldCells.whenSpawnReady` is the data authority and each streamed world's `prewarmed` is the draw gate; this gate turns their landing into the loading screen's release, and writes the one console line a failed spawn leaves behind.",
|
|
10586
|
+
"supersedes": [],
|
|
10587
|
+
"symbol": "createSpawnGate"
|
|
10588
|
+
},
|
|
10231
10589
|
{
|
|
10232
10590
|
"aliases": [],
|
|
10233
10591
|
"constraints": [],
|
|
@@ -10247,6 +10605,160 @@
|
|
|
10247
10605
|
"supersedes": [],
|
|
10248
10606
|
"symbol": "editWorldPlacements"
|
|
10249
10607
|
},
|
|
10608
|
+
{
|
|
10609
|
+
"aliases": [],
|
|
10610
|
+
"constraints": [],
|
|
10611
|
+
"example": "const { windows } = enterView(\"forest\", \"overview\");",
|
|
10612
|
+
"importPath": "@threenative/terrain/starter",
|
|
10613
|
+
"kind": "function",
|
|
10614
|
+
"overrides": [],
|
|
10615
|
+
"package": "@threenative/terrain",
|
|
10616
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10617
|
+
"signature": "export function enterView(world: string, view: string): { … }",
|
|
10618
|
+
"situations": ["switch the measured view when the benchmark camera cycle moves"],
|
|
10619
|
+
"summary": "The camera cycle moved to another view: a keyed group for it, and a fresh measurement.",
|
|
10620
|
+
"supersedes": [],
|
|
10621
|
+
"symbol": "enterView"
|
|
10622
|
+
},
|
|
10623
|
+
{
|
|
10624
|
+
"aliases": [],
|
|
10625
|
+
"constraints": [],
|
|
10626
|
+
"example": "invalidatePropShadows(ctx.shadows, region);",
|
|
10627
|
+
"importPath": "@threenative/terrain/starter",
|
|
10628
|
+
"kind": "function",
|
|
10629
|
+
"overrides": [],
|
|
10630
|
+
"package": "@threenative/terrain",
|
|
10631
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10632
|
+
"signature": "export function invalidatePropShadows( shadow: { … }",
|
|
10633
|
+
"situations": [
|
|
10634
|
+
"forward a streamed world's changed caster bounds to the game's shadow renderer"
|
|
10635
|
+
],
|
|
10636
|
+
"summary": "Keep WorldCells' changed caster bounds when forwarding to the existing shadow renderer.",
|
|
10637
|
+
"supersedes": [],
|
|
10638
|
+
"symbol": "invalidatePropShadows"
|
|
10639
|
+
},
|
|
10640
|
+
{
|
|
10641
|
+
"aliases": [],
|
|
10642
|
+
"constraints": [],
|
|
10643
|
+
"example": "leaveScene();",
|
|
10644
|
+
"importPath": "@threenative/terrain/starter",
|
|
10645
|
+
"kind": "function",
|
|
10646
|
+
"overrides": [],
|
|
10647
|
+
"package": "@threenative/terrain",
|
|
10648
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10649
|
+
"signature": "export function leaveScene(): void { … }",
|
|
10650
|
+
"situations": ["stop attributing windows to a view when its scene is left"],
|
|
10651
|
+
"summary": "The scene is gone: nothing is on screen, so no window can belong to a view.",
|
|
10652
|
+
"supersedes": [],
|
|
10653
|
+
"symbol": "leaveScene"
|
|
10654
|
+
},
|
|
10655
|
+
{
|
|
10656
|
+
"aliases": [],
|
|
10657
|
+
"constraints": [],
|
|
10658
|
+
"example": "const canopy = await loadCanopy(assets, \"forest\");",
|
|
10659
|
+
"importPath": "@threenative/terrain/starter",
|
|
10660
|
+
"kind": "function",
|
|
10661
|
+
"overrides": [],
|
|
10662
|
+
"package": "@threenative/terrain",
|
|
10663
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10664
|
+
"signature": "export async function loadCanopy( assets: Pick<IAssetLoader, \"resolve\">, world: string, ): Promise<Float32Array> { … }",
|
|
10665
|
+
"situations": ["load the canopy map a streamed world's ground shades with"],
|
|
10666
|
+
"summary": "The canopy weight the ground shader reads, painted from the placements the bake drew.",
|
|
10667
|
+
"supersedes": [],
|
|
10668
|
+
"symbol": "loadCanopy"
|
|
10669
|
+
},
|
|
10670
|
+
{
|
|
10671
|
+
"aliases": [],
|
|
10672
|
+
"constraints": [],
|
|
10673
|
+
"example": "const props = await loadPropPackage(assets, \"forest\");",
|
|
10674
|
+
"importPath": "@threenative/terrain/starter",
|
|
10675
|
+
"kind": "function",
|
|
10676
|
+
"overrides": [],
|
|
10677
|
+
"package": "@threenative/terrain",
|
|
10678
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10679
|
+
"signature": "export async function loadPropPackage( assets: Pick<IAssetLoader, \"resolve\">, world: string, ): Promise<IPropPackage> { … }",
|
|
10680
|
+
"situations": ["load the prop containers a bake wrote for one world"],
|
|
10681
|
+
"summary": "The baked prop package of one world, fetched as the bake wrote it. The files are the bake's output, not the game's: the manifest names one container, one reach array and one placement-ID list per streamed world, and nothing here derives a placement.",
|
|
10682
|
+
"supersedes": [],
|
|
10683
|
+
"symbol": "loadPropPackage"
|
|
10684
|
+
},
|
|
10685
|
+
{
|
|
10686
|
+
"aliases": [],
|
|
10687
|
+
"constraints": [],
|
|
10688
|
+
"example": "const sky = await loadSky(assets, \"forest\");",
|
|
10689
|
+
"importPath": "@threenative/terrain/starter",
|
|
10690
|
+
"kind": "function",
|
|
10691
|
+
"overrides": [],
|
|
10692
|
+
"package": "@threenative/terrain",
|
|
10693
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10694
|
+
"signature": "export async function loadSky( assets: Pick<IAssetLoader, \"resolve\">, world: string, ): Promise<Float32Array> { … }",
|
|
10695
|
+
"situations": ["load the sky-visibility map a streamed world's ground shades with"],
|
|
10696
|
+
"summary": "The share of the sky each terrain vertex sees past the relief, as `skyVisibility` baked it.",
|
|
10697
|
+
"supersedes": [],
|
|
10698
|
+
"symbol": "loadSky"
|
|
10699
|
+
},
|
|
10700
|
+
{
|
|
10701
|
+
"aliases": [],
|
|
10702
|
+
"constraints": [],
|
|
10703
|
+
"example": "ctx.beforeRender(() => observeFrame(ctx));",
|
|
10704
|
+
"importPath": "@threenative/terrain/starter",
|
|
10705
|
+
"kind": "function",
|
|
10706
|
+
"overrides": [],
|
|
10707
|
+
"package": "@threenative/terrain",
|
|
10708
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10709
|
+
"signature": "export function observeFrame(ctx: ICounterCtx): void { … }",
|
|
10710
|
+
"situations": ["count a drawn frame and open the next GPU sample window"],
|
|
10711
|
+
"summary": "One world frame was drawn: count it, and open a fresh GPU sample window if the view or the readiness changed. Called from the render hook, before the camera is placed.",
|
|
10712
|
+
"supersedes": [],
|
|
10713
|
+
"symbol": "observeFrame"
|
|
10714
|
+
},
|
|
10715
|
+
{
|
|
10716
|
+
"aliases": [],
|
|
10717
|
+
"constraints": [],
|
|
10718
|
+
"example": "frameBudget: { onWindow: observeWindow }",
|
|
10719
|
+
"importPath": "@threenative/terrain/starter",
|
|
10720
|
+
"kind": "function",
|
|
10721
|
+
"overrides": [],
|
|
10722
|
+
"package": "@threenative/terrain",
|
|
10723
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10724
|
+
"signature": "export function observeWindow(window: IFrameBudgetWindow): void { … }",
|
|
10725
|
+
"situations": ["read the engine's own closed frame window into the run's report"],
|
|
10726
|
+
"summary": "The frame-budget window closed: latch it, and update the numbers the run reports.",
|
|
10727
|
+
"supersedes": [],
|
|
10728
|
+
"symbol": "observeWindow"
|
|
10729
|
+
},
|
|
10730
|
+
{
|
|
10731
|
+
"aliases": [],
|
|
10732
|
+
"constraints": [
|
|
10733
|
+
"the burial, footprint and base-ring assets are the game's; the package applies them"
|
|
10734
|
+
],
|
|
10735
|
+
"example": "const pose = preparePose(foot.geometry, material, record.placement, undefined, groundAt, rules);",
|
|
10736
|
+
"importPath": "@threenative/terrain/starter",
|
|
10737
|
+
"kind": "function",
|
|
10738
|
+
"overrides": [],
|
|
10739
|
+
"package": "@threenative/terrain",
|
|
10740
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10741
|
+
"signature": "export function preparePose( geometry: BufferGeometry, _material: Material, placement: IPlacement, transform: IPlacementOverride | undefined, groundAt: PropGroundQuery, rules: IPropGroundRules, pose?: IPropPoseOverride, ): IPropPose { … }",
|
|
10742
|
+
"situations": ["ground one baked prop record on the game's height field before streaming it"],
|
|
10743
|
+
"summary": "The pose a prop draws at, grounded on the game's own height field. The record's quaternion, when present, replaces the rotation a live placement composes; every step below it — the ground snap, the boulder burial, the flat-footprint sink and the crag base ring — still runs, because the record is a pose and not an override of the pose. A placement with no ground under it fails closed by its own id, so a streamed world cannot silently float.",
|
|
10744
|
+
"supersedes": [],
|
|
10745
|
+
"symbol": "preparePose"
|
|
10746
|
+
},
|
|
10747
|
+
{
|
|
10748
|
+
"aliases": [],
|
|
10749
|
+
"constraints": [],
|
|
10750
|
+
"example": "const prepared = preparePropTransform(instance, transform, groundAt, rules);",
|
|
10751
|
+
"importPath": "@threenative/terrain/starter",
|
|
10752
|
+
"kind": "function",
|
|
10753
|
+
"overrides": [],
|
|
10754
|
+
"package": "@threenative/terrain",
|
|
10755
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10756
|
+
"signature": "export function preparePropTransform( instance: IPropInstance, transform: IPlacementOverride | undefined, groundAt: PropGroundQuery, rules: IPropGroundRules, ) { … }",
|
|
10757
|
+
"situations": ["re-pose one prop the editor edited and keep the transform it reported"],
|
|
10758
|
+
"summary": "The pose and the transform an editor edited, prepared together so one write reports both.",
|
|
10759
|
+
"supersedes": [],
|
|
10760
|
+
"symbol": "preparePropTransform"
|
|
10761
|
+
},
|
|
10250
10762
|
{
|
|
10251
10763
|
"aliases": [],
|
|
10252
10764
|
"constraints": ["Shapes and reach are supplied by the game; detach releases every body"],
|
|
@@ -10262,6 +10774,130 @@
|
|
|
10262
10774
|
"supersedes": [],
|
|
10263
10775
|
"symbol": "PropColliders"
|
|
10264
10776
|
},
|
|
10777
|
+
{
|
|
10778
|
+
"aliases": [],
|
|
10779
|
+
"constraints": [],
|
|
10780
|
+
"example": "const counts = propCounts(pkg, [\"spruce\", \"boulder\"]);",
|
|
10781
|
+
"importPath": "@threenative/terrain/starter",
|
|
10782
|
+
"kind": "function",
|
|
10783
|
+
"overrides": [],
|
|
10784
|
+
"package": "@threenative/terrain",
|
|
10785
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10786
|
+
"signature": "export function propCounts( pkg: IPropPackage, assetNames: readonly string[], ): Record<string, number> { … }",
|
|
10787
|
+
"situations": ["report how many records each asset drew, zero included"],
|
|
10788
|
+
"summary": "Records per asset across the package's buckets: what the run report calls the scatter's counts.",
|
|
10789
|
+
"supersedes": [],
|
|
10790
|
+
"symbol": "propCounts"
|
|
10791
|
+
},
|
|
10792
|
+
{
|
|
10793
|
+
"aliases": [],
|
|
10794
|
+
"constraints": [],
|
|
10795
|
+
"example": "const key = propKey(placement, 2);",
|
|
10796
|
+
"importPath": "@threenative/terrain/starter",
|
|
10797
|
+
"kind": "function",
|
|
10798
|
+
"overrides": [],
|
|
10799
|
+
"package": "@threenative/terrain",
|
|
10800
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10801
|
+
"signature": "export function propKey(placement: IPlacement, variant: number): string { … }",
|
|
10802
|
+
"situations": ["name the model a baked or live placement record draws"],
|
|
10803
|
+
"summary": "The model a record draws: its asset, its variant, and the shape a non-uniform edit gave it. `WorldCells` names the model through the run the record sits in, so this key is what the container stores. A placement with one uniform scale draws its variant as authored (`spruce:2`); a placement the editor scaled unevenly draws a model of that shape (`spruce:2@1,0.5,0.5`), so the record stays one uniform scale and the picture keeps the edit.",
|
|
10804
|
+
"supersedes": [],
|
|
10805
|
+
"symbol": "propKey"
|
|
10806
|
+
},
|
|
10807
|
+
{
|
|
10808
|
+
"aliases": [],
|
|
10809
|
+
"constraints": [],
|
|
10810
|
+
"example": "const ratio = propRatio(\"spruce:2@1,0.5,0.5\");",
|
|
10811
|
+
"importPath": "@threenative/terrain/starter",
|
|
10812
|
+
"kind": "function",
|
|
10813
|
+
"overrides": [],
|
|
10814
|
+
"package": "@threenative/terrain",
|
|
10815
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10816
|
+
"signature": "export function propRatio(key: string): [number, number, number] { … }",
|
|
10817
|
+
"situations": ["scale a streamed model by the shape its record's single scale cannot carry"],
|
|
10818
|
+
"summary": "The shape `propKey` wrote, so the loader scales the model the record's one scale cannot carry.",
|
|
10819
|
+
"supersedes": [],
|
|
10820
|
+
"symbol": "propRatio"
|
|
10821
|
+
},
|
|
10822
|
+
{
|
|
10823
|
+
"aliases": [],
|
|
10824
|
+
"constraints": [],
|
|
10825
|
+
"example": "publish(ctx, { world, worldReady, frames, ...facts });",
|
|
10826
|
+
"importPath": "@threenative/terrain/starter",
|
|
10827
|
+
"kind": "function",
|
|
10828
|
+
"overrides": [],
|
|
10829
|
+
"package": "@threenative/terrain",
|
|
10830
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10831
|
+
"signature": "export function publish( ctx: { … }",
|
|
10832
|
+
"situations": ["write the measured view and frame numbers into the game's state"],
|
|
10833
|
+
"summary": "Publish the measurements and the scene's own facts into state, twice per second.",
|
|
10834
|
+
"supersedes": [],
|
|
10835
|
+
"symbol": "publish"
|
|
10836
|
+
},
|
|
10837
|
+
{
|
|
10838
|
+
"aliases": [],
|
|
10839
|
+
"constraints": [],
|
|
10840
|
+
"example": "const transform = readPropTransform(instance);",
|
|
10841
|
+
"importPath": "@threenative/terrain/starter",
|
|
10842
|
+
"kind": "function",
|
|
10843
|
+
"overrides": [],
|
|
10844
|
+
"package": "@threenative/terrain",
|
|
10845
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10846
|
+
"signature": "export function readPropTransform(instance: IPropInstance): IPlacementOverride { … }",
|
|
10847
|
+
"situations": ["read an edited prop's current pose for the scene format"],
|
|
10848
|
+
"summary": "The transform an instance's current pose describes.",
|
|
10849
|
+
"supersedes": [],
|
|
10850
|
+
"symbol": "readPropTransform"
|
|
10851
|
+
},
|
|
10852
|
+
{
|
|
10853
|
+
"aliases": [],
|
|
10854
|
+
"constraints": [
|
|
10855
|
+
"the variant, reach, bucket, LOD and gate rows are the game's; the package only applies"
|
|
10856
|
+
],
|
|
10857
|
+
"example": "const props = await streamProps({ package: propPackage, groundAt, parts, materials, surface,\n follow, size, whileCurrent, variantOf, reachOf, bucketOf, lodOf, ...options });",
|
|
10858
|
+
"importPath": "@threenative/terrain/starter",
|
|
10859
|
+
"kind": "function",
|
|
10860
|
+
"overrides": [],
|
|
10861
|
+
"package": "@threenative/terrain",
|
|
10862
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10863
|
+
"signature": "export async function streamProps(options: IPropWorldOptions) { … }",
|
|
10864
|
+
"situations": [
|
|
10865
|
+
"stream a world's baked prop containers and its live placements through WorldCells"
|
|
10866
|
+
],
|
|
10867
|
+
"summary": "Load the prop worlds, pose every record on the ground, and hand each bucket to `WorldCells`. The passes are short and yield between slices, because the whole point of streaming is that the first frame does not wait for 200 000 records: the records are decoded and grounded in slices, and each bucket loads as its own world.",
|
|
10868
|
+
"supersedes": [],
|
|
10869
|
+
"symbol": "streamProps"
|
|
10870
|
+
},
|
|
10871
|
+
{
|
|
10872
|
+
"aliases": [],
|
|
10873
|
+
"constraints": [],
|
|
10874
|
+
"example": "const record = withAuthoredPose(placement);",
|
|
10875
|
+
"importPath": "@threenative/terrain/starter",
|
|
10876
|
+
"kind": "function",
|
|
10877
|
+
"overrides": [],
|
|
10878
|
+
"package": "@threenative/terrain",
|
|
10879
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10880
|
+
"signature": "export function withAuthoredPose(placement: IPlacement): IPlacement { … }",
|
|
10881
|
+
"situations": ["fold an authored placement into the record transform the bake stores"],
|
|
10882
|
+
"summary": "A placement as a package record stores it: the authored pose becomes its transform, at one scale. A record holds position, quaternion and one uniform scale, so an edited placement's own transform is folded down to the scale its record carries. The shape that scale removed is `propKey`'s ratio, and the drawable model that ratio names carries it instead.",
|
|
10883
|
+
"supersedes": [],
|
|
10884
|
+
"symbol": "withAuthoredPose"
|
|
10885
|
+
},
|
|
10886
|
+
{
|
|
10887
|
+
"aliases": [],
|
|
10888
|
+
"constraints": [],
|
|
10889
|
+
"example": "writePropTransform(instance, prepared);",
|
|
10890
|
+
"importPath": "@threenative/terrain/starter",
|
|
10891
|
+
"kind": "function",
|
|
10892
|
+
"overrides": [],
|
|
10893
|
+
"package": "@threenative/terrain",
|
|
10894
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
10895
|
+
"signature": "export function writePropTransform( instance: IPropInstance, prepared: ReturnType<typeof preparePropTransform>, ): void { … }",
|
|
10896
|
+
"situations": ["write an edited prop's prepared pose back onto its instance"],
|
|
10897
|
+
"summary": "Writes a prepared pose onto the instance, reporting the transform only when the pose changed.",
|
|
10898
|
+
"supersedes": [],
|
|
10899
|
+
"symbol": "writePropTransform"
|
|
10900
|
+
},
|
|
10265
10901
|
{
|
|
10266
10902
|
"aliases": [],
|
|
10267
10903
|
"constraints": ["creates only geometry; the caller owns its material, scene and disposal"],
|
|
@@ -11163,9 +11799,9 @@
|
|
|
11163
11799
|
"situations": ["authoritative replication", "client prediction"]
|
|
11164
11800
|
},
|
|
11165
11801
|
{
|
|
11166
|
-
"guidance": "The framework owns no vegetation render system: wind and materials are your look, in your project's src/render/. Trees come from the optional bake package: npm i -D @threenative/procedural-
|
|
11167
|
-
"id": "procedural-
|
|
11168
|
-
"situations": ["
|
|
11802
|
+
"guidance": "The framework owns no vegetation render system: wind and materials are your look, in your project's src/render/. Trees come from the optional bake package: npm i -D @threenative/procedural-environment, then await bakeVegetation({ preset: \"oak\", seed: 7, lods: [0, 1], out: \"assets/trees\" }) writes one GLB per LOD (vegetationPresets() lists the 28 species). Each GLB carries COLOR_0, TEXCOORD_0, embedded bark and leaf textures, alpha-masked leaves and a per-vertex _WIND vec4 (x trunk sway m, y branch sway m, z leaf flutter m, w phase). Cook them with assets.models.passes.prune: false (prune strips the uv and _WIND your materials read), load with ctx.assets.model and re-material by glTF material name (bark, foliage). Write the sway as TSL in render/wind.ts: attribute(\"_wind\", \"vec4\") scaled by a time uniform and a world wind direction, pushed through modelWorldMatrixInverse so it stays in world metres. A terrain world takes the same trees through the species prefix arbor:<preset>[@seed].",
|
|
11803
|
+
"id": "procedural-environment",
|
|
11804
|
+
"situations": ["foliage wind sway shader", "wind animation render system for leaves"]
|
|
11169
11805
|
},
|
|
11170
11806
|
{
|
|
11171
11807
|
"guidance": "The framework owns no IK system. Copy the MIT source in examples/integrations/ik/src/ (https://github.com/ThreeNativeHQ/threenative/tree/develop/examples/integrations/ik) into your src/ and follow its README: it needs the closed-chain-ik/core dependency its own package.json pins, three keeps the only rendered pose, and new ConstrainedIK({root, joints: [{bone, axes, min, max}], effectors: [{bone, orientation?}], iterations, positionTolerance, rotationTolerance}) admits direct Bone hierarchies under rigid or positive-uniform-scale parents (shear, reflection, non-uniform or singular scale throws before the pose is touched). Call ik.update(targets) once per frame after AnimationPlayer/mixer and before render, with one world-space metre position per effector in order plus an optional quaternion only where the effector declared orientation: true; it never starts a loop, never moves the root and installs no bone translation or root-motion controller. Joint limits are X/Y/Z offsets relative to the animation pose supplied that call, so reapply the animation pose before solving to avoid accumulation, and the solver only rotates: bone lengths hold to under 1e-15 m. Iterations are 1-128; an unreachable goal returns converged false with finite residuals and never throws, a solver failure restores the original pose, and dispose() at scene teardown. Worked demo: the rifle grip game in examples/constrained-ik/, which plays on web, desktop native and Android.",
|