@threenative/core 0.3.4 → 0.3.5
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 +1505 -79
- package/dist/{audio-7i3Xl0l3.d.ts → audio-DIJE5HTr.d.ts} +43 -3
- package/dist/{canvas-layer-DDmC_VVF.d.ts → canvas-layer-C1-5CviZ.d.ts} +5 -1
- package/dist/{game-CljaDv4D.d.ts → game-Bj8G1wmD.d.ts} +102 -11
- package/dist/hot.d.ts +4 -4
- package/dist/index.d.ts +712 -118
- package/dist/index.js +12423 -4955
- package/dist/{gpu-readback-CqJEfWNQ.d.ts → model-lod-BDAUYgsS.d.ts} +80 -5
- package/dist/playtest.d.ts +6 -10
- package/dist/playtest.js +47 -24
- package/dist/react-css.d.ts +62 -0
- package/dist/react-css.js +591 -0
- package/dist/react.d.ts +2 -2
- package/dist/{renderer-CfsS2hxi.d.ts → renderer-9yEo9hPa.d.ts} +489 -22
- package/dist/terrain-jobs-worker.d.ts +2 -0
- package/dist/terrain-jobs-worker.js +130 -0
- package/dist/ui-layer.js +59 -8
- package/dist/world.d.ts +766 -73
- package/dist/world.js +9307 -3543
- package/gpl/recipes/export_world.py +18 -1
- package/mcp/blender-server.mjs +7 -4
- package/mcp/blender.mjs +3 -4
- package/mcp/engine-server.mjs +2 -2
- package/mcp/servers.mjs +4 -4
- package/package.json +15 -9
- package/patches/three@0.185.1-prd269-upgrade.patch +22418 -0
- package/patches/three@0.185.1.patch +6594 -700
- package/scripts/apply-three-patch.mjs +62 -4
- package/src/animation-blend.ts +264 -0
- package/src/animation-composition.ts +362 -0
- package/src/animation-layers.ts +260 -0
- package/src/animation-root-motion.ts +283 -0
- package/src/animation.ts +896 -0
- package/src/assets.ts +1303 -0
- package/src/atmosphere/index.ts +335 -0
- package/src/atmosphere/luts.ts +298 -0
- package/src/atmosphere/params.ts +323 -0
- package/src/audio.ts +912 -0
- package/src/billboard.ts +124 -0
- package/src/bone-lengths.ts +157 -0
- package/src/camera-shake.ts +116 -0
- package/src/canvas-layer.ts +47 -0
- package/src/clip-audit.ts +401 -0
- package/src/clustered-batch.ts +492 -0
- package/src/clustered-mesh.ts +638 -0
- package/src/compute-driven.ts +176 -0
- package/src/compute-timing.ts +318 -0
- package/src/config.ts +593 -0
- package/src/debug.ts +82 -0
- package/src/engine-render-hook.ts +25 -0
- package/src/entities.ts +79 -0
- package/src/entity-snapshot.ts +53 -0
- package/src/flight.ts +683 -0
- package/src/fluid-field.ts +748 -0
- package/src/fluid-particles.ts +1253 -0
- package/src/frame-budget.ts +1368 -0
- package/src/game.ts +2390 -0
- package/src/geometry-capture.ts +1098 -0
- package/src/gpu-class.ts +160 -0
- package/src/gpu-frame-observation.ts +424 -0
- package/src/gpu-readback.ts +143 -0
- package/src/gpu-scene-bvh.ts +464 -0
- package/src/grounding.ts +100 -0
- package/src/hot.ts +161 -0
- package/src/import-meta.d.ts +13 -0
- package/src/index.ts +1536 -0
- package/src/input.ts +690 -0
- package/src/instanced-batch-lod.ts +283 -0
- package/src/instanced-batch.ts +274 -0
- package/src/interpolation.ts +129 -0
- package/src/launch-diagnostics.ts +161 -0
- package/src/loop.ts +564 -0
- package/src/matrix-world.ts +245 -0
- package/src/merge-parts.ts +812 -0
- package/src/model-lod.ts +1315 -0
- package/src/net-protocol.ts +333 -0
- package/src/net-session.ts +477 -0
- package/src/net.ts +80 -0
- package/src/ocean/fft.ts +72 -0
- package/src/ocean/spectral.ts +728 -0
- package/src/particle-significance.ts +102 -0
- package/src/particles.ts +648 -0
- package/src/path-follow.ts +175 -0
- package/src/picking.ts +250 -0
- package/src/pipeline-census.ts +1566 -0
- package/src/platform.ts +210 -0
- package/src/playtest.ts +839 -0
- package/src/pointer-events.ts +411 -0
- package/src/pose-measure.ts +435 -0
- package/src/profiling/FrameCounters.ts +231 -0
- package/src/profiling/Spans.ts +548 -0
- package/src/profiling/opacity-convention.ts +21 -0
- package/src/profiling/render-list-validate.ts +175 -0
- package/src/profiling/render-trap-audit.ts +84 -0
- package/src/profiling/scene-warning.ts +190 -0
- package/src/profiling/span-probes.ts +191 -0
- package/src/profiling/unlit-foliage-warning.ts +149 -0
- package/src/projection-apply.ts +1529 -0
- package/src/projection-marker.ts +142 -0
- package/src/projection-plan.ts +1258 -0
- package/src/projection-skinned.ts +419 -0
- package/src/projection-stability.ts +409 -0
- package/src/projection-uniform.ts +328 -0
- package/src/random.ts +41 -0
- package/src/react-css.ts +604 -0
- package/src/react-glyphs.ts +114 -0
- package/src/react-host.ts +576 -0
- package/src/react-layout.ts +265 -0
- package/src/react.ts +60 -0
- package/src/render/alpha-antialiasing.ts +159 -0
- package/src/render/batched-velocity.ts +126 -0
- package/src/render/chain.ts +1021 -0
- package/src/render/daylight.ts +189 -0
- package/src/render/depth-pyramid.ts +596 -0
- package/src/render/foliage-alpha.ts +166 -0
- package/src/render/material-key.ts +60 -0
- package/src/render/mesh-pool.ts +144 -0
- package/src/render/probe-volume.ts +1668 -0
- package/src/render/resolution-subrect.ts +253 -0
- package/src/render/velocity.ts +442 -0
- package/src/render/virtual-shadow-pages.ts +827 -0
- package/src/render/virtual-shadow-partial.ts +174 -0
- package/src/render/virtual-shadow.ts +3330 -0
- package/src/render/world-impostor-surface.ts +722 -0
- package/src/render/world-impostor.ts +558 -0
- package/src/render-camera-cull.ts +441 -0
- package/src/render-pass-budget.ts +501 -0
- package/src/renderProjection.ts +758 -0
- package/src/renderer-config.ts +127 -0
- package/src/renderer.ts +1847 -0
- package/src/replay-protocol.ts +85 -0
- package/src/replay.ts +205 -0
- package/src/resolution-scaler.ts +819 -0
- package/src/rig-preparation.ts +271 -0
- package/src/ripple-field.ts +432 -0
- package/src/scale.ts +109 -0
- package/src/scene.ts +239 -0
- package/src/schedule.ts +155 -0
- package/src/skeletal-mesh.ts +61 -0
- package/src/skeleton.ts +100 -0
- package/src/snow-field.ts +744 -0
- package/src/softbody-topology.ts +269 -0
- package/src/softbody.ts +516 -0
- package/src/sprite-animator.ts +222 -0
- package/src/startup-readiness.ts +386 -0
- package/src/state.ts +66 -0
- package/src/static-transform.ts +274 -0
- package/src/storage-buffer.ts +253 -0
- package/src/streaming.ts +308 -0
- package/src/target-fps.ts +92 -0
- package/src/terrain-jobs-worker.ts +17 -0
- package/src/terrain-jobs.ts +353 -0
- package/src/textures.ts +39 -0
- package/src/tracers.ts +237 -0
- package/src/ui-bridge.ts +368 -0
- package/src/ui-hit-regions.ts +380 -0
- package/src/ui-layer.ts +83 -0
- package/src/ui-state.ts +220 -0
- package/src/version.ts +2 -0
- package/src/viewport.ts +253 -0
- package/src/warmup.ts +1357 -0
- package/src/water-surface.ts +384 -0
- package/src/wave-field.ts +524 -0
- package/src/world-capabilities.ts +131 -0
- package/src/world-cell-proxy.ts +392 -0
- package/src/world-cells.ts +10564 -0
- package/src/world-gpu-scene.ts +3354 -0
- package/src/world-heightmap.ts +82 -0
- package/src/world-package.ts +469 -0
- package/src/world-passes.ts +582 -0
- package/src/world-region.ts +17 -0
- package/src/world-terrain-splat.ts +564 -0
- package/src/world-tiles.ts +3826 -0
- package/src/world-topology.ts +370 -0
- package/src/world-validate.ts +48 -0
- package/src/world.ts +805 -0
package/capabilities.json
CHANGED
|
@@ -544,7 +544,7 @@
|
|
|
544
544
|
"importPath": "@threenative/core",
|
|
545
545
|
"kind": "function",
|
|
546
546
|
"overrides": [
|
|
547
|
-
"sliceSize
|
|
547
|
+
"a slice ends on an 8 ms budget unless the game gives `sliceSize`, and the reported sliceSize is then the measured average; `marker: false` silences the TN_ADD_SLICES line, not the report"
|
|
548
548
|
],
|
|
549
549
|
"package": "@threenative/core",
|
|
550
550
|
"signature": "export async function addInSlices<T>( objects: Iterable<T>, add: (object: T, index: number) => void, options: IAddInSlicesOptions = { … }",
|
|
@@ -684,6 +684,30 @@
|
|
|
684
684
|
"supersedes": [],
|
|
685
685
|
"symbol": "alwaysRender"
|
|
686
686
|
},
|
|
687
|
+
{
|
|
688
|
+
"aliases": [],
|
|
689
|
+
"constraints": [
|
|
690
|
+
"one base phase, one masked override, at most two additive layers and eight actions",
|
|
691
|
+
"root motion requires a separate rig below the body; advance, CharacterBody3D.move, finish with observed accepted motion after physics, then existing IK",
|
|
692
|
+
"root motion excludes velocity-driven stride sync; unsupported parent transforms throw",
|
|
693
|
+
"source clips remain immutable; dispose at scene exit"
|
|
694
|
+
],
|
|
695
|
+
"example": "const animation = new AnimationComposer({ root: rig, clips, samples: [\"walk\", \"run\"] });\nanimation.setWeights([0.5, 0.5]); animation.update(dt);",
|
|
696
|
+
"importPath": "@threenative/core",
|
|
697
|
+
"kind": "class",
|
|
698
|
+
"overrides": [],
|
|
699
|
+
"package": "@threenative/core",
|
|
700
|
+
"signature": "export class AnimationComposer { … }",
|
|
701
|
+
"situations": [
|
|
702
|
+
"synchronize walk/run/strafe clips with different durations",
|
|
703
|
+
"reload with the upper body while locomotion continues",
|
|
704
|
+
"apply an additive recoil clip with an explicit reference pose",
|
|
705
|
+
"route root motion through collision-aware character movement"
|
|
706
|
+
],
|
|
707
|
+
"summary": "Compose game-authored locomotion and masked actions on one Three.js mixer.",
|
|
708
|
+
"supersedes": [],
|
|
709
|
+
"symbol": "AnimationComposer"
|
|
710
|
+
},
|
|
687
711
|
{
|
|
688
712
|
"aliases": [],
|
|
689
713
|
"constraints": [
|
|
@@ -712,7 +736,7 @@
|
|
|
712
736
|
"symbol": "AnimationPlayer"
|
|
713
737
|
},
|
|
714
738
|
{
|
|
715
|
-
"aliases": ["bright
|
|
739
|
+
"aliases": ["green platforms bright saturated sky"],
|
|
716
740
|
"constraints": [
|
|
717
741
|
"supply rayleigh, mie, ozone, planetRadius, and atmosphereRadius; there is no Earth fallback",
|
|
718
742
|
"the game creates the sky object, surface, and sun from the returned nodes"
|
|
@@ -794,7 +818,8 @@
|
|
|
794
818
|
"aliases": [],
|
|
795
819
|
"constraints": [
|
|
796
820
|
"create buses before playing clips and dispose them with the game",
|
|
797
|
-
"refDistance and rolloffFactor tune positional falloff and apply to playAt only"
|
|
821
|
+
"refDistance and rolloffFactor tune positional falloff and apply to playAt only",
|
|
822
|
+
"compressor takes threshold, knee, ratio, attack and release from the game and takes effect on the bus sum"
|
|
798
823
|
],
|
|
799
824
|
"example": "const effects = new AudioBus({ camera });",
|
|
800
825
|
"importPath": "@threenative/core",
|
|
@@ -806,6 +831,7 @@
|
|
|
806
831
|
"play a sound effect with a volume bus",
|
|
807
832
|
"mute or adjust a category of game audio",
|
|
808
833
|
"keep a gunshot audible at 20 metres by tuning positional falloff",
|
|
834
|
+
"hold a loud mix below clipping with a compressor on the bus",
|
|
809
835
|
"play cannon, wave, and ship sound effects"
|
|
810
836
|
],
|
|
811
837
|
"summary": "Route effects through a named audio bus.",
|
|
@@ -870,6 +896,46 @@
|
|
|
870
896
|
"supersedes": [],
|
|
871
897
|
"symbol": "Billboard3D"
|
|
872
898
|
},
|
|
899
|
+
{
|
|
900
|
+
"aliases": [],
|
|
901
|
+
"constraints": [
|
|
902
|
+
"duplicate samples, collinear triangles and invalid/incomplete triangulations throw at initialization",
|
|
903
|
+
"outside 2D queries project to the nearest boundary subedge; output is borrowed scratch"
|
|
904
|
+
],
|
|
905
|
+
"example": "const blend = new BlendSpace1D([0, 2]); animation.setWeights(blend.sample(speed));",
|
|
906
|
+
"importPath": "@threenative/core",
|
|
907
|
+
"kind": "class",
|
|
908
|
+
"overrides": [],
|
|
909
|
+
"package": "@threenative/core",
|
|
910
|
+
"signature": "export class BlendSpace1D { … }",
|
|
911
|
+
"situations": [
|
|
912
|
+
"calculate 1D walk/run blend weights from speed",
|
|
913
|
+
"calculate 2D locomotion weights from forward and strafe intent"
|
|
914
|
+
],
|
|
915
|
+
"summary": "Select finite, normalized locomotion weights from sorted thresholds or a fixed triangulation.",
|
|
916
|
+
"supersedes": [],
|
|
917
|
+
"symbol": "BlendSpace1D"
|
|
918
|
+
},
|
|
919
|
+
{
|
|
920
|
+
"aliases": [],
|
|
921
|
+
"constraints": [
|
|
922
|
+
"duplicate samples, collinear triangles and invalid/incomplete triangulations throw at initialization",
|
|
923
|
+
"outside 2D queries project to the nearest boundary subedge; output is borrowed scratch"
|
|
924
|
+
],
|
|
925
|
+
"example": "const blend = new BlendSpace1D([0, 2]); animation.setWeights(blend.sample(speed));",
|
|
926
|
+
"importPath": "@threenative/core",
|
|
927
|
+
"kind": "class",
|
|
928
|
+
"overrides": [],
|
|
929
|
+
"package": "@threenative/core",
|
|
930
|
+
"signature": "export class BlendSpace2D { … }",
|
|
931
|
+
"situations": [
|
|
932
|
+
"calculate 1D walk/run blend weights from speed",
|
|
933
|
+
"calculate 2D locomotion weights from forward and strafe intent"
|
|
934
|
+
],
|
|
935
|
+
"summary": "Select finite, normalized locomotion weights from sorted thresholds or a fixed triangulation.",
|
|
936
|
+
"supersedes": [],
|
|
937
|
+
"symbol": "BlendSpace2D"
|
|
938
|
+
},
|
|
873
939
|
{
|
|
874
940
|
"aliases": [],
|
|
875
941
|
"constraints": [
|
|
@@ -1157,7 +1223,7 @@
|
|
|
1157
1223
|
"symbol": "counterDeviceOf"
|
|
1158
1224
|
},
|
|
1159
1225
|
{
|
|
1160
|
-
"aliases": ["different props
|
|
1226
|
+
"aliases": ["different area props", "first playable screen external assets"],
|
|
1161
1227
|
"constraints": [
|
|
1162
1228
|
"reuse the loader handed to scenes as `ctx.assets` instead of building parallel caches"
|
|
1163
1229
|
],
|
|
@@ -1274,9 +1340,9 @@
|
|
|
1274
1340
|
},
|
|
1275
1341
|
{
|
|
1276
1342
|
"aliases": [
|
|
1277
|
-
"
|
|
1343
|
+
"nearest target crosshair spawns",
|
|
1278
1344
|
"third-person camera",
|
|
1279
|
-
"restart
|
|
1345
|
+
"restart run without page reload",
|
|
1280
1346
|
"field of view while aiming"
|
|
1281
1347
|
],
|
|
1282
1348
|
"constraints": [
|
|
@@ -1496,6 +1562,33 @@
|
|
|
1496
1562
|
"supersedes": [],
|
|
1497
1563
|
"symbol": "FluidField2D"
|
|
1498
1564
|
},
|
|
1565
|
+
{
|
|
1566
|
+
"aliases": [],
|
|
1567
|
+
"constraints": [
|
|
1568
|
+
"add the fluid through `ctx.add` so renderer attachment, fixed-step dispatch, and release are automatic",
|
|
1569
|
+
"a renderer without WebGPU compute throws a named error at attach; it never draws nothing",
|
|
1570
|
+
"`emit` recycles the oldest slot once `capacity` slots have been used; `fill` stops at capacity",
|
|
1571
|
+
"`sample` and `stats` read a throttled GPU copy and report `staleFrames`; they are never live"
|
|
1572
|
+
],
|
|
1573
|
+
"example": "const water = new FluidParticles3D({ capacity: 6000 });\nctx.add(water);\nwater.fill([-2.8, 0.1, -1.5], [-0.6, 3, 1.5]);",
|
|
1574
|
+
"importPath": "@threenative/core",
|
|
1575
|
+
"kind": "class",
|
|
1576
|
+
"overrides": [
|
|
1577
|
+
"iterations, viscosity, cohesion, vorticity, gravity and maxSpeed tune the solver without changing its pass order"
|
|
1578
|
+
],
|
|
1579
|
+
"package": "@threenative/core",
|
|
1580
|
+
"signature": "export class FluidParticles3D extends Group { … }",
|
|
1581
|
+
"situations": [
|
|
1582
|
+
"pour, splash, or dam-break water that fills a container and flows around obstacles",
|
|
1583
|
+
"simulate water or another liquid as particles in a fluid simulation",
|
|
1584
|
+
"drop a ball or box into liquid and let it displace and float on the water",
|
|
1585
|
+
"emit a stream or waterfall of particle fluid and drain it somewhere else",
|
|
1586
|
+
"sample particle-fluid density or surface height in a game-owned render node"
|
|
1587
|
+
],
|
|
1588
|
+
"summary": "Simulate liquid as GPU particles (pour, splash, dam break, waterfall) and expose positions, a density volume and a surface height while the game owns every look.",
|
|
1589
|
+
"supersedes": [],
|
|
1590
|
+
"symbol": "FluidParticles3D"
|
|
1591
|
+
},
|
|
1499
1592
|
{
|
|
1500
1593
|
"aliases": [],
|
|
1501
1594
|
"constraints": [
|
|
@@ -1539,6 +1632,28 @@
|
|
|
1539
1632
|
"supersedes": [],
|
|
1540
1633
|
"symbol": "formatSpansWindow"
|
|
1541
1634
|
},
|
|
1635
|
+
{
|
|
1636
|
+
"aliases": [],
|
|
1637
|
+
"constraints": [
|
|
1638
|
+
"derived from the scene graph, not from a constant: cutout PBR with no environment in the scene and none on the material",
|
|
1639
|
+
"it changes nothing and never throws — the environment is appearance, so setting it stays the game's decision"
|
|
1640
|
+
],
|
|
1641
|
+
"example": "defineGame({ scenes: { Forest } }); // one TN_UNLIT_FOLIAGE line when the forest has no sky",
|
|
1642
|
+
"importPath": "@threenative/core",
|
|
1643
|
+
"kind": "function",
|
|
1644
|
+
"overrides": [
|
|
1645
|
+
"`material.userData.tnUnlitOk = true` on a material a game deliberately renders unlit (the same `userData.tn*` naming the alpha and impostor conventions use)"
|
|
1646
|
+
],
|
|
1647
|
+
"package": "@threenative/core",
|
|
1648
|
+
"signature": "export function formatUnlitFoliageWarning(warning: IUnlitFoliageWarning): string { … }",
|
|
1649
|
+
"situations": [
|
|
1650
|
+
"catch the \"why does my forest look like cardboard\" question before a human plays it",
|
|
1651
|
+
"audit a scene a game built from imported GLB foliage"
|
|
1652
|
+
],
|
|
1653
|
+
"summary": "Tell the agent that built the scene that its imported foliage is drawing with no image-based light: an alpha-cutout `MeshStandardMaterial` (or its Node twin) with `scene.environment` unset and no `envMap` of its own gets a hemisphere fill and one flat dark value, which is cardboard. Printed once per scene entry as `TN_UNLIT_FOLIAGE`, after `enter()`, with the fix in the same line.",
|
|
1654
|
+
"supersedes": [],
|
|
1655
|
+
"symbol": "formatUnlitFoliageWarning"
|
|
1656
|
+
},
|
|
1542
1657
|
{
|
|
1543
1658
|
"aliases": [],
|
|
1544
1659
|
"constraints": [
|
|
@@ -1565,7 +1680,10 @@
|
|
|
1565
1680
|
"constraints": [
|
|
1566
1681
|
"on by default and printed as TN_FRAME_BUDGET; defineGame({ frameBudget: false }) silences the marker, not the measurement",
|
|
1567
1682
|
"per-pass numbers are attributed to the innermost active render call, so nested shadow and reflection passes do not read as main",
|
|
1568
|
-
"GPU is a mean/p50/p95/max series over resolved frames (`gpu`) with `gpuStale` counting frames that had no fresh reading; absent means no timestamps, never zero"
|
|
1683
|
+
"GPU is a mean/p50/p95/max series over resolved frames (`gpu`) with `gpuStale` counting frames that had no fresh reading; absent means no timestamps, never zero",
|
|
1684
|
+
"`ctx.renderer.observeGpuFrames({ maxFrames, maxQueries })` is opt-in, bounded and fail-closed; `take()` delivers immutable complete render-query groups once, while `status()` reports pending/undrained/queued membership and losses",
|
|
1685
|
+
"observation preserves ordinary sampling; a complete benchmark explicitly requests `renderer.gpuTimestampFrameInterval: 1` and joins Three query IDs to actual world renders, including separate overlay IDs",
|
|
1686
|
+
"`stop()` fences allocated frames and drains existing resolver work; `dispose()` invalidates late completions, and a failed observation must be disposed before replacement"
|
|
1569
1687
|
],
|
|
1570
1688
|
"example": "defineGame({ frameBudget: { reportEvery: 120 }, scenes: { Play } });",
|
|
1571
1689
|
"importPath": "@threenative/core",
|
|
@@ -1579,7 +1697,8 @@
|
|
|
1579
1697
|
"attribute a frame to present wait, simulation, three.js render, or overlay",
|
|
1580
1698
|
"tell whether the GPU is the frame's constraint from a per-frame series, not one lagged timestamp",
|
|
1581
1699
|
"split a frame's draw calls and triangles per render pass (main, shadow, reflection)",
|
|
1582
|
-
"tell a shadow or reflection pass's cost from the main colour pass"
|
|
1700
|
+
"tell a shadow or reflection pass's cost from the main colour pass",
|
|
1701
|
+
"retain every asynchronous GPU render frame for a complete paired benchmark"
|
|
1583
1702
|
],
|
|
1584
1703
|
"summary": "Read where the frame's milliseconds went, per presented frame, on any platform; each `TN_FRAME_BUDGET` window also carries the GPU time per resolved frame and the draw calls and triangles each render pass submitted.",
|
|
1585
1704
|
"supersedes": [],
|
|
@@ -1650,11 +1769,24 @@
|
|
|
1650
1769
|
},
|
|
1651
1770
|
{
|
|
1652
1771
|
"aliases": [],
|
|
1653
|
-
"constraints": [
|
|
1654
|
-
|
|
1772
|
+
"constraints": [
|
|
1773
|
+
"geometry, color, and timing remain supplied by the game",
|
|
1774
|
+
"a `spawn` kernel makes bursts requests: `emitParticle({ count, origin })` reserves ring slots, the engine stamps `buffers.births` and `process` reads age as `runtime.time - births[i]`; there is no readback",
|
|
1775
|
+
"a spawn emitter is world space (identity world matrix); `localCoords: true` follows the parent",
|
|
1776
|
+
"requests over `amount` or `maxSpawnPerFrame` clamp, add to `stats.clamped` and warn once; `stats.recycledLive` is `undefined` without the `lifetime` option",
|
|
1777
|
+
"the emitter measures its own bounds and stops computing and drawing after graceSeconds outside the camera view",
|
|
1778
|
+
"a game needs no emitting = visible gate, and an emitter with no measured bounds is never culled for leaving the view",
|
|
1779
|
+
"when measured GPU cost passes the frame budget, the smallest projected emitters pause first, and cull.reason reads outside-view or over-budget"
|
|
1780
|
+
],
|
|
1781
|
+
"example": "const particles = new GPUParticles3D(particleOptions);\nparticles.emitParticle({ count: 220, origin: hit.position });",
|
|
1655
1782
|
"importPath": "@threenative/core",
|
|
1656
1783
|
"kind": "class",
|
|
1657
|
-
"overrides": [
|
|
1784
|
+
"overrides": [
|
|
1785
|
+
"localCoords, maxSpawnPerFrame and lifetime tune a spawn emitter; `restart()` kills every particle and rewinds the ring",
|
|
1786
|
+
"onCull: \"clear\" restarts a returning effect, the default \"pause\" resumes it with buffers intact",
|
|
1787
|
+
"bounds supplies a fixed local Box3 and skips GPU measurement, padding enlarges the world box, boundsEveryFrames sets the measurement cadence",
|
|
1788
|
+
"graceSeconds sets the seconds outside the view before culling, and Infinity disables view culling"
|
|
1789
|
+
],
|
|
1658
1790
|
"package": "@threenative/core",
|
|
1659
1791
|
"signature": "export class GPUParticles3D extends Sprite implements IComputeDriven { … }",
|
|
1660
1792
|
"situations": [
|
|
@@ -1662,7 +1794,13 @@
|
|
|
1662
1794
|
"update many small visual particles",
|
|
1663
1795
|
"trail dust, exhaust, or spray behind a moving object",
|
|
1664
1796
|
"emit cannon smoke and muzzle flash particles",
|
|
1665
|
-
"fire a cannonball projectile with cannon smoke particles"
|
|
1797
|
+
"fire a cannonball projectile with cannon smoke particles",
|
|
1798
|
+
"splash spray droplets with lifetime and gravity",
|
|
1799
|
+
"spawn water droplets, mist, or foam bubbles above a fluid surface",
|
|
1800
|
+
"falling snowflakes, rain or ash around the player that thicken into a windy storm or blizzard",
|
|
1801
|
+
"kick up a spray of powder snow or dust where a foot or a ball lands",
|
|
1802
|
+
"a hit, impact or explosion burst that starts at the point and moment it is asked for, and a second hit that must not move the first hit's live particles",
|
|
1803
|
+
"emitParticle a burst of GPU particles at a world position with its own free slots"
|
|
1666
1804
|
],
|
|
1667
1805
|
"summary": "Dispatch a game-owned particle surface and process function through a pooled system.",
|
|
1668
1806
|
"supersedes": [],
|
|
@@ -1779,12 +1917,15 @@
|
|
|
1779
1917
|
"constraints": [
|
|
1780
1918
|
"geometry and material are required and come from the game; the batch chooses neither",
|
|
1781
1919
|
"span stretches along +Y, so its geometry must be unit-height and centred on the origin",
|
|
1782
|
-
"placing after build() throws, and build() returns undefined when nothing was placed"
|
|
1920
|
+
"placing after build() throws, and build() returns undefined when nothing was placed",
|
|
1921
|
+
"baked AutoLOD chains survive geometry clone/transform preparation and partition instances automatically into spatially bounded draws in the engine frame loop at 4 px projected error; public instance slots remain stable",
|
|
1922
|
+
"unavailable authored levels report TN_INSTANCED_LOD_FAILED once naming the batch; a million-triangle batch with no chain reports TN_INSTANCED_LOD_UNAVAILABLE"
|
|
1783
1923
|
],
|
|
1784
1924
|
"example": "const curbs = new InstancedBatch({ geometry: new BoxGeometry(1, 1, 1), material });\ncurbs.place({ position: [x, 0.08, z], rotation: [0, angle, 0], scale: [length, 0.18, 0.42] });\ncurbs.build({ castShadow: true, name: \"curbs\", parent: ctx.scene });",
|
|
1785
1925
|
"importPath": "@threenative/core",
|
|
1786
1926
|
"kind": "class",
|
|
1787
1927
|
"overrides": [
|
|
1928
|
+
"autoLod: false leaves selection to the game; autoLod.maxPixelError and hysteresis override the measured-camera budget; lods supplies authored distance/geometry levels and wins over the baked chain",
|
|
1788
1929
|
"castShadow and receiveShadow pass through to the built mesh and default to Three.js's own false"
|
|
1789
1930
|
],
|
|
1790
1931
|
"package": "@threenative/core",
|
|
@@ -1792,6 +1933,7 @@
|
|
|
1792
1933
|
"situations": [
|
|
1793
1934
|
"draw hundreds of repeated props without hundreds of draw calls",
|
|
1794
1935
|
"draw thousands of identical instanced blocks or obstacles in one mesh",
|
|
1936
|
+
"automatically select instanced prop detail from projected screen error using baked AutoLOD chains",
|
|
1795
1937
|
"place repeated props when the count is not known until the layout has been walked",
|
|
1796
1938
|
"build a chain, railing, cable, or tie rod out of point-to-point segments"
|
|
1797
1939
|
],
|
|
@@ -2484,6 +2626,26 @@
|
|
|
2484
2626
|
"supersedes": [],
|
|
2485
2627
|
"symbol": "RenderListValidator"
|
|
2486
2628
|
},
|
|
2629
|
+
{
|
|
2630
|
+
"aliases": [],
|
|
2631
|
+
"constraints": [
|
|
2632
|
+
"structural scene reads only, one visible-tree walk per entry, at most five material examples",
|
|
2633
|
+
"the audit itself changes no scene state; the game loop's opacity convention is the only writer"
|
|
2634
|
+
],
|
|
2635
|
+
"example": "renderTrapAudit(ctx.scene); // marker lines with the fixes, or an empty array",
|
|
2636
|
+
"importPath": "@threenative/core",
|
|
2637
|
+
"kind": "function",
|
|
2638
|
+
"overrides": [],
|
|
2639
|
+
"package": "@threenative/core",
|
|
2640
|
+
"signature": "export function renderTrapAudit(scene: Object3D & { … }",
|
|
2641
|
+
"situations": [
|
|
2642
|
+
"audit an equirectangular sky too narrow for three's WebGPU PMREM",
|
|
2643
|
+
"find visible opaque materials whose authored opacity is ignored"
|
|
2644
|
+
],
|
|
2645
|
+
"summary": "Catch scene state that silently loses environment fill or ignores authored opacity. After `enter()` the game first applies the opacity convention: a drawn material with `opacity < 1` turns transparent and one `TN_OPACITY_TRANSPARENT` console warning names it (override: `alphaHash: true`, or `opacity: 1`). It then prints `TN_ENVIRONMENT_TOO_SMALL` as a console error with the fix, so playtest `noConsoleErrors` rejects it.",
|
|
2646
|
+
"supersedes": [],
|
|
2647
|
+
"symbol": "renderTrapAudit"
|
|
2648
|
+
},
|
|
2487
2649
|
{
|
|
2488
2650
|
"aliases": ["fixed seed fixed-step simulation"],
|
|
2489
2651
|
"constraints": [
|
|
@@ -2686,7 +2848,8 @@
|
|
|
2686
2848
|
"situations": [
|
|
2687
2849
|
"delay an enemy patrol transition",
|
|
2688
2850
|
"run a callback every simulation tick",
|
|
2689
|
-
"tween a numeric property with a game-owned curve"
|
|
2851
|
+
"tween a numeric property with a game-owned curve",
|
|
2852
|
+
"a countdown timer: end the level when its time limit runs out"
|
|
2690
2853
|
],
|
|
2691
2854
|
"summary": "Schedule delayed and repeating callbacks or tween numeric properties with game-owned cleanup.",
|
|
2692
2855
|
"supersedes": [],
|
|
@@ -3042,12 +3205,35 @@
|
|
|
3042
3205
|
"signature": "export class TracerPool3D { … }",
|
|
3043
3206
|
"situations": [
|
|
3044
3207
|
"show where a hitscan round went",
|
|
3208
|
+
"show each round a weapon fires, one tracer per trigger press",
|
|
3045
3209
|
"draw incoming fire without spawning projectiles"
|
|
3046
3210
|
],
|
|
3047
3211
|
"summary": "Pool travelling bullet-streak meshes for hitscan shots.",
|
|
3048
3212
|
"supersedes": [],
|
|
3049
3213
|
"symbol": "TracerPool3D"
|
|
3050
3214
|
},
|
|
3215
|
+
{
|
|
3216
|
+
"aliases": [],
|
|
3217
|
+
"constraints": [
|
|
3218
|
+
"derived from the scene graph, not from a constant: cutout PBR with no environment in the scene and none on the material",
|
|
3219
|
+
"it changes nothing and never throws — the environment is appearance, so setting it stays the game's decision"
|
|
3220
|
+
],
|
|
3221
|
+
"example": "defineGame({ scenes: { Forest } }); // one TN_UNLIT_FOLIAGE line when the forest has no sky",
|
|
3222
|
+
"importPath": "@threenative/core",
|
|
3223
|
+
"kind": "function",
|
|
3224
|
+
"overrides": [
|
|
3225
|
+
"`material.userData.tnUnlitOk = true` on a material a game deliberately renders unlit (the same `userData.tn*` naming the alpha and impostor conventions use)"
|
|
3226
|
+
],
|
|
3227
|
+
"package": "@threenative/core",
|
|
3228
|
+
"signature": "export function unlitFoliageWarning( scene: Object3D & { … }",
|
|
3229
|
+
"situations": [
|
|
3230
|
+
"catch the \"why does my forest look like cardboard\" question before a human plays it",
|
|
3231
|
+
"audit a scene a game built from imported GLB foliage"
|
|
3232
|
+
],
|
|
3233
|
+
"summary": "Tell the agent that built the scene that its imported foliage is drawing with no image-based light: an alpha-cutout `MeshStandardMaterial` (or its Node twin) with `scene.environment` unset and no `envMap` of its own gets a hemisphere fill and one flat dark value, which is cardboard. Printed once per scene entry as `TN_UNLIT_FOLIAGE`, after `enter()`, with the fix in the same line.",
|
|
3234
|
+
"supersedes": [],
|
|
3235
|
+
"symbol": "unlitFoliageWarning"
|
|
3236
|
+
},
|
|
3051
3237
|
{
|
|
3052
3238
|
"aliases": [],
|
|
3053
3239
|
"constraints": [
|
|
@@ -3191,7 +3377,8 @@
|
|
|
3191
3377
|
"constraints": [
|
|
3192
3378
|
"the light must be a DirectionalLight with `castShadow` and a target in the scene",
|
|
3193
3379
|
"clipExtents are half-widths in world units, finest first, strictly increasing",
|
|
3194
|
-
"
|
|
3380
|
+
"movers sort themselves: a layer-0 caster whose world matrix, instance matrix or deformation changed draws through the mover maps and leaves the cached levels, and returns to them after `staticAfterFrames` quiet frames; the cache redraws only the region it left",
|
|
3381
|
+
"`trackCaster(object)` is the override that pins an object as a mover for good (it enables layer `VIRTUAL_SHADOW_MOVER_LAYER` on the object and its descendants), and `pinStatic(object)` opts an object out of detection; tracking or untracking refreshes only that object's region",
|
|
3195
3382
|
"call `object.layers.set(VIRTUAL_SHADOW_CASTER_LAYER)` for a mesh that exists only to cast; the level cameras already render that layer and the main camera never does"
|
|
3196
3383
|
],
|
|
3197
3384
|
"example": "const sun = new DirectionalLight(0xffffff, 3);\nsun.castShadow = true;\nsun.shadow.shadowNode = new VirtualShadowNode(sun, { clipExtents: [12, 40, 120] });",
|
|
@@ -3199,7 +3386,8 @@
|
|
|
3199
3386
|
"kind": "class",
|
|
3200
3387
|
"overrides": [
|
|
3201
3388
|
"bias, biasNode, normalBias, intensity, radius, blurSamples, mapType and filterNode stay on `light.shadow`; mapSize and the other options here have defaults, and `marker: false` silences the TN_VIRTUAL_SHADOW line, not the measurement",
|
|
3202
|
-
"bias, biasNode, normalBias, intensity, radius, blurSamples, mapType and filterNode stay on `light.shadow`; mapSize and the other options here have defaults"
|
|
3389
|
+
"bias, biasNode, normalBias, intensity, radius, blurSamples, mapType and filterNode stay on `light.shadow`; mapSize and the other options here have defaults",
|
|
3390
|
+
"followViewFocus: false keeps eye follow; receiverPlaneBias: false uses only authored bias"
|
|
3203
3391
|
],
|
|
3204
3392
|
"package": "@threenative/core",
|
|
3205
3393
|
"signature": "export class VirtualShadowNode extends ShadowBaseNode { … }",
|
|
@@ -3237,14 +3425,16 @@
|
|
|
3237
3425
|
"the material must be transparent so the frame beneath it is already drawn",
|
|
3238
3426
|
"thickness is metres, saturating at maxThickness; sky behind the surface reads deep",
|
|
3239
3427
|
"one reflection is a second draw of the world; resolutionScale is its pixels only",
|
|
3240
|
-
"
|
|
3428
|
+
"omitted reflection.layers automatically reflects terrain-sized surfaces and large non-instanced casters, excluding instanced/skinned props; TN_WATER_REFLECTION_DEFAULT reports the set once",
|
|
3241
3429
|
"reflection.refreshInterval is in presented frames; 1 is every frame, and the default",
|
|
3242
3430
|
"the mirror plane is level, from level alone; do not parent target to a scaled mesh"
|
|
3243
3431
|
],
|
|
3244
|
-
"example": "const
|
|
3432
|
+
"example": "const surface = new WaterSurface3D({ level: 0, maxThickness: 3, reflection: { resolutionScale: 0.5 } });\nmaterial.colorNode = mix(surface.refractionAt(offset), surface.reflectionAt(offset), fresnel);",
|
|
3245
3433
|
"importPath": "@threenative/core",
|
|
3246
3434
|
"kind": "class",
|
|
3247
|
-
"overrides": [
|
|
3435
|
+
"overrides": [
|
|
3436
|
+
"reflection.layers is an explicit Three Layers mask and wins over automatic filtering, including layer-0 mask 1; reflection.minSize overrides the default 10 metre minimum extent"
|
|
3437
|
+
],
|
|
3248
3438
|
"package": "@threenative/core",
|
|
3249
3439
|
"signature": "export class WaterSurface3D { … }",
|
|
3250
3440
|
"situations": [
|
|
@@ -3253,7 +3443,8 @@
|
|
|
3253
3443
|
"know how deep the water is under a pixel without a second render pass",
|
|
3254
3444
|
"stop a water surface repeating in visible bands or stripes",
|
|
3255
3445
|
"keep a crowd of small actors out of the water's reflection so the frame can afford it",
|
|
3256
|
-
"stop the water reflection redrawing the whole world every frame"
|
|
3446
|
+
"stop the water reflection redrawing the whole world every frame",
|
|
3447
|
+
"automatically reflect terrain and large casters without redrawing instanced small props"
|
|
3257
3448
|
],
|
|
3258
3449
|
"summary": "Give a horizontal water surface the world mirrored in it, the world beneath it, and the metres of water between them.",
|
|
3259
3450
|
"supersedes": [],
|
|
@@ -3393,6 +3584,27 @@
|
|
|
3393
3584
|
"supersedes": [],
|
|
3394
3585
|
"symbol": "playtest"
|
|
3395
3586
|
},
|
|
3587
|
+
{
|
|
3588
|
+
"aliases": [],
|
|
3589
|
+
"constraints": [
|
|
3590
|
+
"desktop only, and the game host must be built with the CSS backend (`TN_ENABLE_CSS_UI=1`); Android, iOS and web phones render a React HUD in a web overlay instead",
|
|
3591
|
+
"import `react`, never `react-dom`, from a native entry",
|
|
3592
|
+
"styling is CSS resolved by the native engine; JS only mirrors the element tree"
|
|
3593
|
+
],
|
|
3594
|
+
"example": "const root = createCssUiRoot();\nroot.render(createElement(\"section\", { className: \"fixed inset-0 bg-zinc-900/90\" }, \"READY\"));",
|
|
3595
|
+
"importPath": "@threenative/core/react-css",
|
|
3596
|
+
"kind": "function",
|
|
3597
|
+
"overrides": [],
|
|
3598
|
+
"package": "@threenative/core",
|
|
3599
|
+
"signature": "export function createCssUiRoot(options: ICssUiRootOptions = { … }",
|
|
3600
|
+
"situations": [
|
|
3601
|
+
"mount a React HUD on the desktop host with no DOM in the runtime",
|
|
3602
|
+
"write one React component and run it on the web and on the desktop host"
|
|
3603
|
+
],
|
|
3604
|
+
"summary": "Mount React into a native CSS engine.",
|
|
3605
|
+
"supersedes": [],
|
|
3606
|
+
"symbol": "createCssUiRoot"
|
|
3607
|
+
},
|
|
3396
3608
|
{
|
|
3397
3609
|
"aliases": [],
|
|
3398
3610
|
"constraints": [
|
|
@@ -3658,7 +3870,8 @@
|
|
|
3658
3870
|
"generate a terrain a player can walk across",
|
|
3659
3871
|
"query the same ground height or normal that a player sees and collides with",
|
|
3660
3872
|
"ask how high the ground is here",
|
|
3661
|
-
"build islands and coastlines from terrain"
|
|
3873
|
+
"build islands and coastlines from terrain",
|
|
3874
|
+
"keep a collider or other copy of a deforming terrain in step without rescanning the whole field (`trackChanges`)"
|
|
3662
3875
|
],
|
|
3663
3876
|
"summary": "One height buffer shared by world queries, rendered geometry, and a physics heightfield. The game supplies every value, so changing the terrain's shape never requires a package edit. `fromSampler` evaluates that game function exactly once at each vertex and retains only the resulting numbers. Queries interpolate those same numbers instead of evaluating the function again.",
|
|
3664
3877
|
"supersedes": [],
|
|
@@ -3686,10 +3899,10 @@
|
|
|
3686
3899
|
{
|
|
3687
3900
|
"aliases": [],
|
|
3688
3901
|
"constraints": [
|
|
3689
|
-
"the package's world.json must carry `terrain.layers.table` and `terrain.layers.splat`, written by the `
|
|
3690
|
-
"WebGPU allows 16 sampled textures per stage:
|
|
3902
|
+
"the package's world.json must carry `terrain.layers.table` and `terrain.layers.splat`, written by `export_terrain_layers` in the `export_world.py` recipe",
|
|
3903
|
+
"WebGPU allows 16 sampled textures per stage: same-size layers stack into one array texture per set, and `TN_TERRAIN_SPLAT samplers=<n>` reports what is left"
|
|
3691
3904
|
],
|
|
3692
|
-
"example": "const surface = await loadTerrainSplat({ assets: ctx.assets, url: \"world/world.json\" });\nconst world = await WorldCells.load({ assets: ctx.assets, url: \"world/world.json\", surface, follow, ring: 2 });",
|
|
3905
|
+
"example": "const surface = await loadTerrainSplat({ assets: ctx.assets, renderer: ctx.renderer, url: \"world/world.json\" });\nconst world = await WorldCells.load({ assets: ctx.assets, url: \"world/world.json\", surface, follow, ring: 2 });",
|
|
3693
3906
|
"importPath": "@threenative/core/world",
|
|
3694
3907
|
"kind": "function",
|
|
3695
3908
|
"overrides": [
|
|
@@ -3701,7 +3914,7 @@
|
|
|
3701
3914
|
"terrain textured by splat masks exported from Blender with the world package",
|
|
3702
3915
|
"the game's terrain should match the DCC's terrain material without a second copy"
|
|
3703
3916
|
],
|
|
3704
|
-
"summary": "The splat terrain surface a world package describes, for `WorldCells.load({ surface })`. Layers blend over a base by mask channels read as linear data (the masks ship raw, beside the heightmap, so no cook moves a blend threshold), with noise-broken edges and macro brightness variation. Texture sets tile in world metres on the package's ground plane (x, -z: a Z-up authoring tool's x and y), cliffs can be triplanar, and the base plus any layer that asks carries a normal map. Nothing here is a look choice: textures, tiles, tints, thresholds and noise scales all come from the package's table, which the game authors once and its DCC shares.",
|
|
3917
|
+
"summary": "The splat terrain surface a world package describes, for `WorldCells.load({ surface })`. Layers blend over a base by mask channels read as linear data (the masks ship raw, beside the heightmap, so no cook moves a blend threshold), with noise-broken edges and macro brightness variation. Texture sets tile in world metres on the package's ground plane (x, -z: a Z-up authoring tool's x and y), cliffs can be triplanar, and the base plus any layer that asks carries a normal map. Each layer answers light from its own ORM map where the table ships one and from the table's own roughness and metalness where it does not; a layer that states neither is matte and dielectric, and named in a warning. Nothing here is a look choice: textures, tiles, tints, thresholds, surface response and noise scales all come from the package's table, which the game authors once and its DCC shares.",
|
|
3705
3918
|
"supersedes": [],
|
|
3706
3919
|
"symbol": "loadTerrainSplat"
|
|
3707
3920
|
},
|
|
@@ -3719,6 +3932,50 @@
|
|
|
3719
3932
|
"supersedes": [],
|
|
3720
3933
|
"symbol": "loadWorldHeightmap"
|
|
3721
3934
|
},
|
|
3935
|
+
{
|
|
3936
|
+
"aliases": [],
|
|
3937
|
+
"constraints": ["radius is metres; the footprint never grows with load, only deeper"],
|
|
3938
|
+
"example": "const footprint = snowDiscFootprint(0.25);",
|
|
3939
|
+
"importPath": "@threenative/core/world",
|
|
3940
|
+
"kind": "function",
|
|
3941
|
+
"overrides": ["softness widens the eased edge without changing the contact radius"],
|
|
3942
|
+
"package": "@threenative/core",
|
|
3943
|
+
"signature": "export function snowDiscFootprint( radius: number, options: ISnowDiscFootprintOptions = { … }",
|
|
3944
|
+
"situations": [
|
|
3945
|
+
"press a ball, wheel or probe into snow",
|
|
3946
|
+
"give a sphere a physically sized snow contact instead of a boot shape"
|
|
3947
|
+
],
|
|
3948
|
+
"summary": "A circular contact footprint, sized from a radius the caller measures. The shape a sphere, a ball, a wheel or a probe presses into snow, and the default the physics binding derives from a sphere's contact geometry. Flat inside the radius, eased over the softness band, with a raised rim just outside it.",
|
|
3949
|
+
"supersedes": [],
|
|
3950
|
+
"symbol": "snowDiscFootprint"
|
|
3951
|
+
},
|
|
3952
|
+
{
|
|
3953
|
+
"aliases": [],
|
|
3954
|
+
"constraints": [
|
|
3955
|
+
"the field composes onto a Heightfield; construct the terrain first and let this own the surface",
|
|
3956
|
+
"zero depth is bare ground: contacts register no indentation at all",
|
|
3957
|
+
"out-of-region heightAt and normalAt follow Heightfield's error contract; sample returns zeros"
|
|
3958
|
+
],
|
|
3959
|
+
"example": "import { Heightfield } from \"@threenative/core/world\";\nconst terrain = Heightfield.fromSampler({ rows: 129, columns: 129, width: 64, depth: 64, origin: { x: 0, z: 0 }, sampleHeight: (x, z) => Math.sin(x * 0.1) * 0.5 });\nconst snow = new SnowField({ field: terrain, depth: 0.28, hardness: 0.3 });\nsnow.stamp({ x: 0, z: 0, area: 0.074, load: 784, duration: 0.1, footprint: snowDiscFootprint(0.12) });\nsnow.recover(1 / 60, 0.0012, 0.4);",
|
|
3960
|
+
"importPath": "@threenative/core/world",
|
|
3961
|
+
"kind": "class",
|
|
3962
|
+
"overrides": [
|
|
3963
|
+
"depth, hardness, yieldFraction, maxBank and responseTime name the response coefficients"
|
|
3964
|
+
],
|
|
3965
|
+
"package": "@threenative/core",
|
|
3966
|
+
"requires": ["@threenative/core/world Heightfield as the canonical terrain and surface"],
|
|
3967
|
+
"signature": "export class SnowField { … }",
|
|
3968
|
+
"situations": [
|
|
3969
|
+
"leave footprints, tracks and tyre ruts in snow that persist and fill in over time",
|
|
3970
|
+
"let a pushed sphere carve a connected track and a dropped one settle into a crater",
|
|
3971
|
+
"store snow deformation that rendered geometry and collision both read",
|
|
3972
|
+
"reset a snowfield between rounds or change its depth at runtime",
|
|
3973
|
+
"show how packed the snow is where people have walked or objects have rested"
|
|
3974
|
+
],
|
|
3975
|
+
"summary": "Persistent snow deformation over one canonical heightfield. Snow keeps four channels per cell — indentation, displaced bank, compaction and disturbance — and writes the combined surface (`terrain + depth + bank - indent`) back into the heightfield it was given. Queries, rendered geometry and collider export therefore all read one surface, and no second terrain representation exists. The field is numeric only: it never chooses a boot, a tread, a particle, a material or a camera. Games supply terrain heights, the snow depth, the contact profile and the response coefficients; this class owns the storage, the load-dependent penetration and the bounded recovery. It is a heightfield approximation — not granular snow, displaced-volume conservation, avalanches, melting or a calibrated material law.",
|
|
3976
|
+
"supersedes": [],
|
|
3977
|
+
"symbol": "SnowField"
|
|
3978
|
+
},
|
|
3722
3979
|
{
|
|
3723
3980
|
"aliases": ["stream terrain across chunks"],
|
|
3724
3981
|
"constraints": [
|
|
@@ -3730,7 +3987,7 @@
|
|
|
3730
3987
|
"importPath": "@threenative/core/world",
|
|
3731
3988
|
"kind": "class",
|
|
3732
3989
|
"overrides": [
|
|
3733
|
-
"tileSize, tileResolution, lodFactors, lodDistances, skirtDepth, streamRadius, colliderRadius, validate, and budgets"
|
|
3990
|
+
"tileSize, tileResolution, lodFactors, lodDistances, skirtDepth, streamRadius, colliderRadius, mergeTiles, validate, and budgets"
|
|
3734
3991
|
],
|
|
3735
3992
|
"package": "@threenative/core",
|
|
3736
3993
|
"signature": "export class TerrainTiles extends Object3D implements IComputeDriven { … }",
|
|
@@ -3788,7 +4045,8 @@
|
|
|
3788
4045
|
"refilters are bounded by `rebuildsPerUpdate` (default 16) per update, nearest cell first",
|
|
3789
4046
|
"admission is bounded by `admissionBudgetMs` (default 2) per update across every path, plus at most one unit each for terrain and props; while props are queued terrain takes at most half, so neither starves the other, and a deferred cell keeps drawing what it has",
|
|
3790
4047
|
"SkinnedMesh parts are skipped; an instanced copy would draw one rest pose",
|
|
3791
|
-
"a baked chain's switch distances are measured against `autoLod` (default 4 px of error over 60° and 1080 raster rows), because an instanced draw cannot select a level per instance; an asset with authored `lods` never consults it",
|
|
4048
|
+
"a baked chain's switch distances are measured against `autoLod` (default 4 px of error over 60° and 1080 raster rows), because an instanced draw cannot select a level per instance; an asset with nonempty authored `lods` never consults it; explicit empty lists enroll only unchanged static geometry/material parts",
|
|
4049
|
+
"eligible static sources can use cooked HLOD (chunk-only alongside GPU scatter, whole-cell on CPU) after compilation and an observed main-context backend submission; projected-error hysteresis requires actual source triangle reduction and no extra material draws, unsupported or shared source stays resident, and collision/shadow paths retain source representations; stats().hlod counts lifecycle and charged resources, not GPU timing or physical allocation",
|
|
3792
4050
|
"`prewarmed` resolves once every prewarmed shared batch has been drawn; a game with a loading screen waits on it, and `stats().pendingPrewarm` is the same gate as a number",
|
|
3793
4051
|
"every `asset:level:part` is one InstancedMesh for the main pass, plus one caster InstancedMesh per world-grid square of `clusterSize` on the shadow caster layer, so the main pass draws one mesh per key and a shadow level submits only the squares it covers",
|
|
3794
4052
|
"two definitions the asset loader resolves to one model — the same cooked `glb`, the same `lods` at the same distances, the same `maxDistance` and bounds — are one asset under the lexicographically smallest id: one model load, one set of `asset:level:part` keys, one prewarm and one refcount, released when the last cell holding any member of the group leaves the ring; `TN_WORLD_ASSET_ALIAS` reports how many of the package's assets are really distinct",
|
|
@@ -3800,7 +4058,7 @@
|
|
|
3800
4058
|
"importPath": "@threenative/core/world",
|
|
3801
4059
|
"kind": "class",
|
|
3802
4060
|
"overrides": [
|
|
3803
|
-
"ring, budgets, terrain tile size/resolution, terrain stream and collider radius, `transparentScatter`, `clusterSize` and `shadows.invalidate`, load `concurrency`, `rebuildsPerUpdate`, `admissionBudgetMs` and the package's per-asset maxDistance"
|
|
4061
|
+
"`hlod: false` keeps source rendering; ring, budgets, terrain tile size/resolution, terrain stream and collider radius, `transparentScatter`, `clusterSize` and `shadows.invalidate`, load `concurrency`, `rebuildsPerUpdate`, `admissionBudgetMs` and the package's per-asset maxDistance"
|
|
3804
4062
|
],
|
|
3805
4063
|
"package": "@threenative/core",
|
|
3806
4064
|
"signature": "export class WorldCells extends Group implements IComputeDriven { … }",
|
|
@@ -3809,7 +4067,7 @@
|
|
|
3809
4067
|
"keep scattered props and hand-placed chunks resident around a moving player",
|
|
3810
4068
|
"honour per-asset draw distances and hard streaming budgets without a mid-frame throw"
|
|
3811
4069
|
],
|
|
3812
|
-
"summary": "Stream a Blender-authored world package by cell and keep it resident around a followed point. The class composes `TerrainTiles` for the package's heightmap, builds one `InstancedBatch` per resident cell asset run, distance level and mesh part, and loads hand-placed chunk GLBs through `loadAll` + `addInSlices`. Ring residency, per-asset `maxDistance` filtering, the per-asset `lods` levels, hard budgets and generation-tokened cancellation all live here; every geometry, material and surface still comes from the package's GLBs and the game. An asset is drawn per part, not per model: a GLB with several primitives is one `InstancedBatch` each, and a scattered part whose own material is transparent draws as an alpha cutout unless the game asks for blending, because an `InstancedMesh` cannot sort its instances. An asset
|
|
4070
|
+
"summary": "Stream a Blender-authored world package by cell and keep it resident around a followed point. The class composes `TerrainTiles` for the package's heightmap, builds one `InstancedBatch` per resident cell asset run, distance level and mesh part, and loads hand-placed chunk GLBs through `loadAll` + `addInSlices`. Ring residency, CPU per-asset `maxDistance` filtering, GPU dispatch culling, the per-asset `lods` levels, hard budgets and generation-tokened cancellation all live here; every geometry, material and surface still comes from the package's GLBs and the game. An asset is drawn per part, not per model: a GLB with several primitives is one `InstancedBatch` each, and a scattered part whose own material is transparent draws as an alpha cutout unless the game asks for blending, because an `InstancedMesh` cannot sort its instances. An asset with no nonempty authored `lods` can draw its own model's baked AutoLOD chain at distances measured over the `autoLod` viewport. An explicit empty list enrolls only unchanged static parts; section ranges, custom attributes, alpha foliage and vertex deformation retain source geometry.",
|
|
3813
4071
|
"supersedes": [],
|
|
3814
4072
|
"symbol": "WorldCells"
|
|
3815
4073
|
},
|
|
@@ -3919,6 +4177,7 @@
|
|
|
3919
4177
|
"kind": "class",
|
|
3920
4178
|
"overrides": [],
|
|
3921
4179
|
"package": "@threenative/physics",
|
|
4180
|
+
"requires": ["npm i @threenative/physics"],
|
|
3922
4181
|
"signature": "export class Area3D { … }",
|
|
3923
4182
|
"situations": [
|
|
3924
4183
|
"detect when an enemy enters a trigger area",
|
|
@@ -3928,6 +4187,52 @@
|
|
|
3928
4187
|
"supersedes": [],
|
|
3929
4188
|
"symbol": "Area3D"
|
|
3930
4189
|
},
|
|
4190
|
+
{
|
|
4191
|
+
"aliases": [],
|
|
4192
|
+
"constraints": [
|
|
4193
|
+
"register `rapier()` before attaching, and call `step` once per fixed step after the physics step",
|
|
4194
|
+
"the backend must expose persistent solved contacts and in-place shape refresh; one that does not fails at attach",
|
|
4195
|
+
"verified on browser WebGPU and the native Linux desktop host; Android and iOS share the native seam but have not run it",
|
|
4196
|
+
"automatic profiles cover sphere, box and capsule; any other shape needs an explicit footprint"
|
|
4197
|
+
],
|
|
4198
|
+
"example": "const snowPhysics = attachSnowPhysics({ physics: ctx.physics, snow, bodies: [ball] });\nafterPhysics(ctx, (dt) => snowPhysics.step(dt));",
|
|
4199
|
+
"importPath": "@threenative/physics",
|
|
4200
|
+
"kind": "function",
|
|
4201
|
+
"overrides": [
|
|
4202
|
+
"loadScale, supportNormal, colliderTolerance, deposition, wind, collisionLayer and collisionMask name the binding's own behaviour"
|
|
4203
|
+
],
|
|
4204
|
+
"package": "@threenative/physics",
|
|
4205
|
+
"requires": ["@threenative/core/world SnowField as the surface it deforms"],
|
|
4206
|
+
"signature": "export function attachSnowPhysics(options: ISnowPhysicsOptions): ISnowPhysicsBinding { … }",
|
|
4207
|
+
"situations": [
|
|
4208
|
+
"leave footprints and tracks where physical bodies actually touch snow",
|
|
4209
|
+
"let a dropped or pushed sphere carve and settle into deformable snow",
|
|
4210
|
+
"make a crate, capsule or ball compress the surface it rests on"
|
|
4211
|
+
],
|
|
4212
|
+
"summary": "Drive a `SnowField` from real solved contacts. The binding creates the snow surface collider from the field's own canonical samples and keeps it in step with them, so a body lands on the surface a query would report. Each fixed step it reads the solver's persistent contacts — not collision start/stop events, which carry no point or load — deforms the snow only where a contact is supported and loaded downward, then republishes the surface before the next step. Airborne bodies, side contacts and unrelated colliders never deform anything. A dropped sphere settles on the surface it made; a pushed one rotates and carves a connected track without its transform being copied anywhere. Footprints come from the body's own collision shape and orientation unless the game supplies one. Contact load is `impulse / deltaTime * loadScale`: a solver impulse over a step, which estimates a contact force and is not measured. `observe().loadProvenance` says so.",
|
|
4213
|
+
"supersedes": [],
|
|
4214
|
+
"symbol": "attachSnowPhysics"
|
|
4215
|
+
},
|
|
4216
|
+
{
|
|
4217
|
+
"aliases": [],
|
|
4218
|
+
"constraints": [
|
|
4219
|
+
"halfWidth and halfDepth are metres; rotation comes from the contact, not the footprint"
|
|
4220
|
+
],
|
|
4221
|
+
"example": "const footprint = boxFootprint(0.4, 0.25);",
|
|
4222
|
+
"importPath": "@threenative/physics",
|
|
4223
|
+
"kind": "function",
|
|
4224
|
+
"overrides": [],
|
|
4225
|
+
"package": "@threenative/physics",
|
|
4226
|
+
"requires": ["npm i @threenative/physics"],
|
|
4227
|
+
"signature": "export function boxFootprint(halfWidth: number, halfDepth: number): ISnowFootprint { … }",
|
|
4228
|
+
"situations": [
|
|
4229
|
+
"let a crate, platform or plank press a rectangular pit into snow",
|
|
4230
|
+
"imprint a box's own footprint rather than a circle around it"
|
|
4231
|
+
],
|
|
4232
|
+
"summary": "A rectangular contact: the face a box rests on, in the contact's own frame. Coverage is full across the face and fades just outside it; the bank rises beyond that.",
|
|
4233
|
+
"supersedes": [],
|
|
4234
|
+
"symbol": "boxFootprint"
|
|
4235
|
+
},
|
|
3931
4236
|
{
|
|
3932
4237
|
"aliases": [],
|
|
3933
4238
|
"constraints": [
|
|
@@ -3939,6 +4244,7 @@
|
|
|
3939
4244
|
"kind": "function",
|
|
3940
4245
|
"overrides": [],
|
|
3941
4246
|
"package": "@threenative/physics",
|
|
4247
|
+
"requires": ["npm i @threenative/physics"],
|
|
3942
4248
|
"signature": "export function buildStaticColliders( context: IStaticColliderContext, root: Object3D, filter?: StaticColliderFilter, ): readonly RigidBody3D[] { … }",
|
|
3943
4249
|
"situations": [
|
|
3944
4250
|
"make the level I built stop the player",
|
|
@@ -3956,12 +4262,31 @@
|
|
|
3956
4262
|
"kind": "class",
|
|
3957
4263
|
"overrides": ["buoyancy disables force application while submergedFraction remains measured"],
|
|
3958
4264
|
"package": "@threenative/physics",
|
|
4265
|
+
"requires": ["npm i @threenative/physics"],
|
|
3959
4266
|
"signature": "export class Buoyancy3D { … }",
|
|
3960
4267
|
"situations": ["float a boat on waves", "keep a hull above a moving water surface"],
|
|
3961
4268
|
"summary": "Float a rigid body on a game-owned height source with fixed-step force ordering.",
|
|
3962
4269
|
"supersedes": [],
|
|
3963
4270
|
"symbol": "Buoyancy3D"
|
|
3964
4271
|
},
|
|
4272
|
+
{
|
|
4273
|
+
"aliases": [],
|
|
4274
|
+
"constraints": ["radius and halfHeight are metres and never grow with load"],
|
|
4275
|
+
"example": "const footprint = capsuleFootprint(0.5, 0.2);",
|
|
4276
|
+
"importPath": "@threenative/physics",
|
|
4277
|
+
"kind": "function",
|
|
4278
|
+
"overrides": [],
|
|
4279
|
+
"package": "@threenative/physics",
|
|
4280
|
+
"requires": ["npm i @threenative/physics"],
|
|
4281
|
+
"signature": "export function capsuleFootprint(halfHeight: number, radius: number): ISnowFootprint { … }",
|
|
4282
|
+
"situations": [
|
|
4283
|
+
"let a fallen capsule, limb or barrel leave a linear imprint in snow",
|
|
4284
|
+
"give a capsule a shape-appropriate snow contact instead of a sphere's dot"
|
|
4285
|
+
],
|
|
4286
|
+
"summary": "A stadium contact: a rectangle of half-length `halfHeight` and half-width `radius`, capped by two half-discs of `radius`. The shape a capsule lies on, so a knocked-over body sinks along a line instead of at a point. Coverage is full across the body's own width and fades just outside it, so the body's edge never rests on a half-pressed rim; the bank rises beyond that.",
|
|
4287
|
+
"supersedes": [],
|
|
4288
|
+
"symbol": "capsuleFootprint"
|
|
4289
|
+
},
|
|
3965
4290
|
{
|
|
3966
4291
|
"aliases": [
|
|
3967
4292
|
"raised platform gap hazard restart",
|
|
@@ -3979,6 +4304,7 @@
|
|
|
3979
4304
|
"kind": "class",
|
|
3980
4305
|
"overrides": [],
|
|
3981
4306
|
"package": "@threenative/physics",
|
|
4307
|
+
"requires": ["npm i @threenative/physics"],
|
|
3982
4308
|
"signature": "export class CharacterBody3D { … }",
|
|
3983
4309
|
"situations": [
|
|
3984
4310
|
"move an enemy or player through a level",
|
|
@@ -3996,6 +4322,7 @@
|
|
|
3996
4322
|
"kind": "class",
|
|
3997
4323
|
"overrides": [],
|
|
3998
4324
|
"package": "@threenative/physics",
|
|
4325
|
+
"requires": ["npm i @threenative/physics"],
|
|
3999
4326
|
"signature": "export class CollisionShape3D { … }",
|
|
4000
4327
|
"situations": [
|
|
4001
4328
|
"add a capsule or box collider to a character",
|
|
@@ -4013,6 +4340,7 @@
|
|
|
4013
4340
|
"kind": "function",
|
|
4014
4341
|
"overrides": [],
|
|
4015
4342
|
"package": "@threenative/physics",
|
|
4343
|
+
"requires": ["npm i @threenative/physics"],
|
|
4016
4344
|
"signature": "export function interactionGroups(layer: number, mask: number): number { … }",
|
|
4017
4345
|
"situations": [
|
|
4018
4346
|
"make an enemy collide with the world but not pickups",
|
|
@@ -4033,6 +4361,7 @@
|
|
|
4033
4361
|
"kind": "class",
|
|
4034
4362
|
"overrides": [],
|
|
4035
4363
|
"package": "@threenative/physics",
|
|
4364
|
+
"requires": ["npm i @threenative/physics"],
|
|
4036
4365
|
"signature": "export class Joint3D { … }",
|
|
4037
4366
|
"situations": [
|
|
4038
4367
|
"constrain a rigid body to another body",
|
|
@@ -4051,6 +4380,7 @@
|
|
|
4051
4380
|
"kind": "class",
|
|
4052
4381
|
"overrides": [],
|
|
4053
4382
|
"package": "@threenative/physics",
|
|
4383
|
+
"requires": ["npm i @threenative/physics"],
|
|
4054
4384
|
"signature": "export class PhysicsDirectSpaceState3D { … }",
|
|
4055
4385
|
"situations": [
|
|
4056
4386
|
"raycast for visibility or aiming",
|
|
@@ -4068,6 +4398,7 @@
|
|
|
4068
4398
|
"kind": "function",
|
|
4069
4399
|
"overrides": [],
|
|
4070
4400
|
"package": "@threenative/physics",
|
|
4401
|
+
"requires": ["npm i @threenative/physics"],
|
|
4071
4402
|
"signature": "export function rapier(options: IPhysicsOptions = { … }",
|
|
4072
4403
|
"situations": [
|
|
4073
4404
|
"add physics to a portable game",
|
|
@@ -4090,6 +4421,7 @@
|
|
|
4090
4421
|
"continuousCollision: false opts one body out while body.continuousCollision still reports the effective setting"
|
|
4091
4422
|
],
|
|
4092
4423
|
"package": "@threenative/physics",
|
|
4424
|
+
"requires": ["npm i @threenative/physics"],
|
|
4093
4425
|
"signature": "export class RigidBody3D { … }",
|
|
4094
4426
|
"situations": [
|
|
4095
4427
|
"give a crate or prop physical motion",
|
|
@@ -4113,6 +4445,7 @@
|
|
|
4113
4445
|
"kind": "function",
|
|
4114
4446
|
"overrides": [],
|
|
4115
4447
|
"package": "@threenative/physics",
|
|
4448
|
+
"requires": ["npm i @threenative/physics"],
|
|
4116
4449
|
"signature": "export function softBodyCollision(...bodies: readonly RigidBody3D[]): ISoftBodyCollision { … }",
|
|
4117
4450
|
"situations": [
|
|
4118
4451
|
"stop a cloth flag, cape, or curtain at an existing physics wall",
|
|
@@ -4141,6 +4474,7 @@
|
|
|
4141
4474
|
"continuousCollision is on for the chassis, so a fast car cannot tunnel through a wall"
|
|
4142
4475
|
],
|
|
4143
4476
|
"package": "@threenative/physics",
|
|
4477
|
+
"requires": ["npm i @threenative/physics"],
|
|
4144
4478
|
"signature": "export class VehicleBody3D extends RigidBody3D { … }",
|
|
4145
4479
|
"situations": [
|
|
4146
4480
|
"drive a car, truck or bike around a track",
|
|
@@ -4160,6 +4494,7 @@
|
|
|
4160
4494
|
"kind": "class",
|
|
4161
4495
|
"overrides": [],
|
|
4162
4496
|
"package": "@threenative/physics",
|
|
4497
|
+
"requires": ["npm i @threenative/physics"],
|
|
4163
4498
|
"signature": "export class NavigationAgent3D { … }",
|
|
4164
4499
|
"situations": [
|
|
4165
4500
|
"enemy walks around a wall",
|
|
@@ -4182,6 +4517,7 @@
|
|
|
4182
4517
|
"kind": "class",
|
|
4183
4518
|
"overrides": [],
|
|
4184
4519
|
"package": "@threenative/physics",
|
|
4520
|
+
"requires": ["npm i @threenative/physics"],
|
|
4185
4521
|
"signature": "export class NavigationObstacle3D { … }",
|
|
4186
4522
|
"situations": [
|
|
4187
4523
|
"keep navigation agents away from a blocking prop",
|
|
@@ -4199,6 +4535,7 @@
|
|
|
4199
4535
|
"kind": "class",
|
|
4200
4536
|
"overrides": [],
|
|
4201
4537
|
"package": "@threenative/physics",
|
|
4538
|
+
"requires": ["npm i @threenative/physics"],
|
|
4202
4539
|
"signature": "export class NavigationRegion3D { … }",
|
|
4203
4540
|
"situations": [
|
|
4204
4541
|
"let enemies walk around level geometry",
|
|
@@ -4216,6 +4553,7 @@
|
|
|
4216
4553
|
"kind": "function",
|
|
4217
4554
|
"overrides": [],
|
|
4218
4555
|
"package": "@threenative/physics",
|
|
4556
|
+
"requires": ["npm i @threenative/physics"],
|
|
4219
4557
|
"signature": "export function recast(): NavigationPlugin { … }",
|
|
4220
4558
|
"situations": ["enemy walks around a wall", "NPC patrols a level and chases a player"],
|
|
4221
4559
|
"summary": "Install navmesh pathfinding and crowd avoidance.",
|
|
@@ -4609,6 +4947,20 @@
|
|
|
4609
4947
|
"supersedes": [],
|
|
4610
4948
|
"symbol": "assertCaptureNotBlank"
|
|
4611
4949
|
},
|
|
4950
|
+
{
|
|
4951
|
+
"aliases": [],
|
|
4952
|
+
"constraints": ["keeps the uniform-frame checks and replaces only the bright-pixel floor"],
|
|
4953
|
+
"example": "assertDesktopCaptureNotBlank(png, \"panned-culled.png\");",
|
|
4954
|
+
"importPath": "@threenative/playtest/capture",
|
|
4955
|
+
"kind": "function",
|
|
4956
|
+
"overrides": [],
|
|
4957
|
+
"package": "@threenative/playtest",
|
|
4958
|
+
"signature": "export function assertDesktopCaptureNotBlank(png: Buffer, label: string): ICaptureFrameStats { … }",
|
|
4959
|
+
"situations": ["guard a native desktop capture of a 3D scene"],
|
|
4960
|
+
"summary": "Fail closed when a desktop-host frame shows no rendered content. A native desktop frame has no HTML overlay, so the browser bright-pixel floor does not apply.",
|
|
4961
|
+
"supersedes": [],
|
|
4962
|
+
"symbol": "assertDesktopCaptureNotBlank"
|
|
4963
|
+
},
|
|
4612
4964
|
{
|
|
4613
4965
|
"aliases": [],
|
|
4614
4966
|
"constraints": ["the assertion throws instead of returning a false pass"],
|
|
@@ -4643,6 +4995,20 @@
|
|
|
4643
4995
|
"supersedes": [],
|
|
4644
4996
|
"symbol": "CaptureGuardError"
|
|
4645
4997
|
},
|
|
4998
|
+
{
|
|
4999
|
+
"aliases": [],
|
|
5000
|
+
"constraints": ["does not acquire another screenshot or alter frame timing"],
|
|
5001
|
+
"example": "collectRegionalTone(png, assertions, \"character\", \"posed\");",
|
|
5002
|
+
"importPath": "@threenative/playtest/capture",
|
|
5003
|
+
"kind": "function",
|
|
5004
|
+
"overrides": [],
|
|
5005
|
+
"package": "@threenative/playtest",
|
|
5006
|
+
"signature": "export function collectRegionalTone( png: Buffer, assertions: readonly IPlaytestToneAssertion[], label: string, atStep?: string, ): IPlaytestRegionalToneObservation[] { … }",
|
|
5007
|
+
"situations": ["measure a specified pixel crop in a captured playtest frame"],
|
|
5008
|
+
"summary": "Collect opt-in regional tone observations from the same acquired PNG.",
|
|
5009
|
+
"supersedes": [],
|
|
5010
|
+
"symbol": "collectRegionalTone"
|
|
5011
|
+
},
|
|
4646
5012
|
{
|
|
4647
5013
|
"aliases": [],
|
|
4648
5014
|
"constraints": [],
|
|
@@ -4692,6 +5058,24 @@
|
|
|
4692
5058
|
"supersedes": [],
|
|
4693
5059
|
"symbol": "jsonByteLength"
|
|
4694
5060
|
},
|
|
5061
|
+
{
|
|
5062
|
+
"aliases": [],
|
|
5063
|
+
"constraints": [
|
|
5064
|
+
"throws on an unrecognised value instead of falling back to a fixed-step run"
|
|
5065
|
+
],
|
|
5066
|
+
"example": "if (requestedPlaytestClockMode() === \"wall-clock\") host.pumpDrivesTheSimulation();",
|
|
5067
|
+
"importPath": "@threenative/playtest/protocol",
|
|
5068
|
+
"kind": "function",
|
|
5069
|
+
"overrides": [],
|
|
5070
|
+
"package": "@threenative/playtest",
|
|
5071
|
+
"signature": "export function requestedPlaytestClockMode(): PlaytestClockMode | undefined { … }",
|
|
5072
|
+
"situations": [
|
|
5073
|
+
"report which clock a playtest producer is really running on, before judging its ticks"
|
|
5074
|
+
],
|
|
5075
|
+
"summary": "The clock the host asked for, or `undefined` for the default deterministic run. `wall-clock` is the production profile's opt-in and the only one this protocol has. An unrecognised value throws instead of falling back, because a misspelling that quietly left the loop frozen would publish a frame rate for a game that was not playing. Read at the moment it is needed rather than once at install: a request that arrives after the producer was installed is still a request, and a producer that missed it would judge a live frame pump by a count it never asked for.",
|
|
5076
|
+
"supersedes": [],
|
|
5077
|
+
"symbol": "requestedPlaytestClockMode"
|
|
5078
|
+
},
|
|
4695
5079
|
{
|
|
4696
5080
|
"aliases": [],
|
|
4697
5081
|
"constraints": ["Android evidence must name its target and transport"],
|
|
@@ -4717,7 +5101,7 @@
|
|
|
4717
5101
|
"kind": "function",
|
|
4718
5102
|
"overrides": [],
|
|
4719
5103
|
"package": "@threenative/playtest",
|
|
4720
|
-
"signature": "export async function advanceFixedStep( page: Page, bridge: Pick<IPlaytestBridgeClient, \"advance\">, ticks: number, ): Promise<void> { … }",
|
|
5104
|
+
"signature": "export async function advanceFixedStep( page: Page, bridge: Pick<IPlaytestBridgeClient, \"advance\">, ticks: number, render = false, ): Promise<void> { … }",
|
|
4721
5105
|
"situations": [
|
|
4722
5106
|
"run a complete browser or device playtest",
|
|
4723
5107
|
"capture diagnostics and screenshots from a managed server"
|
|
@@ -4910,6 +5294,23 @@
|
|
|
4910
5294
|
"supersedes": [],
|
|
4911
5295
|
"symbol": "decideDisplayStrategy"
|
|
4912
5296
|
},
|
|
5297
|
+
{
|
|
5298
|
+
"aliases": [],
|
|
5299
|
+
"constraints": ["the mailbox lifecycle must be disposed after the run"],
|
|
5300
|
+
"example": "const driver = new DesktopPlaytestDriver(options);",
|
|
5301
|
+
"importPath": "@threenative/playtest/runner",
|
|
5302
|
+
"kind": "function",
|
|
5303
|
+
"overrides": [],
|
|
5304
|
+
"package": "@threenative/playtest",
|
|
5305
|
+
"signature": "export function desktopConsoleType(stream: \"stderr\" | \"stdout\", line: string): string { … }",
|
|
5306
|
+
"situations": [
|
|
5307
|
+
"run a desktop target through the playtest protocol",
|
|
5308
|
+
"exchange observations with a native desktop host"
|
|
5309
|
+
],
|
|
5310
|
+
"summary": "Drive a local desktop playtest mailbox.",
|
|
5311
|
+
"supersedes": [],
|
|
5312
|
+
"symbol": "desktopConsoleType"
|
|
5313
|
+
},
|
|
4913
5314
|
{
|
|
4914
5315
|
"aliases": [],
|
|
4915
5316
|
"constraints": ["the mailbox lifecycle must be disposed after the run"],
|
|
@@ -5950,85 +6351,204 @@
|
|
|
5950
6351
|
{
|
|
5951
6352
|
"aliases": [],
|
|
5952
6353
|
"constraints": [
|
|
5953
|
-
"
|
|
6354
|
+
"identity parent required; material and motion are editable game source; no move/Mixer/composer writer exists"
|
|
5954
6355
|
],
|
|
5955
|
-
"example": "const
|
|
5956
|
-
"importPath": "@threenative/
|
|
6356
|
+
"example": "const wolf = createAnimalActor(bake, { motion, material, ground });",
|
|
6357
|
+
"importPath": "@threenative/procedural-animals",
|
|
5957
6358
|
"kind": "function",
|
|
5958
6359
|
"overrides": [],
|
|
5959
|
-
"package": "@threenative/
|
|
5960
|
-
"requires": ["npm i @threenative/
|
|
5961
|
-
"signature": "export function
|
|
5962
|
-
"situations": [
|
|
5963
|
-
|
|
5964
|
-
"hand a decoded Unreal mesh to a framework pipeline that owns materials itself"
|
|
5965
|
-
],
|
|
5966
|
-
"summary": "Converts a decoded `.uasset` static mesh into a `THREE.BufferGeometry`, with one draw group per material section.",
|
|
6360
|
+
"package": "@threenative/procedural-animals",
|
|
6361
|
+
"requires": ["npm i @threenative/procedural-animals"],
|
|
6362
|
+
"signature": "export function createAnimalActor(bake: IAnimalBake, options: IAnimalActorOptions) { … }",
|
|
6363
|
+
"situations": ["follow a baked animal from accepted fixed-step Rapier state"],
|
|
6364
|
+
"summary": "Own one actor's pose/lifetime, accepting the completed physics state as its only root writer.",
|
|
5967
6365
|
"supersedes": [],
|
|
5968
|
-
"symbol": "
|
|
6366
|
+
"symbol": "createAnimalActor"
|
|
5969
6367
|
},
|
|
5970
6368
|
{
|
|
5971
6369
|
"aliases": [],
|
|
5972
6370
|
"constraints": [
|
|
5973
|
-
"
|
|
6371
|
+
"this creates bind geometry only; game-owned DQS material and animated bounds remain required"
|
|
5974
6372
|
],
|
|
5975
|
-
"example": "const
|
|
5976
|
-
"importPath": "@threenative/
|
|
6373
|
+
"example": "const { bake, geometry } = createAnimalGeometry(bytes);",
|
|
6374
|
+
"importPath": "@threenative/procedural-animals",
|
|
5977
6375
|
"kind": "function",
|
|
5978
6376
|
"overrides": [],
|
|
5979
|
-
"package": "@threenative/
|
|
5980
|
-
"requires": ["npm i @threenative/
|
|
5981
|
-
"signature": "export function
|
|
5982
|
-
"situations": [
|
|
5983
|
-
|
|
5984
|
-
"key materials to a package's own sections by name or section index"
|
|
5985
|
-
],
|
|
5986
|
-
"summary": "Converts a decoded `.uasset` static mesh into a renderable `THREE.Mesh` with provenance in `userData.unreal` and material selection left to the game's `materialFactory`.",
|
|
6377
|
+
"package": "@threenative/procedural-animals",
|
|
6378
|
+
"requires": ["npm i @threenative/procedural-animals"],
|
|
6379
|
+
"signature": "export function createAnimalGeometry(buffer: ArrayBuffer): { … }",
|
|
6380
|
+
"situations": ["construct a Three.js geometry from a validated procedural wolf bake"],
|
|
6381
|
+
"summary": "Validates all bytes before constructing geometry with the bake's skin and rig attributes.",
|
|
5987
6382
|
"supersedes": [],
|
|
5988
|
-
"symbol": "
|
|
6383
|
+
"symbol": "createAnimalGeometry"
|
|
5989
6384
|
},
|
|
5990
6385
|
{
|
|
5991
6386
|
"aliases": [],
|
|
5992
|
-
"constraints": [
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
],
|
|
5996
|
-
"example": "const payload = resolveBulkDataPayload(bytes, header, { zlib });",
|
|
5997
|
-
"importPath": "@threenative/raw-unreal",
|
|
6387
|
+
"constraints": ["a corrupt served bake rejects rather than falling back to a different file"],
|
|
6388
|
+
"example": "const bake = await loadAnimalBake(ctx.assets, \"wolf.animal\");",
|
|
6389
|
+
"importPath": "@threenative/procedural-animals",
|
|
5998
6390
|
"kind": "function",
|
|
5999
6391
|
"overrides": [],
|
|
6000
|
-
"package": "@threenative/
|
|
6001
|
-
"requires": ["npm i @threenative/
|
|
6002
|
-
"signature": "export function
|
|
6003
|
-
"situations": [
|
|
6004
|
-
|
|
6005
|
-
"decompress the zlib-chunked bulk payload a UE4.2x package stores its MeshDescription in"
|
|
6006
|
-
],
|
|
6007
|
-
"summary": "Reads the `FByteBulkData` headers an editor package serializes into its export data, and resolves each payload — inline, at the end of the package, or in a sibling `.ubulk`/`.uptnl` file whose bytes the caller supplies — decompressing `FArchive::SerializeCompressed` blocks.",
|
|
6392
|
+
"package": "@threenative/procedural-animals",
|
|
6393
|
+
"requires": ["npm i @threenative/procedural-animals"],
|
|
6394
|
+
"signature": "export async function loadAnimalBake( assets: IAnimalAssetResolver, logicalPath: string, options: { … }",
|
|
6395
|
+
"situations": ["load a cooked animal from ctx.assets without runtime generation"],
|
|
6396
|
+
"summary": "Resolves and loads a prebuilt wolf through the game's ordinary asset resolver.",
|
|
6008
6397
|
"supersedes": [],
|
|
6009
|
-
"symbol": "
|
|
6398
|
+
"symbol": "loadAnimalBake"
|
|
6010
6399
|
},
|
|
6011
6400
|
{
|
|
6012
6401
|
"aliases": [],
|
|
6013
6402
|
"constraints": [
|
|
6014
|
-
"
|
|
6403
|
+
"unknown revisions, malformed sections, indices and skin weights throw by name"
|
|
6015
6404
|
],
|
|
6016
|
-
"example": "const
|
|
6017
|
-
"importPath": "@threenative/
|
|
6405
|
+
"example": "const bake = parseAnimalBake(bytes);",
|
|
6406
|
+
"importPath": "@threenative/procedural-animals",
|
|
6018
6407
|
"kind": "function",
|
|
6019
6408
|
"overrides": [],
|
|
6020
|
-
"package": "@threenative/
|
|
6021
|
-
"requires": ["npm i @threenative/
|
|
6022
|
-
"signature": "export function
|
|
6023
|
-
"situations": ["
|
|
6024
|
-
"summary": "
|
|
6409
|
+
"package": "@threenative/procedural-animals",
|
|
6410
|
+
"requires": ["npm i @threenative/procedural-animals"],
|
|
6411
|
+
"signature": "export function parseAnimalBake(buffer: ArrayBuffer): IAnimalBake { … }",
|
|
6412
|
+
"situations": ["validate a baked procedural animal before allocating geometry"],
|
|
6413
|
+
"summary": "Validates a pinned wolf PANM bake before constructing any renderer resource.",
|
|
6025
6414
|
"supersedes": [],
|
|
6026
|
-
"symbol": "
|
|
6415
|
+
"symbol": "parseAnimalBake"
|
|
6027
6416
|
},
|
|
6028
6417
|
{
|
|
6029
6418
|
"aliases": [],
|
|
6030
6419
|
"constraints": [
|
|
6031
|
-
"
|
|
6420
|
+
"only .animal inputs are interpreted; corruption fails the cook, without regeneration"
|
|
6421
|
+
],
|
|
6422
|
+
"example": "await compileAssets({ passes: [animalBakePass()] });",
|
|
6423
|
+
"importPath": "@threenative/procedural-animals/build",
|
|
6424
|
+
"kind": "function",
|
|
6425
|
+
"overrides": [],
|
|
6426
|
+
"package": "@threenative/procedural-animals",
|
|
6427
|
+
"requires": ["npm i @threenative/procedural-animals"],
|
|
6428
|
+
"signature": "export function animalBakePass() { … }",
|
|
6429
|
+
"situations": ["cook staged animal bakes through the ordinary asset pipeline"],
|
|
6430
|
+
"summary": "Validate staged PANM sources inside the existing asset compiler; it owns the hashed manifest.",
|
|
6431
|
+
"supersedes": [],
|
|
6432
|
+
"symbol": "animalBakePass"
|
|
6433
|
+
},
|
|
6434
|
+
{
|
|
6435
|
+
"aliases": [],
|
|
6436
|
+
"constraints": [
|
|
6437
|
+
"exact pinned Node runtime, donor revision, options and generated bytes are validated; no worker is created"
|
|
6438
|
+
],
|
|
6439
|
+
"example": "const bytes = await bakeWolf({ seed: 7, tier: \"crowd\" });",
|
|
6440
|
+
"importPath": "@threenative/procedural-animals/build",
|
|
6441
|
+
"kind": "function",
|
|
6442
|
+
"overrides": [],
|
|
6443
|
+
"package": "@threenative/procedural-animals",
|
|
6444
|
+
"requires": ["npm i @threenative/procedural-animals"],
|
|
6445
|
+
"signature": "export async function bakeWolf(options: IWolfBakeOptions): Promise<ArrayBuffer> { … }",
|
|
6446
|
+
"situations": ["bake high and crowd wolf geometry before the ordinary asset cook"],
|
|
6447
|
+
"summary": "Bake the pinned wolf on the build machine, never on the portable runtime path.",
|
|
6448
|
+
"supersedes": [],
|
|
6449
|
+
"symbol": "bakeWolf"
|
|
6450
|
+
},
|
|
6451
|
+
{
|
|
6452
|
+
"aliases": [],
|
|
6453
|
+
"constraints": [
|
|
6454
|
+
"validation and generation complete before the destination is touched; temporary files are removed on failure"
|
|
6455
|
+
],
|
|
6456
|
+
"example": "await bakeWolfToFile({ seed: 7, tier: \"crowd\" }, \"assets/wolf-crowd.animal\");",
|
|
6457
|
+
"importPath": "@threenative/procedural-animals/build",
|
|
6458
|
+
"kind": "function",
|
|
6459
|
+
"overrides": [],
|
|
6460
|
+
"package": "@threenative/procedural-animals",
|
|
6461
|
+
"requires": ["npm i @threenative/procedural-animals"],
|
|
6462
|
+
"signature": "export async function bakeWolfToFile( options: IWolfBakeOptions, destination: string, ): Promise<string> { … }",
|
|
6463
|
+
"situations": [
|
|
6464
|
+
"publish a generated wolf without replacing the last valid bake on interruption"
|
|
6465
|
+
],
|
|
6466
|
+
"summary": "Stage a validated source bake with a same-directory atomic rename, then use compileAssets.",
|
|
6467
|
+
"supersedes": [],
|
|
6468
|
+
"symbol": "bakeWolfToFile"
|
|
6469
|
+
},
|
|
6470
|
+
{
|
|
6471
|
+
"aliases": [],
|
|
6472
|
+
"constraints": [
|
|
6473
|
+
"materials are never chosen here; the geometry carries groups, the game carries materials"
|
|
6474
|
+
],
|
|
6475
|
+
"example": "const geometry = createThreeGeometry(parseUAssetStaticMesh(buffer));",
|
|
6476
|
+
"importPath": "@threenative/raw-unreal",
|
|
6477
|
+
"kind": "function",
|
|
6478
|
+
"overrides": [],
|
|
6479
|
+
"package": "@threenative/raw-unreal",
|
|
6480
|
+
"requires": ["npm i @threenative/raw-unreal"],
|
|
6481
|
+
"signature": "export function createThreeGeometry(decoded: IDecodedUAssetStaticMesh): BufferGeometry { … }",
|
|
6482
|
+
"situations": [
|
|
6483
|
+
"build custom scene objects from Unreal mesh data instead of a whole mesh",
|
|
6484
|
+
"hand a decoded Unreal mesh to a framework pipeline that owns materials itself"
|
|
6485
|
+
],
|
|
6486
|
+
"summary": "Converts a decoded `.uasset` static mesh into a `THREE.BufferGeometry`, with one draw group per material section.",
|
|
6487
|
+
"supersedes": [],
|
|
6488
|
+
"symbol": "createThreeGeometry"
|
|
6489
|
+
},
|
|
6490
|
+
{
|
|
6491
|
+
"aliases": [],
|
|
6492
|
+
"constraints": [
|
|
6493
|
+
"the fallback is three.js's own plain MeshStandardMaterial; every real material comes from the game"
|
|
6494
|
+
],
|
|
6495
|
+
"example": "const mesh = createThreeObject(decoded, { materialFactory: (d) => d.sections.map(() => barkMaterial) });",
|
|
6496
|
+
"importPath": "@threenative/raw-unreal",
|
|
6497
|
+
"kind": "function",
|
|
6498
|
+
"overrides": [],
|
|
6499
|
+
"package": "@threenative/raw-unreal",
|
|
6500
|
+
"requires": ["npm i @threenative/raw-unreal"],
|
|
6501
|
+
"signature": "export function createThreeObject( decoded: IDecodedUAssetStaticMesh, options: IThreeAdapterOptions = { … }",
|
|
6502
|
+
"situations": [
|
|
6503
|
+
"put a raw .uasset mesh on screen without converting it to glTF first",
|
|
6504
|
+
"key materials to a package's own sections by name or section index"
|
|
6505
|
+
],
|
|
6506
|
+
"summary": "Converts a decoded `.uasset` static mesh into a renderable `THREE.Mesh` with provenance in `userData.unreal` and material selection left to the game's `materialFactory`.",
|
|
6507
|
+
"supersedes": [],
|
|
6508
|
+
"symbol": "createThreeObject"
|
|
6509
|
+
},
|
|
6510
|
+
{
|
|
6511
|
+
"aliases": [],
|
|
6512
|
+
"constraints": [
|
|
6513
|
+
"zlib payloads require an injected `zlib` codec; the package never bundles one, and a missing codec throws MISSING_CODEC instead of guessing",
|
|
6514
|
+
"a payload written to a sibling file throws MISSING_BULK_DATA_FILE naming that file, rather than inventing geometry"
|
|
6515
|
+
],
|
|
6516
|
+
"example": "const payload = resolveBulkDataPayload(bytes, header, { zlib });",
|
|
6517
|
+
"importPath": "@threenative/raw-unreal",
|
|
6518
|
+
"kind": "function",
|
|
6519
|
+
"overrides": [],
|
|
6520
|
+
"package": "@threenative/raw-unreal",
|
|
6521
|
+
"requires": ["npm i @threenative/raw-unreal"],
|
|
6522
|
+
"signature": "export function decompressBulkData( container: Uint8Array, codecs: { … }",
|
|
6523
|
+
"situations": [
|
|
6524
|
+
"read a UE4 editor static mesh whose source model lives in bulk data rather than inline",
|
|
6525
|
+
"decompress the zlib-chunked bulk payload a UE4.2x package stores its MeshDescription in"
|
|
6526
|
+
],
|
|
6527
|
+
"summary": "Reads the `FByteBulkData` headers an editor package serializes into its export data, and resolves each payload — inline, at the end of the package, or in a sibling `.ubulk`/`.uptnl` file whose bytes the caller supplies — decompressing `FArchive::SerializeCompressed` blocks.",
|
|
6528
|
+
"supersedes": [],
|
|
6529
|
+
"symbol": "decompressBulkData"
|
|
6530
|
+
},
|
|
6531
|
+
{
|
|
6532
|
+
"aliases": [],
|
|
6533
|
+
"constraints": [
|
|
6534
|
+
"Oodle and LZ4 payloads require an injected codec; the package never bundles one, and a missing codec throws MISSING_CODEC instead of guessing"
|
|
6535
|
+
],
|
|
6536
|
+
"example": "const payload = decompressCompressedBuffer(parseCompressedBuffer(bytes, offset), { oodle });",
|
|
6537
|
+
"importPath": "@threenative/raw-unreal",
|
|
6538
|
+
"kind": "function",
|
|
6539
|
+
"overrides": [],
|
|
6540
|
+
"package": "@threenative/raw-unreal",
|
|
6541
|
+
"requires": ["npm i @threenative/raw-unreal"],
|
|
6542
|
+
"signature": "export function decompressCompressedBuffer( buffer: ICompressedBuffer, codecs: IUAssetCodecs, ): Uint8Array { … }",
|
|
6543
|
+
"situations": ["decompress the package-trailer payload that carries a UE5 MeshDescription"],
|
|
6544
|
+
"summary": "Parses one UE5 `FCompressedBuffer` and decompresses it block-by-block with the codecs the caller injected — uncompressed payloads are handled natively.",
|
|
6545
|
+
"supersedes": [],
|
|
6546
|
+
"symbol": "decompressCompressedBuffer"
|
|
6547
|
+
},
|
|
6548
|
+
{
|
|
6549
|
+
"aliases": [],
|
|
6550
|
+
"constraints": [
|
|
6551
|
+
"zlib payloads require an injected `zlib` codec; the package never bundles one, and a missing codec throws MISSING_CODEC instead of guessing",
|
|
6032
6552
|
"a payload written to a sibling file throws MISSING_BULK_DATA_FILE naming that file, rather than inventing geometry"
|
|
6033
6553
|
],
|
|
6034
6554
|
"example": "const payload = resolveBulkDataPayload(bytes, header, { zlib });",
|
|
@@ -6397,6 +6917,776 @@
|
|
|
6397
6917
|
"symbol": "sparkle",
|
|
6398
6918
|
"aliases": []
|
|
6399
6919
|
},
|
|
6920
|
+
{
|
|
6921
|
+
"aliases": [],
|
|
6922
|
+
"constraints": [
|
|
6923
|
+
"headless authoring; game applies transforms against its model bounds and actual terrain surface"
|
|
6924
|
+
],
|
|
6925
|
+
"example": "const state = applyPlacementOverrides(terrain.evaluate(), document.placementOverrides ?? {});",
|
|
6926
|
+
"importPath": "@threenative/terrain",
|
|
6927
|
+
"kind": "function",
|
|
6928
|
+
"overrides": [
|
|
6929
|
+
"transform.grounding=false preserves requested Y while the game still measures clearance"
|
|
6930
|
+
],
|
|
6931
|
+
"package": "@threenative/terrain",
|
|
6932
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
6933
|
+
"signature": "export function applyPlacementOverrides(state: ITerrainState, value: unknown): ITerrainState { … }",
|
|
6934
|
+
"situations": ["retain manual prop transforms across terrain scatter re-evaluation"],
|
|
6935
|
+
"summary": "Attach manual transforms to raw evaluated candidates and report orphan keys.",
|
|
6936
|
+
"supersedes": [],
|
|
6937
|
+
"symbol": "applyPlacementOverrides"
|
|
6938
|
+
},
|
|
6939
|
+
{
|
|
6940
|
+
"aliases": [],
|
|
6941
|
+
"constraints": [
|
|
6942
|
+
"no material is chosen; vertex colours exist only with a caller-supplied palette"
|
|
6943
|
+
],
|
|
6944
|
+
"example": "const mesh = bakeMesh(new Terrain({ resolution: 17 }).evaluate());",
|
|
6945
|
+
"importPath": "@threenative/terrain",
|
|
6946
|
+
"kind": "function",
|
|
6947
|
+
"overrides": ["step, chunk bounds, skirtDepth and palette belong to the caller"],
|
|
6948
|
+
"package": "@threenative/terrain",
|
|
6949
|
+
"requires": ["npm i @threenative/terrain"],
|
|
6950
|
+
"signature": "export function bakeMesh( state: ITerrainState, { … }",
|
|
6951
|
+
"situations": ["bake an authored terrain into portable indexed mesh arrays"],
|
|
6952
|
+
"summary": "Bakes the recovered indexed top surface and optional vertical skirts into caller-owned arrays.",
|
|
6953
|
+
"supersedes": [],
|
|
6954
|
+
"symbol": "bakeMesh"
|
|
6955
|
+
},
|
|
6956
|
+
{
|
|
6957
|
+
"aliases": [],
|
|
6958
|
+
"constraints": [
|
|
6959
|
+
"collision origin is the southwest corner; engine Heightfield origin is its centre"
|
|
6960
|
+
],
|
|
6961
|
+
"example": "const baked = bakeTerrain(new Terrain({ resolution: 129 }).evaluate(), { chunkCells: 64 });",
|
|
6962
|
+
"importPath": "@threenative/terrain",
|
|
6963
|
+
"kind": "function",
|
|
6964
|
+
"overrides": ["chunkCells, lodSteps, skirtDepth and palette are explicit authoring choices"],
|
|
6965
|
+
"package": "@threenative/terrain",
|
|
6966
|
+
"requires": ["npm i @threenative/terrain"],
|
|
6967
|
+
"signature": "export function bakeTerrain( state: ITerrainState, { … }",
|
|
6968
|
+
"situations": ["prepare terrain arrays and collision before a game starts"],
|
|
6969
|
+
"summary": "Bakes finite LOD chunks, the same collision samples and resolved placements.",
|
|
6970
|
+
"supersedes": [],
|
|
6971
|
+
"symbol": "bakeTerrain"
|
|
6972
|
+
},
|
|
6973
|
+
{
|
|
6974
|
+
"aliases": [],
|
|
6975
|
+
"constraints": [
|
|
6976
|
+
"headless authoring; no three, no DOM, and nothing here decides how the world looks"
|
|
6977
|
+
],
|
|
6978
|
+
"example": "const { manifest, files } = bakeWorldPackage(state, { assets });",
|
|
6979
|
+
"importPath": "@threenative/terrain",
|
|
6980
|
+
"kind": "function",
|
|
6981
|
+
"overrides": [
|
|
6982
|
+
"every asset path, bound, LOD distance and cell size comes from the caller's options"
|
|
6983
|
+
],
|
|
6984
|
+
"package": "@threenative/terrain",
|
|
6985
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
6986
|
+
"signature": "export function bakeWorldPackage( state: ITerrainState, options: IBakeWorldPackageOptions, ): IBakedWorldPackage { … }",
|
|
6987
|
+
"situations": ["hand an evaluated Strata terrain to a game without a Blender round trip"],
|
|
6988
|
+
"summary": "Bake an evaluated terrain into the engine's world package: a `world.json` manifest, a uint16 heightmap, a splat mask array, a placement buffer of eight float32 per instance, and the square cells that stream them. The encodings and row orders are the ones the Blender recipe `export_world.py` writes, so one runtime streams both without a second reader.",
|
|
6989
|
+
"supersedes": [],
|
|
6990
|
+
"symbol": "bakeWorldPackage"
|
|
6991
|
+
},
|
|
6992
|
+
{
|
|
6993
|
+
"aliases": [],
|
|
6994
|
+
"constraints": [
|
|
6995
|
+
"returns candidates only; the caller applies its own exact distance and level test"
|
|
6996
|
+
],
|
|
6997
|
+
"example": "const rivers = createSegmentIndex(segments, 32); const wet = rivers.nearby(x, z).some(isWet);",
|
|
6998
|
+
"importPath": "@threenative/terrain",
|
|
6999
|
+
"kind": "function",
|
|
7000
|
+
"overrides": [],
|
|
7001
|
+
"package": "@threenative/terrain",
|
|
7002
|
+
"requires": ["npm i @threenative/terrain"],
|
|
7003
|
+
"signature": "export function createSegmentIndex<T>( segments: readonly IWaterSegment<T>[], cellSize: number, ): ISegmentIndex<T> { … }",
|
|
7004
|
+
"situations": [
|
|
7005
|
+
"test scatter candidates or terrain vertices against rivers and lakes without scanning every segment",
|
|
7006
|
+
"find which river stations can reach a heightfield vertex when baking a wet margin"
|
|
7007
|
+
],
|
|
7008
|
+
"summary": "Build the index once per world; ask `nearby` per scatter candidate or heightfield vertex.",
|
|
7009
|
+
"supersedes": [],
|
|
7010
|
+
"symbol": "createSegmentIndex"
|
|
7011
|
+
},
|
|
7012
|
+
{
|
|
7013
|
+
"aliases": [],
|
|
7014
|
+
"constraints": ["authoring data only; the game owns appearance, physics and rendering"],
|
|
7015
|
+
"example": "const png = await encodeHeightPNG(new Terrain({ resolution: 17 }).evaluate()); const heights = await decodeHeightPNG(png);",
|
|
7016
|
+
"importPath": "@threenative/terrain",
|
|
7017
|
+
"kind": "function",
|
|
7018
|
+
"overrides": [],
|
|
7019
|
+
"package": "@threenative/terrain",
|
|
7020
|
+
"requires": ["npm i @threenative/terrain"],
|
|
7021
|
+
"signature": "export async function decodeHeightPNG( input: Uint8Array | ArrayBuffer, options: IDecodeHeightPngOptions = { … }",
|
|
7022
|
+
"situations": ["import numerical PNG8 or PNG16 terrain elevations"],
|
|
7023
|
+
"summary": "CRC-checked bounded non-interlaced grayscale PNG height decoder.",
|
|
7024
|
+
"supersedes": [],
|
|
7025
|
+
"symbol": "decodeHeightPNG"
|
|
7026
|
+
},
|
|
7027
|
+
{
|
|
7028
|
+
"aliases": [],
|
|
7029
|
+
"constraints": ["authoring data only; the game owns appearance, physics and rendering"],
|
|
7030
|
+
"example": "const decoded = decodeRAW16(new Uint8Array(8), { width: 2, height: 2, min: 0, max: 1 });",
|
|
7031
|
+
"importPath": "@threenative/terrain",
|
|
7032
|
+
"kind": "function",
|
|
7033
|
+
"overrides": [],
|
|
7034
|
+
"package": "@threenative/terrain",
|
|
7035
|
+
"requires": ["npm i @threenative/terrain"],
|
|
7036
|
+
"signature": "export function decodeRAW16( input: Uint8Array | ArrayBuffer, { … }",
|
|
7037
|
+
"situations": ["import a RAW16 terrain height buffer with explicit dimensions"],
|
|
7038
|
+
"summary": "Validates dimensions and range before decoding numerical height samples.",
|
|
7039
|
+
"supersedes": [],
|
|
7040
|
+
"symbol": "decodeRAW16"
|
|
7041
|
+
},
|
|
7042
|
+
{
|
|
7043
|
+
"aliases": [],
|
|
7044
|
+
"constraints": ["authoring data only; the game owns appearance, physics and rendering"],
|
|
7045
|
+
"example": "const glb = encodeGLB(bakeMesh(new Terrain({ resolution: 17 }).evaluate()));",
|
|
7046
|
+
"importPath": "@threenative/terrain",
|
|
7047
|
+
"kind": "function",
|
|
7048
|
+
"overrides": [],
|
|
7049
|
+
"package": "@threenative/terrain",
|
|
7050
|
+
"requires": ["npm i @threenative/terrain"],
|
|
7051
|
+
"signature": "export function encodeGLB(input: IBakedMesh | readonly IBakedMesh[]) { … }",
|
|
7052
|
+
"situations": ["export baked terrain geometry without engine extensions"],
|
|
7053
|
+
"summary": "Legacy terrain-only GLB encoding with embedded mesh arrays and no chosen material.",
|
|
7054
|
+
"supersedes": [],
|
|
7055
|
+
"symbol": "encodeGLB"
|
|
7056
|
+
},
|
|
7057
|
+
{
|
|
7058
|
+
"aliases": [],
|
|
7059
|
+
"constraints": ["authoring data only; the game owns appearance, physics and rendering"],
|
|
7060
|
+
"example": "const png = await encodeHeightPNG(new Terrain({ resolution: 17 }).evaluate());",
|
|
7061
|
+
"importPath": "@threenative/terrain",
|
|
7062
|
+
"kind": "function",
|
|
7063
|
+
"overrides": [],
|
|
7064
|
+
"package": "@threenative/terrain",
|
|
7065
|
+
"requires": ["npm i @threenative/terrain"],
|
|
7066
|
+
"signature": "export async function encodeHeightPNG(state: ITerrainState, options: Partial<IHeightRange> = { … }",
|
|
7067
|
+
"situations": ["export a terrain heightmap without an eight-bit colour conversion"],
|
|
7068
|
+
"summary": "Encodes numerical grayscale PNG16 with embedded elevation range.",
|
|
7069
|
+
"supersedes": [],
|
|
7070
|
+
"symbol": "encodeHeightPNG"
|
|
7071
|
+
},
|
|
7072
|
+
{
|
|
7073
|
+
"aliases": [],
|
|
7074
|
+
"constraints": ["authoring data only; the game owns appearance, physics and rendering"],
|
|
7075
|
+
"example": "const raw = encodeRAW16(new Float32Array([0, 1]), { min: 0, max: 1 });",
|
|
7076
|
+
"importPath": "@threenative/terrain",
|
|
7077
|
+
"kind": "function",
|
|
7078
|
+
"overrides": [],
|
|
7079
|
+
"package": "@threenative/terrain",
|
|
7080
|
+
"requires": ["npm i @threenative/terrain"],
|
|
7081
|
+
"signature": "export function encodeRAW16( values: ArrayLike<number> & Iterable<number>, options: IRaw16Options = { … }",
|
|
7082
|
+
"situations": ["export terrain heights with a numerical range sidecar"],
|
|
7083
|
+
"summary": "Encodes finite metre elevations as an explicit-range RAW16 buffer.",
|
|
7084
|
+
"supersedes": [],
|
|
7085
|
+
"symbol": "encodeRAW16"
|
|
7086
|
+
},
|
|
7087
|
+
{
|
|
7088
|
+
"aliases": [],
|
|
7089
|
+
"constraints": ["authoring data only; the game owns appearance, physics and rendering"],
|
|
7090
|
+
"example": "const maps = await encodeSplatPNGs(new Terrain({ resolution: 17 }).evaluate());",
|
|
7091
|
+
"importPath": "@threenative/terrain",
|
|
7092
|
+
"kind": "function",
|
|
7093
|
+
"overrides": [],
|
|
7094
|
+
"package": "@threenative/terrain",
|
|
7095
|
+
"requires": ["npm i @threenative/terrain"],
|
|
7096
|
+
"signature": "export async function encodeSplatPNGs(state: ITerrainState) { … }",
|
|
7097
|
+
"situations": ["export terrain splat weights as linear data"],
|
|
7098
|
+
"summary": "Encodes the eight linear material-weight channels as two RGBA images.",
|
|
7099
|
+
"supersedes": [],
|
|
7100
|
+
"symbol": "encodeSplatPNGs"
|
|
7101
|
+
},
|
|
7102
|
+
{
|
|
7103
|
+
"aliases": [],
|
|
7104
|
+
"constraints": ["authoring data only; the game owns appearance, physics and rendering"],
|
|
7105
|
+
"example": "const archive = encodeZIP([{ name: \"height.raw\", bytes: new Uint8Array(8) }]);",
|
|
7106
|
+
"importPath": "@threenative/terrain",
|
|
7107
|
+
"kind": "function",
|
|
7108
|
+
"overrides": [],
|
|
7109
|
+
"package": "@threenative/terrain",
|
|
7110
|
+
"requires": ["npm i @threenative/terrain"],
|
|
7111
|
+
"signature": "export function encodeZIP(files: readonly IExportFile[]) { … }",
|
|
7112
|
+
"situations": ["archive derived terrain files without another dependency"],
|
|
7113
|
+
"summary": "Deterministic store-method ZIP with safe unique relative filenames.",
|
|
7114
|
+
"supersedes": [],
|
|
7115
|
+
"symbol": "encodeZIP"
|
|
7116
|
+
},
|
|
7117
|
+
{
|
|
7118
|
+
"aliases": [],
|
|
7119
|
+
"constraints": ["authoring data only; the game owns appearance, physics and rendering"],
|
|
7120
|
+
"example": "const gradient = gradientAt(new Terrain({ resolution: 17 }).evaluate(), 0, 0);",
|
|
7121
|
+
"importPath": "@threenative/terrain",
|
|
7122
|
+
"kind": "function",
|
|
7123
|
+
"overrides": [],
|
|
7124
|
+
"package": "@threenative/terrain",
|
|
7125
|
+
"requires": ["npm i @threenative/terrain"],
|
|
7126
|
+
"signature": "export function gradientAt(grid: ISampledGrid, x: number, z: number): [number, number] { … }",
|
|
7127
|
+
"situations": ["measure an authored terrain gradient in metres"],
|
|
7128
|
+
"summary": "World-space height gradient from the canonical samples.",
|
|
7129
|
+
"supersedes": [],
|
|
7130
|
+
"symbol": "gradientAt"
|
|
7131
|
+
},
|
|
7132
|
+
{
|
|
7133
|
+
"aliases": [],
|
|
7134
|
+
"constraints": ["authoring data only; the game owns appearance, physics and rendering"],
|
|
7135
|
+
"example": "const terrain = new Terrain({ resolution: 17 }); const file = await makeExport(terrain.evaluate(), terrain.toJSON(), \"project\");",
|
|
7136
|
+
"importPath": "@threenative/terrain",
|
|
7137
|
+
"kind": "function",
|
|
7138
|
+
"overrides": [],
|
|
7139
|
+
"package": "@threenative/terrain",
|
|
7140
|
+
"requires": ["npm i @threenative/terrain"],
|
|
7141
|
+
"signature": "export async function makeExport( state: ITerrainState, recipe: ITerrainDocument, kind: ExportKind, ): Promise<IExportArchive> { … }",
|
|
7142
|
+
"situations": ["export a terrain recipe and its numerical runtime data"],
|
|
7143
|
+
"summary": "Recovered numerical/project exports; GLB/runtime outputs contain terrain only.",
|
|
7144
|
+
"supersedes": [],
|
|
7145
|
+
"symbol": "makeExport"
|
|
7146
|
+
},
|
|
7147
|
+
{
|
|
7148
|
+
"aliases": [],
|
|
7149
|
+
"constraints": ["authoring data only; the game owns appearance, physics and rendering"],
|
|
7150
|
+
"example": "const height = sampleHeight(new Terrain({ resolution: 17 }).evaluate(), 0, 0);",
|
|
7151
|
+
"importPath": "@threenative/terrain",
|
|
7152
|
+
"kind": "function",
|
|
7153
|
+
"overrides": [],
|
|
7154
|
+
"package": "@threenative/terrain",
|
|
7155
|
+
"requires": ["npm i @threenative/terrain"],
|
|
7156
|
+
"signature": "sampleHeight = (grid: ISampledGrid, x: number, z: number): number => sampleGrid( grid.height, grid.resolution, grid.resolution, x / grid.size + 0.5, z / grid.size + 0.5, )",
|
|
7157
|
+
"situations": ["query an authored heightfield at world coordinates"],
|
|
7158
|
+
"summary": "Bilinear query of canonical height samples; triangle sampling is a separate contract.",
|
|
7159
|
+
"supersedes": [],
|
|
7160
|
+
"symbol": "sampleHeight"
|
|
7161
|
+
},
|
|
7162
|
+
{
|
|
7163
|
+
"aliases": [],
|
|
7164
|
+
"constraints": ["authoring data only; the game owns appearance, physics and rendering"],
|
|
7165
|
+
"example": "const slope = slopeAtIndex(new Terrain({ resolution: 17 }).evaluate(), 0);",
|
|
7166
|
+
"importPath": "@threenative/terrain",
|
|
7167
|
+
"kind": "function",
|
|
7168
|
+
"overrides": [],
|
|
7169
|
+
"package": "@threenative/terrain",
|
|
7170
|
+
"requires": ["npm i @threenative/terrain"],
|
|
7171
|
+
"signature": "export function slopeAtIndex(grid: ISampledGrid, i: number): number { … }",
|
|
7172
|
+
"situations": ["measure terrain slope for authoring diagnostics"],
|
|
7173
|
+
"summary": "Slope in degrees at a heightfield sample.",
|
|
7174
|
+
"supersedes": [],
|
|
7175
|
+
"symbol": "slopeAtIndex"
|
|
7176
|
+
},
|
|
7177
|
+
{
|
|
7178
|
+
"aliases": [],
|
|
7179
|
+
"constraints": [
|
|
7180
|
+
"interior vertices only (edges have one-sided differences); quantile must be in [0, 1]"
|
|
7181
|
+
],
|
|
7182
|
+
"example": "const steep = slopeQuantile(grid, 0.98); if (slopeAt(x, z) > Math.min(30, steep)) placeRock(x, z);",
|
|
7183
|
+
"importPath": "@threenative/terrain",
|
|
7184
|
+
"kind": "function",
|
|
7185
|
+
"overrides": [],
|
|
7186
|
+
"package": "@threenative/terrain",
|
|
7187
|
+
"requires": ["npm i @threenative/terrain"],
|
|
7188
|
+
"signature": "export function slopeQuantile(grid: ISampledGrid, quantile: number): number { … }",
|
|
7189
|
+
"situations": [
|
|
7190
|
+
"place rocks or cliffs on a terrain's own steepest ground instead of a fixed slope in degrees"
|
|
7191
|
+
],
|
|
7192
|
+
"summary": "A slope, in degrees, that the given share of this terrain's interior vertices lie at or below. Placement rules keyed to fixed degrees break when a world is rebaked smoother or rougher: an outcrop rule of \"over 30 degrees\" placed nothing on a forest whose 98th percentile is 22. Asking the terrain for its own steepest share keeps the rule meaning the same thing on every world.",
|
|
7193
|
+
"supersedes": [],
|
|
7194
|
+
"symbol": "slopeQuantile"
|
|
7195
|
+
},
|
|
7196
|
+
{
|
|
7197
|
+
"aliases": [],
|
|
7198
|
+
"constraints": ["authoring data only; the game owns appearance, physics and rendering"],
|
|
7199
|
+
"example": "const points = splinePoints([[0, 4, 0], [10, 2, 10]], 3, false);",
|
|
7200
|
+
"importPath": "@threenative/terrain",
|
|
7201
|
+
"kind": "function",
|
|
7202
|
+
"overrides": [],
|
|
7203
|
+
"package": "@threenative/terrain",
|
|
7204
|
+
"requires": ["npm i @threenative/terrain"],
|
|
7205
|
+
"signature": "export function splinePoints( points: readonly (readonly [number, number, number])[], step = 3, smooth = true, ): [number, number, number][] { … }",
|
|
7206
|
+
"situations": ["sample a road or river profile without vertical overshoot"],
|
|
7207
|
+
"summary": "Recovered horizontal Catmull–Rom and vertically linear profile sampler.",
|
|
7208
|
+
"supersedes": [],
|
|
7209
|
+
"symbol": "splinePoints"
|
|
7210
|
+
},
|
|
7211
|
+
{
|
|
7212
|
+
"aliases": [],
|
|
7213
|
+
"constraints": [
|
|
7214
|
+
"authoring stays outside the game's steady-play graph; no renderer or physics is created",
|
|
7215
|
+
"units are metres with Y up; `size` is the world edge in metres (1 to 100000), centred on the origin",
|
|
7216
|
+
"`resolution` counts vertices per edge and must be one of 17, 33, 65, 129, 257, 513 or 1025",
|
|
7217
|
+
"`seed` is an integer from 0 to 4294967295; one document and seed evaluate to the same arrays",
|
|
7218
|
+
"`evaluate()` is synchronous on the calling thread: run it in a build script, never per frame",
|
|
7219
|
+
"no art is chosen or shipped: materials, models and texture paths belong to the game"
|
|
7220
|
+
],
|
|
7221
|
+
"example": "const terrain = new Terrain({ size: 512, resolution: 257, seed: 73 }).noise({ id: \"hills\", amplitude: 35 });",
|
|
7222
|
+
"importPath": "@threenative/terrain",
|
|
7223
|
+
"kind": "class",
|
|
7224
|
+
"overrides": ["size, resolution, seed and all layer parameters are caller choices"],
|
|
7225
|
+
"package": "@threenative/terrain",
|
|
7226
|
+
"requires": ["npm i @threenative/terrain"],
|
|
7227
|
+
"signature": "export class Terrain { … }",
|
|
7228
|
+
"situations": [
|
|
7229
|
+
"author seeded terrain with noise, sculpting, erosion, roads, rivers and scatter",
|
|
7230
|
+
"generate a procedural heightmap landscape or island for a game"
|
|
7231
|
+
],
|
|
7232
|
+
"summary": "Ordered, stable-ID terrain authoring with synchronous atomic transactions.",
|
|
7233
|
+
"supersedes": [],
|
|
7234
|
+
"symbol": "Terrain"
|
|
7235
|
+
},
|
|
7236
|
+
{
|
|
7237
|
+
"aliases": [],
|
|
7238
|
+
"constraints": ["evaluates authoring documents only; games consume pre-baked arrays"],
|
|
7239
|
+
"example": "const terrain = new Terrain({ resolution: 17 }); const evaluator = new TerrainEvaluator(); const state = evaluator.evaluate(terrain.toJSON());",
|
|
7240
|
+
"importPath": "@threenative/terrain",
|
|
7241
|
+
"kind": "class",
|
|
7242
|
+
"overrides": ["cacheMB bounds retained prefix data"],
|
|
7243
|
+
"package": "@threenative/terrain",
|
|
7244
|
+
"requires": ["npm i @threenative/terrain"],
|
|
7245
|
+
"signature": "export class TerrainEvaluator { … }",
|
|
7246
|
+
"situations": ["reuse terrain evaluation prefixes while authoring a finite heightfield"],
|
|
7247
|
+
"summary": "Recovered prefix-caching authoring evaluator. Returned buffers belong to the caller.",
|
|
7248
|
+
"supersedes": [],
|
|
7249
|
+
"symbol": "TerrainEvaluator"
|
|
7250
|
+
},
|
|
7251
|
+
{
|
|
7252
|
+
"aliases": [],
|
|
7253
|
+
"constraints": ["authoring data only; the game owns appearance, physics and rendering"],
|
|
7254
|
+
"example": "validateDocument(new Terrain({ resolution: 17 }).toJSON());",
|
|
7255
|
+
"importPath": "@threenative/terrain",
|
|
7256
|
+
"kind": "function",
|
|
7257
|
+
"overrides": [],
|
|
7258
|
+
"package": "@threenative/terrain",
|
|
7259
|
+
"requires": ["npm i @threenative/terrain"],
|
|
7260
|
+
"signature": "export function validateDocument(doc: ITerrainDocument): void { … }",
|
|
7261
|
+
"situations": ["validate a terrain document before accepting an authoring write"],
|
|
7262
|
+
"summary": "Validates the recovered recipe schema, operation allow-lists and numeric bounds.",
|
|
7263
|
+
"supersedes": [],
|
|
7264
|
+
"symbol": "validateDocument"
|
|
7265
|
+
},
|
|
7266
|
+
{
|
|
7267
|
+
"aliases": [],
|
|
7268
|
+
"constraints": [
|
|
7269
|
+
"grounding defaults on only when omitted; position and scale have three components and quaternion is unit length"
|
|
7270
|
+
],
|
|
7271
|
+
"example": "const transforms = validatePlacementOverrides(document.placementOverrides);",
|
|
7272
|
+
"importPath": "@threenative/terrain",
|
|
7273
|
+
"kind": "function",
|
|
7274
|
+
"overrides": ["grounding=false preserves authored Y and keeps clearance observable"],
|
|
7275
|
+
"package": "@threenative/terrain",
|
|
7276
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
7277
|
+
"signature": "export function validatePlacementOverrides( value: unknown = { … }",
|
|
7278
|
+
"situations": [
|
|
7279
|
+
"validate finite positive manual prop transforms before a terrain authoring transaction"
|
|
7280
|
+
],
|
|
7281
|
+
"summary": "Validate and clone stable-key placement transforms before saving or previewing them.",
|
|
7282
|
+
"supersedes": [],
|
|
7283
|
+
"symbol": "validatePlacementOverrides"
|
|
7284
|
+
},
|
|
7285
|
+
{
|
|
7286
|
+
"aliases": [],
|
|
7287
|
+
"constraints": [
|
|
7288
|
+
"throws by name; HDR/EXR environment files and ordinary images are accepted, models are not"
|
|
7289
|
+
],
|
|
7290
|
+
"example": "checkEnvironmentAssets({ sky: { image: \"dusk\" } }, document.assets ?? []);",
|
|
7291
|
+
"importPath": "@threenative/terrain/editor",
|
|
7292
|
+
"kind": "function",
|
|
7293
|
+
"overrides": ["the project owns which images it registers"],
|
|
7294
|
+
"package": "@threenative/terrain",
|
|
7295
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
7296
|
+
"signature": "export function checkEnvironmentAssets( environment: IEnvironment, assets: readonly { … }",
|
|
7297
|
+
"situations": [
|
|
7298
|
+
"refuse a saved environment whose sky or lighting image is not a registered file"
|
|
7299
|
+
],
|
|
7300
|
+
"summary": "Check that the images an environment names are registered environment or image assets. @summary Validate the assets a preview environment refers to",
|
|
7301
|
+
"supersedes": [],
|
|
7302
|
+
"symbol": "checkEnvironmentAssets"
|
|
7303
|
+
},
|
|
7304
|
+
{
|
|
7305
|
+
"aliases": [],
|
|
7306
|
+
"constraints": ["framing only; an unknown target returns a named diagnostic and no camera"],
|
|
7307
|
+
"example": "const outcome = focusCamera(camera, { target: { kind: \"prop\", id: \"pine-3\" }, aspect: 16 / 9 }, resolve);",
|
|
7308
|
+
"importPath": "@threenative/terrain/editor",
|
|
7309
|
+
"kind": "function",
|
|
7310
|
+
"overrides": ["the view supplies target bounds, the live aspect and the camera to keep"],
|
|
7311
|
+
"package": "@threenative/terrain",
|
|
7312
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
7313
|
+
"signature": "export function focusCamera( camera: ISavedCamera, request: IFocusRequest, resolve: IFocusResolver, ): IFocusOutcome { … }",
|
|
7314
|
+
"situations": [
|
|
7315
|
+
"frame one selected prop, a registered landmark, a terrain region or a local point"
|
|
7316
|
+
],
|
|
7317
|
+
"summary": "Frame a point, prop, landmark or region for the live viewport and projection. @summary Frame a focus target with an editor observation camera",
|
|
7318
|
+
"supersedes": [],
|
|
7319
|
+
"symbol": "focusCamera"
|
|
7320
|
+
},
|
|
7321
|
+
{
|
|
7322
|
+
"aliases": [],
|
|
7323
|
+
"constraints": [
|
|
7324
|
+
"headers and checksums only; throws by name for a damaged, truncated or oversize file"
|
|
7325
|
+
],
|
|
7326
|
+
"example": "const report = inspectImage(bytes, \"png\", { maxDimension: 8192 });",
|
|
7327
|
+
"importPath": "@threenative/terrain/editor",
|
|
7328
|
+
"kind": "function",
|
|
7329
|
+
"overrides": ["the project sets the dimension limit"],
|
|
7330
|
+
"package": "@threenative/terrain",
|
|
7331
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
7332
|
+
"signature": "export function inspectImage( bytes: Uint8Array, format: string, limits: { … }",
|
|
7333
|
+
"situations": [
|
|
7334
|
+
"check an imported surface or environment image for damage and for the project's size limit"
|
|
7335
|
+
],
|
|
7336
|
+
"summary": "Validate a PNG, JPEG, WebP, Radiance HDR or OpenEXR container and read its pixel size. @summary Inspect an image file's container and pixel size without decoding it",
|
|
7337
|
+
"supersedes": [],
|
|
7338
|
+
"symbol": "inspectImage"
|
|
7339
|
+
},
|
|
7340
|
+
{
|
|
7341
|
+
"aliases": [],
|
|
7342
|
+
"constraints": [
|
|
7343
|
+
"authoring data only; queries outside the extent or without observations throw"
|
|
7344
|
+
],
|
|
7345
|
+
"example": "const observation = inspectSpatial(state, revision, { kind: \"point\", at: [0, 0] });",
|
|
7346
|
+
"importPath": "@threenative/terrain/editor",
|
|
7347
|
+
"kind": "function",
|
|
7348
|
+
"overrides": [
|
|
7349
|
+
"the caller owns the revision identity and the evaluated state being inspected"
|
|
7350
|
+
],
|
|
7351
|
+
"package": "@threenative/terrain",
|
|
7352
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
7353
|
+
"signature": "export function inspectSpatial( state: ITerrainState, revision: string, query: ISpatialQuery, ): ISpatialObservation { … }",
|
|
7354
|
+
"situations": [
|
|
7355
|
+
"measure a point, profile a transect or score a saved reference against the world"
|
|
7356
|
+
],
|
|
7357
|
+
"summary": "Read-only spatial inspection of one evaluated terrain revision.",
|
|
7358
|
+
"supersedes": [],
|
|
7359
|
+
"symbol": "inspectSpatial"
|
|
7360
|
+
},
|
|
7361
|
+
{
|
|
7362
|
+
"aliases": [],
|
|
7363
|
+
"constraints": [
|
|
7364
|
+
"browser authoring only; createView and materialColours are required game choices"
|
|
7365
|
+
],
|
|
7366
|
+
"example": "await mountTerrainEditor({ createView: createEditorView, materialColours: terrainPalette });",
|
|
7367
|
+
"importPath": "@threenative/terrain/editor",
|
|
7368
|
+
"kind": "function",
|
|
7369
|
+
"overrides": ["createView owns the renderer scene, materials, lighting and camera"],
|
|
7370
|
+
"package": "@threenative/terrain",
|
|
7371
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
7372
|
+
"signature": "export async function mountTerrainEditor(options: { … }",
|
|
7373
|
+
"situations": ["open the terrain brush and layer GUI around game-owned rendering"],
|
|
7374
|
+
"summary": "Mount recovered terrain controls around the project-owned ThreeNative view.",
|
|
7375
|
+
"supersedes": [],
|
|
7376
|
+
"symbol": "mountTerrainEditor"
|
|
7377
|
+
},
|
|
7378
|
+
{
|
|
7379
|
+
"aliases": [],
|
|
7380
|
+
"constraints": ["authoring data only; non-finite, malformed and out-of-extent queries throw"],
|
|
7381
|
+
"example": "const probe = probeTerrain(state, revision, [12, -4]);",
|
|
7382
|
+
"importPath": "@threenative/terrain/editor",
|
|
7383
|
+
"kind": "function",
|
|
7384
|
+
"overrides": [
|
|
7385
|
+
"the caller owns the revision identity and the evaluated state being inspected"
|
|
7386
|
+
],
|
|
7387
|
+
"package": "@threenative/terrain",
|
|
7388
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
7389
|
+
"signature": "export function probeTerrain( state: ITerrainState, revision: string, at: readonly number[], ): IPointObservation { … }",
|
|
7390
|
+
"situations": ["measure an authored terrain point with provenance and a revision identity"],
|
|
7391
|
+
"summary": "Probe the evaluated surface at one world point, separating bilinear from triangle values.",
|
|
7392
|
+
"supersedes": [],
|
|
7393
|
+
"symbol": "probeTerrain"
|
|
7394
|
+
},
|
|
7395
|
+
{
|
|
7396
|
+
"aliases": [],
|
|
7397
|
+
"constraints": [
|
|
7398
|
+
"pure: the input set is never mutated, an unknown id throws, and deleting the live camera falls back"
|
|
7399
|
+
],
|
|
7400
|
+
"example": "const next = runCameraOperation(set, { op: \"activate\", id: \"survey\" });",
|
|
7401
|
+
"importPath": "@threenative/terrain/editor",
|
|
7402
|
+
"kind": "function",
|
|
7403
|
+
"overrides": ["the caller persists the returned set against its own revision"],
|
|
7404
|
+
"package": "@threenative/terrain",
|
|
7405
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
7406
|
+
"signature": "export function runCameraOperation(set: ICameraSet, operation: unknown): ICameraResult { … }",
|
|
7407
|
+
"situations": [
|
|
7408
|
+
"drive the terrain editor camera list from an agent or the GUI through one shared dispatch"
|
|
7409
|
+
],
|
|
7410
|
+
"summary": "Run one create / get / list / update / delete / activate operation over saved cameras. @summary Apply an editor camera operation to a saved camera set",
|
|
7411
|
+
"supersedes": [],
|
|
7412
|
+
"symbol": "runCameraOperation"
|
|
7413
|
+
},
|
|
7414
|
+
{
|
|
7415
|
+
"aliases": [],
|
|
7416
|
+
"constraints": ["authoring metadata only; a null field returns to the project's own value"],
|
|
7417
|
+
"example": "const result = runEnvironmentOperation({}, { op: \"patch\", values: { sun: { elevation: 25 } } });",
|
|
7418
|
+
"importPath": "@threenative/terrain/editor",
|
|
7419
|
+
"kind": "function",
|
|
7420
|
+
"overrides": ["the project's render source decides what each value does"],
|
|
7421
|
+
"package": "@threenative/terrain",
|
|
7422
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
7423
|
+
"signature": "export function runEnvironmentOperation( current: IEnvironment, operation: unknown, ): IEnvironmentResult { … }",
|
|
7424
|
+
"situations": [
|
|
7425
|
+
"patch sun, haze, exposure or sea overrides from a controller or the editor GUI"
|
|
7426
|
+
],
|
|
7427
|
+
"summary": "Apply one get / patch / reset against the saved environment overrides; the caller commits it. @summary Run one preview-environment operation",
|
|
7428
|
+
"supersedes": [],
|
|
7429
|
+
"symbol": "runEnvironmentOperation"
|
|
7430
|
+
},
|
|
7431
|
+
{
|
|
7432
|
+
"aliases": [],
|
|
7433
|
+
"constraints": [
|
|
7434
|
+
"reads only the first bytes; a file it cannot name returns undefined and must be refused"
|
|
7435
|
+
],
|
|
7436
|
+
"example": "const kind = sniff(new Uint8Array(await file.arrayBuffer()))?.kind;",
|
|
7437
|
+
"importPath": "@threenative/terrain/editor",
|
|
7438
|
+
"kind": "function",
|
|
7439
|
+
"overrides": ["the caller decides what to do with an unknown file"],
|
|
7440
|
+
"package": "@threenative/terrain",
|
|
7441
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
7442
|
+
"signature": "export function sniff( bytes: Uint8Array, ): { … }",
|
|
7443
|
+
"situations": [
|
|
7444
|
+
"decide whether a dropped or downloaded file is a model, surface image or environment image"
|
|
7445
|
+
],
|
|
7446
|
+
"summary": "The kind and format a file's own bytes declare, whatever its name says. @summary Identify a GLB, PNG, JPEG, WebP, HDR or EXR file by its header",
|
|
7447
|
+
"supersedes": [],
|
|
7448
|
+
"symbol": "sniff"
|
|
7449
|
+
},
|
|
7450
|
+
{
|
|
7451
|
+
"aliases": [],
|
|
7452
|
+
"constraints": [
|
|
7453
|
+
"throws by name for an input that is not <surface>.<channel> with a known channel"
|
|
7454
|
+
],
|
|
7455
|
+
"example": "const space = surfaceSpace(\"bark.normal\");",
|
|
7456
|
+
"importPath": "@threenative/terrain/editor",
|
|
7457
|
+
"kind": "function",
|
|
7458
|
+
"overrides": ["the project owns which surface inputs exist"],
|
|
7459
|
+
"package": "@threenative/terrain",
|
|
7460
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
7461
|
+
"signature": "export function surfaceSpace(input: string): \"srgb\" | \"linear\" { … }",
|
|
7462
|
+
"situations": ["decide how an imported image bound to a named surface input must be sampled"],
|
|
7463
|
+
"summary": "The colour space an input's pixels are read in, from the channel its name ends with. @summary Resolve a surface input name to sRGB or linear",
|
|
7464
|
+
"supersedes": [],
|
|
7465
|
+
"symbol": "surfaceSpace"
|
|
7466
|
+
},
|
|
7467
|
+
{
|
|
7468
|
+
"aliases": [],
|
|
7469
|
+
"constraints": [
|
|
7470
|
+
"optional tooling; only subscribe/mount touches DOM; stale revisions fail explicitly"
|
|
7471
|
+
],
|
|
7472
|
+
"example": "const controller = new TerrainEditorController(editorUrl); const snapshot = await controller.snapshot();",
|
|
7473
|
+
"importPath": "@threenative/terrain/editor",
|
|
7474
|
+
"kind": "class",
|
|
7475
|
+
"overrides": ["editorUrl is the activation-returned project URL"],
|
|
7476
|
+
"package": "@threenative/terrain",
|
|
7477
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
7478
|
+
"signature": "export class TerrainEditorController { … }",
|
|
7479
|
+
"situations": ["inspect and atomically edit the terrain editor from an agent"],
|
|
7480
|
+
"summary": "HTTP controller for the project-local terrain editor.",
|
|
7481
|
+
"supersedes": [],
|
|
7482
|
+
"symbol": "TerrainEditorController"
|
|
7483
|
+
},
|
|
7484
|
+
{
|
|
7485
|
+
"aliases": [],
|
|
7486
|
+
"constraints": [
|
|
7487
|
+
"authoring metadata only; ids, content-hashed paths, bounds and unit adjustments are checked, files are not read"
|
|
7488
|
+
],
|
|
7489
|
+
"example": "const asset = validateAsset({ id: \"oak\", kind: \"model\", name: \"oak.glb\", path: \"models/0123456789ab-oak.glb\", sha256: \"0123456789ab\".padEnd(64, \"0\"), bytes: 2180, status: \"ready\" });",
|
|
7490
|
+
"importPath": "@threenative/terrain/editor",
|
|
7491
|
+
"kind": "function",
|
|
7492
|
+
"overrides": ["the project owns its asset directory and which entries it keeps"],
|
|
7493
|
+
"package": "@threenative/terrain",
|
|
7494
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
7495
|
+
"signature": "export function validateAsset(input: unknown): IProjectAsset { … }",
|
|
7496
|
+
"situations": [
|
|
7497
|
+
"check a model, image or environment asset entry before saving it in the authoring document"
|
|
7498
|
+
],
|
|
7499
|
+
"summary": "Validate one saved asset registration exactly as a document commit stores it. @summary Validate a registered terrain-editor asset entry",
|
|
7500
|
+
"supersedes": [],
|
|
7501
|
+
"symbol": "validateAsset"
|
|
7502
|
+
},
|
|
7503
|
+
{
|
|
7504
|
+
"aliases": [],
|
|
7505
|
+
"constraints": ["at most 64 entries; unique ids; each entry as validateAsset"],
|
|
7506
|
+
"example": "const assets = validateAssets(document.assets ?? []);",
|
|
7507
|
+
"importPath": "@threenative/terrain/editor",
|
|
7508
|
+
"kind": "function",
|
|
7509
|
+
"overrides": ["the project owns its asset directory and which entries it keeps"],
|
|
7510
|
+
"package": "@threenative/terrain",
|
|
7511
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
7512
|
+
"signature": "export function validateAssets(input: unknown): IProjectAsset[] { … }",
|
|
7513
|
+
"situations": [
|
|
7514
|
+
"check every registered model, image and environment entry together, with unique ids"
|
|
7515
|
+
],
|
|
7516
|
+
"summary": "Validate the whole asset list of an authoring document. @summary Validate the registered terrain-editor assets",
|
|
7517
|
+
"supersedes": [],
|
|
7518
|
+
"symbol": "validateAssets"
|
|
7519
|
+
},
|
|
7520
|
+
{
|
|
7521
|
+
"aliases": [],
|
|
7522
|
+
"constraints": [
|
|
7523
|
+
"authoring metadata only; finite noncoincident poses, usable up, valid projection, ordered planes"
|
|
7524
|
+
],
|
|
7525
|
+
"example": "const camera = validateCamera({ id: \"survey\", name: \"Survey\", position: [40, 60, 40], target: [0, 12, 0], up: [0, 1, 0], projection: \"perspective\", fov: 50, near: 0.5, far: 900 });",
|
|
7526
|
+
"importPath": "@threenative/terrain/editor",
|
|
7527
|
+
"kind": "function",
|
|
7528
|
+
"overrides": ["the caller owns the document revision and the live viewport aspect"],
|
|
7529
|
+
"package": "@threenative/terrain",
|
|
7530
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
7531
|
+
"signature": "export function validateCamera( input: unknown, existing: readonly ISavedCamera[] = [], ): ISavedCamera { … }",
|
|
7532
|
+
"situations": [
|
|
7533
|
+
"create or update a named terrain-editor camera in the shared authoring document"
|
|
7534
|
+
],
|
|
7535
|
+
"summary": "Normalise and validate one saved camera, exactly as a document commit would store it. @summary Validate an editor observation camera bookmark",
|
|
7536
|
+
"supersedes": [],
|
|
7537
|
+
"symbol": "validateCamera"
|
|
7538
|
+
},
|
|
7539
|
+
{
|
|
7540
|
+
"aliases": [],
|
|
7541
|
+
"constraints": ["authoring metadata only; the same validation the camera operations apply"],
|
|
7542
|
+
"example": "const cameras = validateCameras(JSON.parse(saved).cameras ?? []);",
|
|
7543
|
+
"importPath": "@threenative/terrain/editor",
|
|
7544
|
+
"kind": "function",
|
|
7545
|
+
"overrides": [
|
|
7546
|
+
"the document owns how many cameras it keeps; the list bound is the editor's own"
|
|
7547
|
+
],
|
|
7548
|
+
"package": "@threenative/terrain",
|
|
7549
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
7550
|
+
"signature": "export function validateCameras(input: unknown): ISavedCamera[] { … }",
|
|
7551
|
+
"situations": ["reject a disk document whose saved cameras are malformed or duplicated"],
|
|
7552
|
+
"summary": "Validate a document's saved camera list, keeping ids unique across it. @summary Validate the saved editor camera list of an authoring document",
|
|
7553
|
+
"supersedes": [],
|
|
7554
|
+
"symbol": "validateCameras"
|
|
7555
|
+
},
|
|
7556
|
+
{
|
|
7557
|
+
"aliases": [],
|
|
7558
|
+
"constraints": [
|
|
7559
|
+
"authoring metadata only; unknown fields and unsupported fog modes are refused by name"
|
|
7560
|
+
],
|
|
7561
|
+
"example": "const environment = validateEnvironment({ sun: { elevation: 25, intensity: 3 } });",
|
|
7562
|
+
"importPath": "@threenative/terrain/editor",
|
|
7563
|
+
"kind": "function",
|
|
7564
|
+
"overrides": [
|
|
7565
|
+
"the project's render source defines what each value does; absent fields keep its own"
|
|
7566
|
+
],
|
|
7567
|
+
"package": "@threenative/terrain",
|
|
7568
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
7569
|
+
"signature": "export function validateEnvironment(input: unknown): IEnvironment { … }",
|
|
7570
|
+
"situations": [
|
|
7571
|
+
"save sun, sky, haze, exposure or ocean overrides in the shared authoring document"
|
|
7572
|
+
],
|
|
7573
|
+
"summary": "Validate a complete overrides object exactly as a document commit stores it. @summary Validate preview environment overrides",
|
|
7574
|
+
"supersedes": [],
|
|
7575
|
+
"symbol": "validateEnvironment"
|
|
7576
|
+
},
|
|
7577
|
+
{
|
|
7578
|
+
"aliases": [],
|
|
7579
|
+
"constraints": [
|
|
7580
|
+
"authoring metadata only; rejects unknown fields, malformed points and unknown scale"
|
|
7581
|
+
],
|
|
7582
|
+
"example": "const reference = validateSpatialReference(JSON.parse(saved));",
|
|
7583
|
+
"importPath": "@threenative/terrain/editor",
|
|
7584
|
+
"kind": "function",
|
|
7585
|
+
"overrides": [
|
|
7586
|
+
"a project owns the image file; only its hash and provenance travel in the document"
|
|
7587
|
+
],
|
|
7588
|
+
"package": "@threenative/terrain",
|
|
7589
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
7590
|
+
"signature": "export function validateSpatialReference(input: unknown): ISavedSpatialReference { … }",
|
|
7591
|
+
"situations": [
|
|
7592
|
+
"accept a bounded local reference image registration into the shared document"
|
|
7593
|
+
],
|
|
7594
|
+
"summary": "Normalise and validate one saved reference, exactly as a document commit would store it.",
|
|
7595
|
+
"supersedes": [],
|
|
7596
|
+
"symbol": "validateSpatialReference"
|
|
7597
|
+
},
|
|
7598
|
+
{
|
|
7599
|
+
"aliases": [],
|
|
7600
|
+
"constraints": [
|
|
7601
|
+
"authoring metadata only; each input is <surface>.<channel>; every asset must be a registered image"
|
|
7602
|
+
],
|
|
7603
|
+
"example": "const surfaces = validateSurfaces({ \"bark.normal\": { asset: \"my-normal\" } }, document.assets ?? []);",
|
|
7604
|
+
"importPath": "@threenative/terrain/editor",
|
|
7605
|
+
"kind": "function",
|
|
7606
|
+
"overrides": [
|
|
7607
|
+
"the project's render source defines which surface inputs exist and what they draw"
|
|
7608
|
+
],
|
|
7609
|
+
"package": "@threenative/terrain",
|
|
7610
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
7611
|
+
"signature": "export function validateSurfaces( input: unknown, assets: readonly IProjectAsset[], ): ISurfaceMappings { … }",
|
|
7612
|
+
"situations": [
|
|
7613
|
+
"save which imported PBR image replaces which named surface input of the project's render source"
|
|
7614
|
+
],
|
|
7615
|
+
"summary": "Validate surface mappings against the registered images they name. @summary Validate terrain-editor surface image mappings",
|
|
7616
|
+
"supersedes": [],
|
|
7617
|
+
"symbol": "validateSurfaces"
|
|
7618
|
+
},
|
|
7619
|
+
{
|
|
7620
|
+
"aliases": [],
|
|
7621
|
+
"constraints": [
|
|
7622
|
+
"dev tooling only; serve a project-owned /terrain-editor/index.html; no runtime import"
|
|
7623
|
+
],
|
|
7624
|
+
"example": "const editor = terrainEditor({ documentPath: resolve(\"terrain/world.json\") });",
|
|
7625
|
+
"importPath": "@threenative/terrain/editor/server",
|
|
7626
|
+
"kind": "function",
|
|
7627
|
+
"overrides": ["documentPath and optional configured viewerUrl belong to the project"],
|
|
7628
|
+
"package": "@threenative/terrain",
|
|
7629
|
+
"requires": ["npm i -D @threenative/terrain vite"],
|
|
7630
|
+
"signature": "export function terrainEditor(options: { … }",
|
|
7631
|
+
"situations": ["share terrain recipe edits between an agent and the live terrain editor"],
|
|
7632
|
+
"summary": "Mount the optional terrain document API on an existing loopback Vite server.",
|
|
7633
|
+
"supersedes": [],
|
|
7634
|
+
"symbol": "terrainEditor"
|
|
7635
|
+
},
|
|
7636
|
+
{
|
|
7637
|
+
"aliases": [],
|
|
7638
|
+
"constraints": [
|
|
7639
|
+
"Node authoring only; documentPath is a configured absolute regular file; input is bounded to 64 MiB"
|
|
7640
|
+
],
|
|
7641
|
+
"example": "const document = new TerrainEditorDocument(\"/project/terrain/world.json\"); const snapshot = document.snapshot();",
|
|
7642
|
+
"importPath": "@threenative/terrain/editor/server",
|
|
7643
|
+
"kind": "class",
|
|
7644
|
+
"overrides": ["the project chooses its document path; revisions come from validated content"],
|
|
7645
|
+
"package": "@threenative/terrain",
|
|
7646
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
7647
|
+
"signature": "export class TerrainEditorDocument { … }",
|
|
7648
|
+
"situations": ["validate atomic revision-based project-local terrain document edits"],
|
|
7649
|
+
"summary": "Project-local terrain document authority; no renderer or game dependency.",
|
|
7650
|
+
"supersedes": [],
|
|
7651
|
+
"symbol": "TerrainEditorDocument"
|
|
7652
|
+
},
|
|
7653
|
+
{
|
|
7654
|
+
"aliases": [],
|
|
7655
|
+
"constraints": [
|
|
7656
|
+
"browser authoring (FileReader/canvas); caller supplies all appearance and coherent baked water; root and /three remain headless"
|
|
7657
|
+
],
|
|
7658
|
+
"example": "const output = await exportWorldGLB({ revision, snapshotTime: 0, state, terrain, assets, transforms });",
|
|
7659
|
+
"importPath": "@threenative/terrain/export",
|
|
7660
|
+
"kind": "function",
|
|
7661
|
+
"overrides": [
|
|
7662
|
+
"actual static models, final matrices and baked PBR maps are supplied by the game"
|
|
7663
|
+
],
|
|
7664
|
+
"package": "@threenative/terrain",
|
|
7665
|
+
"requires": ["npm i -D @threenative/terrain"],
|
|
7666
|
+
"signature": "export async function exportWorldGLB(input: IWorldGLBInput): Promise<IWorldGLBExport> { … }",
|
|
7667
|
+
"situations": [
|
|
7668
|
+
"export terrain, resolved models and final manual placement transforms as a portable GLB",
|
|
7669
|
+
"export the whole terrain world as one glb for another three.js project"
|
|
7670
|
+
],
|
|
7671
|
+
"summary": "Export a committed evaluated world using ordinary glTF 2.0 nodes and embedded PBR images.",
|
|
7672
|
+
"supersedes": [],
|
|
7673
|
+
"symbol": "exportWorldGLB"
|
|
7674
|
+
},
|
|
7675
|
+
{
|
|
7676
|
+
"aliases": [],
|
|
7677
|
+
"constraints": ["creates only geometry; the caller owns its material, scene and disposal"],
|
|
7678
|
+
"example": "const geometry = toGeometry(bakeMesh(new Terrain({ resolution: 17 }).evaluate()));",
|
|
7679
|
+
"importPath": "@threenative/terrain/three",
|
|
7680
|
+
"kind": "function",
|
|
7681
|
+
"overrides": ["every surface choice remains in game source"],
|
|
7682
|
+
"package": "@threenative/terrain",
|
|
7683
|
+
"requires": ["npm i @threenative/terrain"],
|
|
7684
|
+
"signature": "export function toGeometry(mesh: IBakedMesh): BufferGeometry { … }",
|
|
7685
|
+
"situations": ["put an authored terrain mesh in a game-owned Three.js scene"],
|
|
7686
|
+
"summary": "Converts baked arrays to ordinary geometry using the consumer's installed Three.js.",
|
|
7687
|
+
"supersedes": [],
|
|
7688
|
+
"symbol": "toGeometry"
|
|
7689
|
+
},
|
|
6400
7690
|
{
|
|
6401
7691
|
"aliases": [],
|
|
6402
7692
|
"constraints": [
|
|
@@ -6530,6 +7820,7 @@
|
|
|
6530
7820
|
"kind": "function",
|
|
6531
7821
|
"overrides": [],
|
|
6532
7822
|
"package": "@threenative/ui",
|
|
7823
|
+
"requires": ["npm i @threenative/ui"],
|
|
6533
7824
|
"signature": "export function DebugOverlay() { … }",
|
|
6534
7825
|
"situations": [
|
|
6535
7826
|
"display runtime and playtest diagnostics in a React HUD",
|
|
@@ -6549,6 +7840,7 @@
|
|
|
6549
7840
|
"kind": "function",
|
|
6550
7841
|
"overrides": [],
|
|
6551
7842
|
"package": "@threenative/ui",
|
|
7843
|
+
"requires": ["npm i @threenative/ui"],
|
|
6552
7844
|
"signature": "export function GameCanvas<TState extends Record<string, unknown>, TPhysics>( { … }",
|
|
6553
7845
|
"situations": [
|
|
6554
7846
|
"add a game viewport to a React application",
|
|
@@ -6566,6 +7858,7 @@
|
|
|
6566
7858
|
"kind": "function",
|
|
6567
7859
|
"overrides": [],
|
|
6568
7860
|
"package": "@threenative/ui",
|
|
7861
|
+
"requires": ["npm i @threenative/ui"],
|
|
6569
7862
|
"signature": "export function UiLayer( { … }",
|
|
6570
7863
|
"situations": [
|
|
6571
7864
|
"write one HUD that looks the same on the web build and on a phone",
|
|
@@ -6583,6 +7876,7 @@
|
|
|
6583
7876
|
"kind": "function",
|
|
6584
7877
|
"overrides": [],
|
|
6585
7878
|
"package": "@threenative/ui",
|
|
7879
|
+
"requires": ["npm i @threenative/ui"],
|
|
6586
7880
|
"signature": "export function useGameState<TState extends Record<string, unknown>, TPhysics, TSelected>( game: IGame<TState, TPhysics>, selector: GameSelector<TState, TSelected>, ): TSelected;",
|
|
6587
7881
|
"situations": [
|
|
6588
7882
|
"bind a HUD component to game state",
|
|
@@ -6600,6 +7894,7 @@
|
|
|
6600
7894
|
"kind": "function",
|
|
6601
7895
|
"overrides": [],
|
|
6602
7896
|
"package": "@threenative/ui",
|
|
7897
|
+
"requires": ["npm i @threenative/ui"],
|
|
6603
7898
|
"signature": "export function useUiIntent(): (intent: string, payload?: unknown) => void { … }",
|
|
6604
7899
|
"situations": [
|
|
6605
7900
|
"wire a Restart button in a HUD to the running game",
|
|
@@ -6617,6 +7912,7 @@
|
|
|
6617
7912
|
"kind": "function",
|
|
6618
7913
|
"overrides": [],
|
|
6619
7914
|
"package": "@threenative/ui",
|
|
7915
|
+
"requires": ["npm i @threenative/ui"],
|
|
6620
7916
|
"signature": "export function useUiState<TState extends object>(): TState | undefined;",
|
|
6621
7917
|
"situations": [
|
|
6622
7918
|
"bind a HUD to game state on web and native alike",
|
|
@@ -6626,6 +7922,35 @@
|
|
|
6626
7922
|
"supersedes": [],
|
|
6627
7923
|
"symbol": "useUiState"
|
|
6628
7924
|
},
|
|
7925
|
+
{
|
|
7926
|
+
"symbol": "createStormAudio",
|
|
7927
|
+
"package": "template:rain",
|
|
7928
|
+
"importPath": "src/audio/storm.ts",
|
|
7929
|
+
"kind": "function",
|
|
7930
|
+
"signature": "createStormAudio(ctx: ICtx<GameState>): IStormAudio",
|
|
7931
|
+
"summary": "The storm's sound as generated source, mixed through the engine's own `AudioBus`: a rain hiss, a wind bed, and thunder queued strike by strike and delayed and filtered by how far away it was struck.",
|
|
7932
|
+
"situations": [
|
|
7933
|
+
"rain hiss, wind bed, thunder, a storm you can hear",
|
|
7934
|
+
"delay thunder by the distance it was struck",
|
|
7935
|
+
"sound that follows pause, mute and tab visibility",
|
|
7936
|
+
"audio that queues strikes instead of cutting each other off"
|
|
7937
|
+
],
|
|
7938
|
+
"example": "src/audio/storm.ts — register the returned helper, call update(state) after advancing the simulation, and dispose it with the owning scene",
|
|
7939
|
+
"constraints": [
|
|
7940
|
+
"`queueStrike({ at, metres })` queues: a second strike does not overwrite one still crossing the air, and `at` is absolute simulation time, which is what lets a strike survive a freeze.",
|
|
7941
|
+
"Two holds, kept apart so neither latches the other: `setSilenced` is the game's own pause intent, `setHidden` is the UI realm or engine lifecycle visibility. The bus is released only when both are clear.",
|
|
7942
|
+
"`update(state)` is the frame's truth and is called once per frame after the simulation advances; `debug()` is what a playtest reads back.",
|
|
7943
|
+
"The caller owns entity registration, updates and disposal; creating the helper does not register it.",
|
|
7944
|
+
"Audio begins only after a user gesture — the bus's unlock error is surfaced rather than swallowed.",
|
|
7945
|
+
"The three clips are baked by `tools/make-storm-audio.mjs` from the study's own maths; this file plays them, it does not synthesise them live.",
|
|
7946
|
+
"The helper requests the source's compressor settings ahead of master gain: threshold -15 dB, knee 30 dB, ratio 5, attack 0.003 s and release 0.25 s.",
|
|
7947
|
+
"Each thunder voice is a labelled `thunder` cue, so a playtest's `audio` assertion reads it from the runtime ledger; the rain kit's `playtests/lightning.playtest.json` proves one cue after a strike, sounded only once the strike's `distance / 343` delay had passed.",
|
|
7948
|
+
"This entry describes the Rain starter scaffold's own generated `src/audio/storm.ts`, not a `@threenative/` or three export — there is no installed package to import it from."
|
|
7949
|
+
],
|
|
7950
|
+
"overrides": [],
|
|
7951
|
+
"supersedes": [],
|
|
7952
|
+
"aliases": []
|
|
7953
|
+
},
|
|
6629
7954
|
{
|
|
6630
7955
|
"symbol": "renderer.matrixWorld",
|
|
6631
7956
|
"package": "@threenative/core",
|
|
@@ -6721,6 +8046,107 @@
|
|
|
6721
8046
|
"supersedes": [],
|
|
6722
8047
|
"aliases": []
|
|
6723
8048
|
},
|
|
8049
|
+
{
|
|
8050
|
+
"symbol": "createStormLightning",
|
|
8051
|
+
"package": "template:rain",
|
|
8052
|
+
"importPath": "src/render/lightning.ts",
|
|
8053
|
+
"kind": "function",
|
|
8054
|
+
"signature": "createStormLightning(scene: Scene, camera: PerspectiveCamera): IStormLightning",
|
|
8055
|
+
"summary": "A branching lightning bolt as generated Rain source: `makeBolt(end, random)` walks a 30-segment channel down from the cloud deck with side branches, and one additive camera-facing ribbon draw (gaussian core inside a wide halo) shows it while the caller's flash envelope is above zero. `strike(position, random)` returns where the bolt entered the sky.",
|
|
8056
|
+
"situations": [
|
|
8057
|
+
"generate branching lightning ribbon geometry",
|
|
8058
|
+
"a lightning strike that lights the scene and the clouds",
|
|
8059
|
+
"a camera-facing ribbon or beam that stays the same pixel width at any distance",
|
|
8060
|
+
"a flash envelope that stutters rather than fades once"
|
|
8061
|
+
],
|
|
8062
|
+
"example": "src/render/lightning.ts — the bolt; src/state.ts `flashAt` for the envelope; src/scenes/Boot.ts strike() for the thunder delay",
|
|
8063
|
+
"constraints": [
|
|
8064
|
+
"Pass the game's seeded random so a strike is reproducible; a non-finite position or random value throws rather than drawing NaN geometry.",
|
|
8065
|
+
"The buffers hold the worst case (30 channel segments plus 24 branches of 9) and are allocated once; a strike rewrites them and opens the draw range, never reallocating.",
|
|
8066
|
+
"`update(flash)` takes an envelope already gated on photosensitivity mode by the caller; below 0.003 the mesh is hidden. Register it with `alwaysRender`: its quads are projected by its own vertex stage, so its bounds say nothing about where it lands.",
|
|
8067
|
+
"It depth-tests against the coast's written depth, so a bolt behind the headland is hidden by it.",
|
|
8068
|
+
"This entry describes the Rain starter scaffold's own generated `src/render/lightning.ts`, not a `@threenative/` or three export — there is no installed package to import it from."
|
|
8069
|
+
],
|
|
8070
|
+
"overrides": [],
|
|
8071
|
+
"supersedes": [],
|
|
8072
|
+
"aliases": []
|
|
8073
|
+
},
|
|
8074
|
+
{
|
|
8075
|
+
"symbol": "createNoiseVolume",
|
|
8076
|
+
"package": "template:rain",
|
|
8077
|
+
"importPath": "src/render/noise-volume.ts",
|
|
8078
|
+
"kind": "function",
|
|
8079
|
+
"signature": "createNoiseVolume(): INoiseVolume",
|
|
8080
|
+
"summary": "The 64³ RGBA cloud noise volume as generated Rain source: `{ data: Uint8Array, texture: Data3DTexture }`. Its authored seed, octave weights and source-exact generator define the storm's cloud shapes.",
|
|
8081
|
+
"situations": [
|
|
8082
|
+
"generate a 3D noise volume instead of shipping one as an asset",
|
|
8083
|
+
"rebuild the storm's clouds procedurally at startup",
|
|
8084
|
+
"tileable 3D noise that does not crease at the edges",
|
|
8085
|
+
"four octave scales packed into one texture"
|
|
8086
|
+
],
|
|
8087
|
+
"example": "src/render/noise-volume.ts — edit the seed, the lattices or the channel weights there",
|
|
8088
|
+
"constraints": [
|
|
8089
|
+
"Seed 13291 uses the source's mulberry32 sequence. The generated volume matches all 1,048,576 reference bytes; changing the authored seed or generator changes its appearance.",
|
|
8090
|
+
"Two distinct failure channels, not one: `TN_NOISE_CHANNEL` is a channel value that does not fit a byte, `TN_NOISE_LENGTH` is a byte count that does not fill the volume. Both throw rather than uploading a volume the shader would read wrong.",
|
|
8091
|
+
"64³ of RGBA is 1 MiB, and `NOISE_SIZE` is what the loops and the byte count are written against; changing the size changes the memory cost with it.",
|
|
8092
|
+
"Indices wrap at every face, which is what makes the volume tile, and the fractional part is smoothed by `f²(3 − 2f)` so lattice edges do not show as creases in the cloud.",
|
|
8093
|
+
"This entry describes the Rain starter scaffold's own generated `src/render/noise-volume.ts`, not a `@threenative/` or three export — there is no installed package to import it from."
|
|
8094
|
+
],
|
|
8095
|
+
"overrides": [],
|
|
8096
|
+
"supersedes": [],
|
|
8097
|
+
"aliases": []
|
|
8098
|
+
},
|
|
8099
|
+
{
|
|
8100
|
+
"symbol": "createStormRain",
|
|
8101
|
+
"package": "template:rain",
|
|
8102
|
+
"importPath": "src/render/rain.ts",
|
|
8103
|
+
"kind": "function",
|
|
8104
|
+
"signature": "createStormRain(scene: Scene, camera: PerspectiveCamera): IStormRain",
|
|
8105
|
+
"summary": "Camera-anchored falling rain as generated Rain source: one instanced draw whose vertex stage hashes each drop from its index, wraps it in a 66 × 30 × 66 m cell that follows the camera in 12 m steps, and projects a quad stretched along its own fall — no particle simulation, no texture.",
|
|
8106
|
+
"situations": [
|
|
8107
|
+
"rain streaks around the camera",
|
|
8108
|
+
"thousands of falling drops in one draw",
|
|
8109
|
+
"rain that leans with the wind and lights up in a lightning flash"
|
|
8110
|
+
],
|
|
8111
|
+
"example": "src/render/rain.ts — the drop maths; `STUDY_TIERS` in src/render/quality.ts for the per-tier budget",
|
|
8112
|
+
"constraints": [
|
|
8113
|
+
"The drawn count is `round(rainBudget × weather.rain)` for the tier, read back from `geometry.instanceCount` (`instanceCount`), not from the budget.",
|
|
8114
|
+
"Stateless by design: a drop's position is a function of its index and the clock, so pausing the clock freezes the rain and nothing accumulates. `GPUParticles3D` is the engine's emitter with lifetimes; reach for it when drops must spawn, live and die.",
|
|
8115
|
+
"Register it with `alwaysRender`: the vertex stage places every drop, so the geometry's own bounds do not.",
|
|
8116
|
+
"This entry describes the Rain starter scaffold's own generated `src/render/rain.ts`, not a `@threenative/` or three export — there is no installed package to import it from."
|
|
8117
|
+
],
|
|
8118
|
+
"overrides": [],
|
|
8119
|
+
"supersedes": [],
|
|
8120
|
+
"aliases": []
|
|
8121
|
+
},
|
|
8122
|
+
{
|
|
8123
|
+
"symbol": "createWeatherWorld",
|
|
8124
|
+
"package": "template:rain",
|
|
8125
|
+
"importPath": "src/render/world.ts",
|
|
8126
|
+
"kind": "function",
|
|
8127
|
+
"signature": "createWeatherWorld(scene: Scene, camera: PerspectiveCamera): IWeatherWorld",
|
|
8128
|
+
"summary": "The raymarched coastal storm as generated source: one screen quad whose TSL shader draws the sky, the sea, the coast, the road, the forest and the lamps, and whose wet ground reflects them, written from the uniforms the game feeds it each frame. The sky it samples is the live cloud pass this call builds, not a stand-in gradient. Returns `{ quad, update(options), dispose() }`.",
|
|
8129
|
+
"situations": [
|
|
8130
|
+
"a procedural storm, sea, coastline or open horizon drawn from maths rather than geometry",
|
|
8131
|
+
"rain and wind that change how a scene looks without swapping a mesh",
|
|
8132
|
+
"a lightning flash that lights the coast and the sky at once",
|
|
8133
|
+
"wet reflections on a ground plane",
|
|
8134
|
+
"sky that darkens as cloud cover rises"
|
|
8135
|
+
],
|
|
8136
|
+
"example": "src/render/world.ts — edit the shader there, or the weather it is fed from src/state.ts",
|
|
8137
|
+
"constraints": [
|
|
8138
|
+
"`update` takes `{ elapsed, flash, weather, strike, quality }`: absolute seconds, a flash envelope already gated on the photosensitivity switch by the caller, the bolt's entry point in the cloud deck in metres (what the clouds glow around and the coast is lit from), and a quality name of `performance | balanced | high | ultra`.",
|
|
8139
|
+
"The tier's cloud resolution share, march steps and reflection switch come from `STUDY_TIERS` in src/render/quality.ts; `performance` skips the 36-step reflection march, so a low tier loses reflections, not the coast. `clouds()` reads back the cloud target the renderer really drew and its steps.",
|
|
8140
|
+
"Its colours and lights are uniforms set once from src/render/palette.ts, sky.ts, lighting.ts and materials.ts; the shader itself is generated from tools/tempest-*.frag by tools/generate-shaders.mjs — edit the .frag, not the generated file.",
|
|
8141
|
+
"The engine's `Scene` and `PerspectiveCamera` are injected as arguments; the file holds no engine lifetime of its own. `dispose()` removes the quad and disposes the geometry, material and sky texture — the scene does not do it for you.",
|
|
8142
|
+
"The quad has `frustumCulled = false`, because its two-metre bounds would otherwise be culled the moment the camera looks along the coast.",
|
|
8143
|
+
"The cloud pass is built first and its texture feeds the world shader (sampled with the render-target flip); `update` also drives the clouds. Rain streaks and the bolt are separate draws: `createStormRain`, `createStormLightning`.",
|
|
8144
|
+
"This entry describes the Rain starter scaffold's own generated `src/render/world.ts`, not a `@threenative/` or three export — there is no installed package to import it from. Appearance lives in that source with no package import at all; nothing in packages/ decides how this storm looks."
|
|
8145
|
+
],
|
|
8146
|
+
"overrides": [],
|
|
8147
|
+
"supersedes": [],
|
|
8148
|
+
"aliases": []
|
|
8149
|
+
},
|
|
6724
8150
|
{
|
|
6725
8151
|
"symbol": "WorldEnvironment",
|
|
6726
8152
|
"package": "three",
|