tosijs-3d 0.8.14 → 0.9.0

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.
Files changed (135) hide show
  1. package/CHANGELOG.md +222 -0
  2. package/Migration.md +93 -1
  3. package/dist/angle-field.d.ts +2 -2
  4. package/dist/angle-field.d.ts.map +1 -1
  5. package/dist/atmosphere.d.ts +8 -0
  6. package/dist/atmosphere.d.ts.map +1 -1
  7. package/dist/atmosphere.js +11 -2
  8. package/dist/atmosphere.js.map +1 -1
  9. package/dist/b3d-biped.d.ts +2 -0
  10. package/dist/b3d-biped.d.ts.map +1 -1
  11. package/dist/b3d-biped.js +49 -5
  12. package/dist/b3d-biped.js.map +1 -1
  13. package/dist/b3d-cloud-deck.d.ts.map +1 -1
  14. package/dist/b3d-cloud-deck.js +4 -2
  15. package/dist/b3d-cloud-deck.js.map +1 -1
  16. package/dist/b3d-decorator.d.ts +34 -3
  17. package/dist/b3d-decorator.d.ts.map +1 -1
  18. package/dist/b3d-decorator.js +211 -18
  19. package/dist/b3d-decorator.js.map +1 -1
  20. package/dist/b3d-galaxy.d.ts +1 -1
  21. package/dist/b3d-galaxy.js +1 -1
  22. package/dist/b3d-lightning.js +1 -1
  23. package/dist/b3d-manipulator.d.ts +2 -2
  24. package/dist/b3d-manipulator.d.ts.map +1 -1
  25. package/dist/b3d-manipulator.js +3 -3
  26. package/dist/b3d-manipulator.js.map +1 -1
  27. package/dist/b3d-quality.d.ts +10 -0
  28. package/dist/b3d-quality.d.ts.map +1 -1
  29. package/dist/b3d-quality.js +12 -0
  30. package/dist/b3d-quality.js.map +1 -1
  31. package/dist/b3d-reflections.d.ts.map +1 -1
  32. package/dist/b3d-reflections.js +4 -2
  33. package/dist/b3d-reflections.js.map +1 -1
  34. package/dist/b3d-shadows.d.ts.map +1 -1
  35. package/dist/b3d-shadows.js +7 -3
  36. package/dist/b3d-shadows.js.map +1 -1
  37. package/dist/b3d-skybox.d.ts.map +1 -1
  38. package/dist/b3d-skybox.js +59 -1
  39. package/dist/b3d-skybox.js.map +1 -1
  40. package/dist/b3d-ssao-projected.d.ts.map +1 -1
  41. package/dist/b3d-ssao-projected.js +0 -1
  42. package/dist/b3d-ssao-projected.js.map +1 -1
  43. package/dist/b3d-terrain.d.ts +2 -0
  44. package/dist/b3d-terrain.d.ts.map +1 -1
  45. package/dist/b3d-terrain.js +56 -14
  46. package/dist/b3d-terrain.js.map +1 -1
  47. package/dist/b3d-trigger.d.ts +2 -2
  48. package/dist/b3d-trigger.d.ts.map +1 -1
  49. package/dist/b3d-trigger.js +4 -4
  50. package/dist/b3d-trigger.js.map +1 -1
  51. package/dist/b3d-water.d.ts +27 -0
  52. package/dist/b3d-water.d.ts.map +1 -1
  53. package/dist/b3d-water.js +332 -8
  54. package/dist/b3d-water.js.map +1 -1
  55. package/dist/biome-chart.d.ts +21 -0
  56. package/dist/biome-chart.d.ts.map +1 -1
  57. package/dist/biome-chart.js +38 -0
  58. package/dist/biome-chart.js.map +1 -1
  59. package/dist/biome-plugin.d.ts +40 -0
  60. package/dist/biome-plugin.d.ts.map +1 -1
  61. package/dist/biome-plugin.js +140 -5
  62. package/dist/biome-plugin.js.map +1 -1
  63. package/dist/box.d.ts +2 -2
  64. package/dist/box.d.ts.map +1 -1
  65. package/dist/cloud-field.d.ts.map +1 -1
  66. package/dist/cloud-field.js +14 -4
  67. package/dist/cloud-field.js.map +1 -1
  68. package/dist/color-field.d.ts +1 -1
  69. package/dist/color-field.d.ts.map +1 -1
  70. package/dist/curve-field.d.ts +2 -2
  71. package/dist/curve-field.d.ts.map +1 -1
  72. package/dist/footprint-field.d.ts +2 -2
  73. package/dist/footprint-field.d.ts.map +1 -1
  74. package/dist/galaxy-data.d.ts +1 -1
  75. package/dist/galaxy-data.js +1 -1
  76. package/dist/handler-of.js +2 -2
  77. package/dist/handler-of.js.map +1 -1
  78. package/dist/index.d.ts +7 -5
  79. package/dist/index.d.ts.map +1 -1
  80. package/dist/index.js +6 -4
  81. package/dist/index.js.map +1 -1
  82. package/dist/keyboard.d.ts +8 -8
  83. package/dist/keyboard.d.ts.map +1 -1
  84. package/dist/land-and-sky.js +82 -23
  85. package/dist/land-and-sky.js.map +1 -1
  86. package/dist/landform.d.ts +0 -7
  87. package/dist/landform.d.ts.map +1 -1
  88. package/dist/landform.js +32 -24
  89. package/dist/landform.js.map +1 -1
  90. package/dist/perf-probe.d.ts +17 -0
  91. package/dist/perf-probe.d.ts.map +1 -1
  92. package/dist/perf-probe.js +7 -0
  93. package/dist/perf-probe.js.map +1 -1
  94. package/dist/picker.d.ts +1 -1
  95. package/dist/picker.d.ts.map +1 -1
  96. package/dist/procedural-rock.d.ts +35 -0
  97. package/dist/procedural-rock.d.ts.map +1 -0
  98. package/dist/procedural-rock.js +259 -0
  99. package/dist/procedural-rock.js.map +1 -0
  100. package/dist/scatter.d.ts +93 -2
  101. package/dist/scatter.d.ts.map +1 -1
  102. package/dist/scatter.js +416 -62
  103. package/dist/scatter.js.map +1 -1
  104. package/dist/scene-schemas.d.ts.map +1 -1
  105. package/dist/scene-schemas.js +21 -3
  106. package/dist/scene-schemas.js.map +1 -1
  107. package/dist/surface.d.ts +1 -1
  108. package/dist/surface.d.ts.map +1 -1
  109. package/dist/table.d.ts +2 -2
  110. package/dist/table.d.ts.map +1 -1
  111. package/dist/terrain-editor.d.ts +1 -1
  112. package/dist/terrain-editor.d.ts.map +1 -1
  113. package/dist/theme-editor.d.ts +1 -1
  114. package/dist/theme-editor.d.ts.map +1 -1
  115. package/dist/tosi-b3d.d.ts +1 -1
  116. package/dist/tosi-b3d.d.ts.map +1 -1
  117. package/dist/tosi-b3d.js +12 -0
  118. package/dist/tosi-b3d.js.map +1 -1
  119. package/dist/vector-field.d.ts +1 -1
  120. package/dist/vector-field.d.ts.map +1 -1
  121. package/dist/water-shore-shader.d.ts +24 -0
  122. package/dist/water-shore-shader.d.ts.map +1 -0
  123. package/dist/water-shore-shader.js +241 -0
  124. package/dist/water-shore-shader.js.map +1 -0
  125. package/dist/water-shore.d.ts +100 -0
  126. package/dist/water-shore.d.ts.map +1 -0
  127. package/dist/water-shore.js +374 -0
  128. package/dist/water-shore.js.map +1 -0
  129. package/dist/widgets3d.d.ts +9 -28
  130. package/dist/widgets3d.d.ts.map +1 -1
  131. package/dist/widgets3d.js +29 -4
  132. package/dist/widgets3d.js.map +1 -1
  133. package/package.json +2 -1
  134. package/static/attributes.json +104 -5
  135. package/static/attributes.txt +29 -4
package/CHANGELOG.md CHANGED
@@ -6,6 +6,228 @@ All notable changes to **tosijs-3d**. This project is pre-1.0 (`0.x`), so minor
6
6
  versions may carry breaking peer-dependency changes — each is called out in a
7
7
  **⚠️ Breaking** block in its version section below, with what a consumer must do.
8
8
 
9
+ ## 0.9.0
10
+
11
+ **A sea that knows its shore, and a temperature that means one.** The water
12
+ takes the depth and the distance to land from the terrain and draws surf that
13
+ runs in, pale shallows and sea ice; solid ice is solid for everything in the
14
+ scene. Temperature is now a real scale (0 is 0 °C, 1 is 50 °C), so the same
15
+ dial reaches Titan and Venus.
16
+
17
+ Size: barrel (min, packages external) 948.5 KB raw / 318.9 KB gz, +1.75% on
18
+ 0.8.15 (the shore model and its shader).
19
+
20
+ ### ⚠️ Breaking
21
+
22
+ - **`biomeTemperature` is a temperature, and `-1` no longer means
23
+ "default".** `0` is 0 °C and each unit is 50 °C (`1` = 50 °C, `-1` =
24
+ -50 °C, which warns once in the console), with no limit either way, so a world
25
+ can be as cold as Titan or as hot as Venus. It used to be the biome
26
+ chart's `0…1` axis with `-1` for "default". Convert old values with
27
+ `(old - 0.36) / 0.8`; the default is now `0.45` and looks the same. The
28
+ chart is a window onto the new scale (-22.5 °C to 40 °C) and clamps beyond
29
+ it. `chartTemperature` / `planetTemperature` convert. Everything inside the
30
+ biome shader, province climate and decorator bands is still in chart
31
+ units. See [Migration](./Migration.md).
32
+
33
+ ### Changed
34
+
35
+ - **The deprecated `onX` callback names stay for one more minor.** They were
36
+ announced as "removed in 0.9"; they are removed in **0.10** instead, and
37
+ still work and warn once in 0.9.x. The same goes for the other names marked
38
+ for removal in 0.9 (`whenEnter`/`whenExit`'s old spellings on the trigger,
39
+ the manipulator's, `generateGalaxy`). Nothing to do yet beyond renaming at
40
+ your own pace.
41
+
42
+ ### Added
43
+
44
+ - **A shoreline, and sea ice.** `<tosi-b3d-water shore="on">` gives the water
45
+ the depth of the ground under each vertex (from the scene's terrain) and
46
+ draws from it: surf (wave fronts running in to the shore one after
47
+ another, and a wet edge lapping at the waterline), paler water over the
48
+ shallows, and ice. The surf is drawn from each vertex's DISTANCE to the
49
+ waterline, not its depth, so it is the same width on a steep shore as on
50
+ a flat one. The distance is a real one, carried across the grid from
51
+ the waterline, so the fronts are evenly spaced whatever the bed does.
52
+ `shoreFine` doubles the mesh near the viewer: a vertex every 2 m out to
53
+ 64 m (about 16,600 in all) where there is otherwise one every 4 m. The ice follows the cold and the shore: a solid sheet
54
+ along the beach, breaking into plates further out, open water beyond, and
55
+ all of it moving out to sea as the climate at sea level (season included)
56
+ gets colder. It is there from below as well. The sea starts to freeze at
57
+ -2 °C at the beach; open water stays clear to about -8 °C and is one
58
+ unbroken surface by -22.5 °C. `iceCover(temperature, depth)` is the rule; see [water-shore](/water-shore/). With `shore="on"` a vertex
59
+ colour on the water mesh is shore data, not a tint. The shader patch is
60
+ made once for the page, so this holds for EVERY `WaterMaterial` on a page
61
+ that has one `shore="on"` water: a vertex-coloured water mesh of your own
62
+ loses its tint there.
63
+ - **Solid ice is solid.** Ice is water until it has knitted solid
64
+ (`iceBears`); where it has, the water carries an invisible collision mesh
65
+ (collision group `ice`), so anything that collides or picks meets it: a
66
+ car, a shell, a ground probe. Plates and a sheet still showing its cracks
67
+ are water. Wave displacement fades out under ice, so the sheet lies flat
68
+ where it collides. A biped swimming at the surface climbs onto solid ice;
69
+ one that dived first goes under it, with the ice as a ceiling.
70
+ `water.iceBearsAt(x, z)` asks for any point.
71
+
72
+ ### Fixed
73
+
74
+ - **Water animates on every browser.** Babylon's `WaterMaterial` advances
75
+ its clock only on a frame whose duration differs from the last, so where
76
+ frame times are steady (a browser that rounds its timer, a display holding
77
+ its rate) the ripples crawled. `<tosi-b3d-water>` now writes the
78
+ material's time itself, once a frame, from the scene's clock. It also
79
+ stops when the scene is paused.
80
+ - **Fog takes the sky's tint.** A `syncSkybox` fog fades distant ground to
81
+ the skybox's `horizonColor`, which ignored `horizonTint`: under a tinted
82
+ sky the far hills stood out as a pale blue-white band along the horizon.
83
+ It now keeps its brightness and takes the tint's hue, by `tintStrength`.
84
+ - **Land and Sky: no air, no cloud.** The demo's cloud cover and orographic
85
+ dials are thinned by the air setting (none below a twentieth of Earth's),
86
+ so Mars has a clear sky. The cloud deck itself is unchanged.
87
+ - **Negative `cirrus` had a quarter of the cloud of positive `cirrus`.** The
88
+ two streak directions were built differently; across-the-wind is now the
89
+ same field turned a quarter, so the sign changes only which way the streaks
90
+ run.
91
+ - **Clouds needed exactly full air.** With `atmosphere` under about 0.8 the
92
+ sky dome becomes a blended mesh, and it was drawn after the cloud deck and
93
+ over it. It is now drawn first.
94
+ - **A little less air cleared the haze almost completely, and a slow drag
95
+ back to full air never quite arrived.** The vacuum fog layer now mixes fog
96
+ by strength (`FogLayer.reciprocal`), and the sky's air value lands exactly
97
+ on 0 and 1.
98
+
99
+ ## 0.8.15
100
+
101
+ **Rocks and trees that belong to the land.** Procedural rocks, Quaternius
102
+ trees gathered into copses, and a biome shader that colours vegetation by the
103
+ ground under it and by the season: autumn colour, bare winter branches, snow.
104
+
105
+ Size: barrel (min, packages external) 932.0 KB raw / 313.0 KB gz, +1.85% on
106
+ 0.8.14.
107
+
108
+ ### Added
109
+
110
+ - **Procedural rocks.** `rockGeometry({ seed })` makes a rock from a seed
111
+ (a sphere cut by random planes, roughened, squashed, sunk into the ground):
112
+ pure, deterministic, no model file. The decorator's default boulders and
113
+ stones are now these instead of Kenney's, and it shades them with the
114
+ terrain's own biome colours, so their tops take whatever grows there and
115
+ they change colour with the planet. A scatter rule asks for one by name:
116
+ `rock:boulder:3` (`rockNames('boulder', 6)` lists six). See
117
+ [procedural-rock](/procedural-rock/).
118
+
119
+ - **The scatter gathers into clumps.** Every rule now clusters by default
120
+ (copses, thickets, rock fields, with thin outliers between) instead of
121
+ spreading evenly. Per rule: `clump` (0 = the old even spread, default
122
+ 0.85), `clumpScale` (this rule's clump size relative to the scatter's) and
123
+ `clumpGroup` (rules in one group gather in the same places; the default
124
+ stones gather around the boulders). The scatter and `<tosi-b3d-decorator>`
125
+ take `clump` (one strength for every rule) and `clumpSize` (metres; 0 =
126
+ auto, about two and a half times the average spacing, so pulling `radius`
127
+ in keeps the clumps).
128
+ - **The scatter's budget is a ceiling.** It no longer fills the gaps between
129
+ clumps, or packs thin habitat as full as lush, to reach the number: a small
130
+ radius or a map that is mostly sea gets fewer and keeps its shape. It also
131
+ lays down at least `oversample` × budget candidates (it could lay down
132
+ half that), so a high budget no longer stalls below itself.
133
+ - `ScatterRule.sink`: how much of a model is buried. The default rocks bury a
134
+ quarter or more; they used to rest on their lowest point and looked set
135
+ down on the ground, or floating over it. Same seed gives a DIFFERENT layout
136
+ than before; set `clump: 0` on a rule to get the old one back.
137
+
138
+ - **Seasons in the biome shader.** `<tosi-b3d-terrain biomeSeason
139
+ biomeSeasonality>` (params `season`, `seasonality`): the year swings the
140
+ chart's temperature axis, so winter cools the whole ground (snow lines drop)
141
+ with no second palette. `seasonality` defaults to 0, so nothing changes
142
+ until you ask. `seasonOf(season, seasonality)` is the pure rule.
143
+ - **Winter snow.** Where the season takes a moist place below freezing
144
+ (temperature about 0.3), snow lies on level ground and the tops of rocks,
145
+ and evergreen foliage goes white. It is a layer of its own, applied only
146
+ while the season is pulling cold, so a world without seasons is unchanged.
147
+ - **Deciduous trees drop their leaves.** After the autumn turn (season 0.55
148
+ to 0.7) `leaf`-role canopies thin in soft patches and are gone through
149
+ winter, leaving trunk and branches, then return across the spring equinox.
150
+ Evergreens, and anything in warm country, keep theirs. A bare tree still
151
+ casts its full summer shadow and still counts in ambient occlusion.
152
+ - **Vegetation roles: trees take their colour from the land.**
153
+ `BiomePlugin.role` is `'ground'` (as before), `'leaf'`, `'evergreen'` or
154
+ `'bark'`. A leaf is its own green pulled toward the colour of the ground
155
+ under it (`leafBlend`), and turns in autumn in temperate country; an
156
+ evergreen does not turn. The decorator assigns roles by material name
157
+ (`roles`, default `NATURE_ROLES`, with `Model*/Material` keys for one
158
+ model's use of a shared material).
159
+
160
+ - An **Occlusion on/off button in Perf Stats**, so its cost can be read in any
161
+ demo on any device; Land and Sky has its own control too.
162
+
163
+ ### Changed
164
+
165
+ - **⚠️ The decorator's defaults changed: models, rocks and layout.** See
166
+ [Migration](/Migration/) for the exact steps. In short:
167
+ - With no `url` it now loads `quaternius/libraries/nature.glb` (a curated
168
+ 64-model library: common, pine, birch, willow and palm trees, dead trees,
169
+ bushes, cacti, undergrowth) with the new `NATURE_RULES`. Custom rules that
170
+ use Kenney's model names and set no `url` now find none of their models:
171
+ the decorator warns and places nothing for them. Set `url` to
172
+ `assetUrl('kenney/libraries/nature-kit.glb')`.
173
+ - Naming a `url` still gets `NATURE_KIT_RULES` and Kenney's trees, but NOT
174
+ the old result: its rocks are now the procedural ones, everything clumps,
175
+ and the same seed gives a different layout. `clump: 0` on a rule (or
176
+ `clump="0"` on the element) restores the even spread.
177
+ - Rocks are no longer placed on a volcanic province. They cannot read the
178
+ province, so they came out the colour of the country around it.
179
+ - The new trees are heavier (about 1,000 vertices each against Kenney's
180
+ 100): Land and Sky's 2,000 placements went from about 205k to 365k
181
+ vertices.
182
+
183
+ - **A volcano's flank is bare basalt, and seams start only near the top.**
184
+ Walking in from the edge of `volcano()`'s province you now cross the biome,
185
+ then plain basalt, then faint seams from about 55% of the way to the crater
186
+ rim; stronger veins and open lava are inside the crater only. The rim's
187
+ province value is 0.25 (it was 0.5). In the biome shader, a local province
188
+ draws no seams below 0.14 and all of them by 0.4; the global `volcanism`
189
+ dial is unchanged. Land and Sky's volcano keeps its size with a smaller
190
+ crater (radius 55, it was 90).
191
+
192
+ - **A standalone headset sizes build-once budgets for stereo from the start.**
193
+ Terrain detail and tile pool, shadow map and cascade count, cloud shadows and
194
+ reflection probes are sized when the scene is built, which is before any
195
+ session, so a Quest got the flat (`medium`) numbers and kept them in VR. They
196
+ now resolve at the XR tier (`low`) on a standalone headset, flat included:
197
+ terrain 12 subdivisions and 56 tiles instead of 16 and 80, shadows 2 cascades
198
+ instead of 4. A PC driving a headset is unaffected. `headsetDevice()` is
199
+ exported for your own build-once budgets.
200
+
201
+ - **Water's reflection and refraction follow the device tier.** Each is the
202
+ whole scene drawn again, and both were 1024 and redrawn every frame on every
203
+ device. `textureSize` now defaults to auto (1024 / 512 / 256) and a new
204
+ `reflectionRefresh` redraws them every Nth frame (1 / 2 / 3) on a flat
205
+ screen; inside a headset session they are redrawn every frame, because
206
+ skipping one eye breaks stereo. Top-tier devices are unchanged. To keep the old behaviour everywhere, set
207
+ `textureSize="1024" reflectionRefresh="1"`.
208
+ - Land and Sky's lightning storm toggle moved to the Weather tab.
209
+
210
+ ### Fixed
211
+
212
+ - **A small, distant sun is visible in an airless sky.** Its disc is drawn at
213
+ true size, which from Jupiter is under a pixel, so Io had no sun. A tight
214
+ glare now takes over as the disc shrinks.
215
+
216
+ - **A world with no moisture grows nothing.** The cactus rule accepted a
217
+ moisture of zero, so Mars grew cacti (and a few dead trees).
218
+
219
+ - **Switching decorator shadows on made whole models vanish**, and every
220
+ rebuild flashed the full scatter before dropping most of it. Each part's
221
+ shadow-only twin shared its geometry, and with it the thin-instance buffer,
222
+ so the visible mesh drew its full count from the twin's short list and
223
+ WebGL rejected the draw. The twin now has its own geometry.
224
+
225
+ - A menu hung off a narrow button (`button3d({ menu })`, `openMenu3d`) is now as wide as its longest label. It used to take a 160 floor, so longer labels ran out of the box (Land and Sky's preset menu).
226
+ - **A `select3d` inside a `row3d` stepped to its next option instead of opening
227
+ its list.** A row did not pass the panel's host to its children, and a select
228
+ with no host falls back to stepping. Land and Sky's world picker jumped from
229
+ Earth to Mars on a tap. (Seen in a headset, reproduced flat.)
230
+
9
231
  ## 0.8.14
10
232
 
11
233
  **Ambient occlusion that works in a headset, and it is the default.**
package/Migration.md CHANGED
@@ -9,6 +9,97 @@ This file ships **inside the package**, because a migration table you can only
9
9
  read on GitHub does not exist for someone who has already installed the thing
10
10
  and is staring at an error.
11
11
 
12
+ ## 0.8.15 → 0.9.0
13
+
14
+ ### 1. `biomeTemperature` is in degrees now: 0 is 0 °C, 1 is 50 °C
15
+
16
+ **What changed.** `<tosi-b3d-terrain biomeTemperature>` used to be the biome
17
+ chart's own axis: `0…1`, cold to warm, with `-1` meaning "use the default".
18
+ It is now a temperature: `0` is 0 °C and each unit is 50 °C, so `-1` is
19
+ -50 °C, and the value is not limited to any range. The default is `0.45`
20
+ (22.5 °C), which is the same climate as before.
21
+
22
+ **Who is affected.** Anyone who sets `biomeTemperature`. An old value is read
23
+ on the new scale and comes out much warmer: `0.3` used to be about -4 °C and
24
+ is now 15 °C. `-1` used to mean the default and is now -50 °C.
25
+
26
+ **What to do.** Convert each value: `new = (old - 0.36) / 0.8`. Replace `-1`
27
+ with `0.45`, or delete the attribute.
28
+
29
+ | Old | New | Climate |
30
+ |-----|-----|---------|
31
+ | `-1` (auto) | `0.45` | 22.5 °C |
32
+ | `1` | `0.8` | 40 °C |
33
+ | `0.72` | `0.45` | 22.5 °C |
34
+ | `0.36` | `0` | 0 °C |
35
+ | `0` | `-0.45` | -22.5 °C |
36
+
37
+ `chartTemperature` and `planetTemperature` (from `biome-chart`) do the
38
+ conversion in code. Only this attribute moved. `BiomePlugin.params`, the
39
+ province climate curves and the decorator's rule bands are still in chart
40
+ units.
41
+
42
+ ### 2. Nothing else is removed, including what was promised
43
+
44
+ The deprecated `onX` callback names (and the other names announced as
45
+ "removed in 0.9") still work in 0.9.x and warn once. They are removed in
46
+ 0.10. Rename when convenient.
47
+
48
+ ## 0.8.14 → 0.8.15
49
+
50
+ **Nothing breaks at compile time. Three defaults change what you see.**
51
+
52
+ ### 1. The decorator's default library is Quaternius', not Kenney's
53
+
54
+ **What changed.** `<tosi-b3d-decorator>` with no `url` loads
55
+ `quaternius/libraries/nature.glb` and uses `NATURE_RULES`. It used to load
56
+ Kenney's Nature Kit and use `NATURE_KIT_RULES`.
57
+
58
+ **Who is affected.**
59
+ - You set no `url` and no `rules`: you get the new trees. Nothing to do unless
60
+ you want the old ones.
61
+ - You set custom `rules` that use Kenney's model names (`tree_oak`,
62
+ `rock_largeA`) and no `url`: none of those names exist in the new library.
63
+ The decorator now warns in the console and places nothing for them.
64
+ - You self-host only the Kenney kit: the default URL is a file you do not have.
65
+
66
+ **What to do.** To stay on Kenney's kit, name it:
67
+
68
+ ```javascript
69
+ b3dDecorator({ url: assetUrl('kenney/libraries/nature-kit.glb') })
70
+ ```
71
+
72
+ With a `url` set and no `rules`, the decorator uses `NATURE_KIT_RULES`.
73
+
74
+ ### 2. Layouts are different, and things clump
75
+
76
+ **What changed.** Every scatter rule now gathers into clumps by default, the
77
+ candidate grid changed, and the budget became a ceiling (a small radius or a
78
+ mostly-sea map places fewer than the budget). The same seed gives a different
79
+ layout than 0.8.14 did. `NATURE_KIT_RULES`' rocks are now procedural
80
+ (`rock:boulder:1` …) at a different scale, and no rocks are placed on a
81
+ volcanic province.
82
+
83
+ **Who is affected.** Anyone who stored placements, compared them in a test, or
84
+ tuned a scene around where things stood.
85
+
86
+ **What to do.** There is no switch that restores 0.8.14's exact layout. For an
87
+ even spread again, set `clump="0"` on the element (or `clump: 0` on a rule).
88
+
89
+ ### 3. Water reflections follow the device tier
90
+
91
+ **What changed.** `<tosi-b3d-water>`'s `textureSize` defaults to auto (1024,
92
+ 512 or 256 by device tier; it was 1024 everywhere) and a new
93
+ `reflectionRefresh` redraws the reflection every frame, every second or every
94
+ third by tier on a flat screen.
95
+
96
+ **What to do.** Top-tier devices see no change. To keep the old behaviour on
97
+ every device:
98
+
99
+ ```javascript
100
+ b3dWater({ textureSize: 1024, reflectionRefresh: 1 })
101
+ ```
102
+
12
103
  ## 0.8.0 → 0.8.1
13
104
 
14
105
  **Nothing breaks at compile time, and one behaviour changes.** The
@@ -95,7 +186,8 @@ Use **`isOff()`** from `tosijs-3d`, which accepts `'off'`, `false` and
95
186
  ### 2. Callback options: `onX` → `handleX`
96
187
 
97
188
  Every callback option in the library now takes `handleX`. The old `onX` spelling
98
- still works, warns **once per name**, and is **removed in 0.9**.
189
+ still works, warns **once per name**, and is **removed in 0.10** (announced
190
+ for 0.9, then kept one more minor).
99
191
 
100
192
  | widget | old | new |
101
193
  | ---------------------------------------- | ------------------------------------ | ------------------------------------------------ |
@@ -20,7 +20,7 @@ export interface Angle3dOptions {
20
20
  /** Ring diameter. `0` fits the row to the panel width. */
21
21
  size?: number;
22
22
  handleChange?: (v: number) => void;
23
- /** @deprecated use `handleChange` — removed in 0.9. */
23
+ /** @deprecated use `handleChange` — removed in 0.10. */
24
24
  onChange?: (v: number) => void;
25
25
  handleCommit?: (v: number) => void;
26
26
  }
@@ -33,7 +33,7 @@ export interface Arc3dOptions {
33
33
  maxWidth?: number;
34
34
  size?: number;
35
35
  handleChange?: (v: Arc) => void;
36
- /** @deprecated use `handleChange` — removed in 0.9. */
36
+ /** @deprecated use `handleChange` — removed in 0.10. */
37
37
  onChange?: (v: Arc) => void;
38
38
  handleCommit?: (v: Arc) => void;
39
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"angle-field.d.ts","sourceRoot":"","sources":["../src/angle-field.ts"],"names":[],"mappings":"AAgIA,OAAO,EAWL,KAAK,GAAG,EAET,MAAM,UAAU,CAAA;AAEjB,OAAO,KAAK,EAAe,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAO3D,MAAM,WAAW,UAAW,SAAQ,QAAQ;IAC1C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,8EAA8E;IAC9E,SAAS,EAAE,CAAC,MAAM,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A;IACX,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,GAAG,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;IAC/B,wDAAwD;IACxD,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;IAC3B,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;CAChC;AAkHD,0BAA0B;AAC1B,wBAAgB,OAAO,CAAC,MAAM,GAAE,cAAmB,GAAG,UAAU,CAgG/D;AAED,6CAA6C;AAC7C,wBAAgB,KAAK,CAAC,MAAM,GAAE,YAAiB,GAAG,QAAQ,CAiHzD"}
@@ -40,6 +40,14 @@ export type FogLayer = {
40
40
  * which is right for water and for anything you are simply immersed in.
41
41
  */
42
42
  veil?: number;
43
+ /**
44
+ * Blend `start` and `end` by their RECIPROCALS. For a layer that CLEARS the
45
+ * air (vacuum: distances of millions of metres): blended straight, a weight
46
+ * of 0.002 toward ten million metres moves a 4 km fog out to 20 km, so
47
+ * thinning the air a little cleared it almost entirely. Fog strength goes
48
+ * as one over distance, and that is what should be mixed.
49
+ */
50
+ reciprocal?: boolean;
43
51
  };
44
52
  /**
45
53
  * Composite layers over a base, in order. Each pulls the running state toward itself by its
@@ -1 +1 @@
1
- {"version":3,"file":"atmosphere.d.ts","sourceRoot":"","sources":["../src/atmosphere.ts"],"names":[],"mappings":"AA+CA;uDACuD;AACvD,MAAM,MAAM,QAAQ,GAAG;IACrB,qBAAqB;IACrB,KAAK,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAC1C,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE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M,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;;;;;;;;;;;OAaG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAKD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ,CA8BzE;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,QAAQ,EACjB,MAAM,EAAE,QAAQ,EAChB,EAAE,EAAE,MAAM,EACV,GAAG,SAAO,GACT,QAAQ,CAYV;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAKzE"}
@@ -69,10 +69,19 @@ export function compositeFog(base, layers) {
69
69
  }
70
70
  if (layer.density !== undefined)
71
71
  out.density = lerp(out.density, layer.density, w);
72
+ const mix = layer.reciprocal
73
+ ? (a, b) => a > 0 && b > 0 ? 1 / lerp(1 / a, 1 / b, w) : lerp(a, b, w)
74
+ : (a, b) => lerp(a, b, w);
72
75
  if (layer.start !== undefined)
73
- out.start = lerp(out.start, layer.start, w);
76
+ out.start = mix(out.start, layer.start);
74
77
  if (layer.end !== undefined)
75
- out.end = lerp(out.end, layer.end, w);
78
+ out.end = mix(out.end, layer.end);
79
+ // A reciprocal blend cannot take a zero, so a start of 0 falls back to a
80
+ // plain lerp while the end beside it moves by reciprocals: toward a far
81
+ // layer the start then races ahead of the end, and everything nearer
82
+ // than the end draws as solid fog. The start never passes the end.
83
+ if (layer.reciprocal && out.start > out.end)
84
+ out.start = out.end;
76
85
  }
77
86
  return out;
78
87
  }
@@ -1 +1 @@
1
- {"version":3,"file":"atmosphere.js","sourceRoot":"","sources":["../src/atmosphere.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4CE;AACF,6CAA6C;AAuC7C,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAU,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;AACzE,MAAM,OAAO,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAElE;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,IAAc,EAAE,MAAkB;IAC7D,MAAM,GAAG,GAAa;QACpB,KAAK,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE;QACxB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,GAAG,EAAE,IAAI,CAAC,GAAG;KACd,CAAA;IACD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QAC/B,IAAI,CAAC,IAAI,CAAC;YAAE,SAAQ;QACpB,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;YAChB,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;YACjD,GAAG,C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ChD,OAAO;QACL,KAAK,EAAE;YACL,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;YAC3C,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;YAC3C,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;SAC5C;QACD,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;QACjD,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QAC3C,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;KACtC,CAAA;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,IAAI,CAAC,KAAa,EAAE,OAAe,EAAE,IAAY;IAC/D,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAClD,MAAM,CAAC,GAAG,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,CAAA;IAC9C,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;IACpB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA,CAAC,uCAAuC;AACpE,CAAC"}
@@ -499,6 +499,8 @@ export declare class B3dBiped extends B3dControllable {
499
499
  /** Zoom 0..1, now integrated from the d-pad rather than read off a stick. */
500
500
  private _camZoom;
501
501
  private _waterEl;
502
+ /** Which side of weight-bearing ice we are on; see water-shore's `iceSide`. */
503
+ private _iceSide;
502
504
  /**
503
505
  * Surface height of the scene's water, or `null` if there is none.
504
506
  *
@@ -1 +1 @@
1
- {"version":3,"file":"b3d-biped.d.ts","sourceRoot":"","sources":["../src/b3d-biped.ts"],"names":[],"mappings":"AAkOA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAiC,MAAM,gBAAgB,CAAA;AAsBvE,OAAO,EAQL,KAAK,GAAG,EAET,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AAExC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAWxE,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,qBAAa,SAAS;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,OAAO,CAAA;IACb,QAAQ,EAAE,OAAO,CAAA;IACjB,SAAS,EAAE,OAAO,CAAA;gBAEN,IAAI,EAAE,aAAa;IAQ/B,MAAM,CAAC,SAAS,CAAC,GAAG,KAAK,EAAE,aAAa,EAAE,GAAG,SAAS,EAAE;CAGzD;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,GAAE,aAAa,EAA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,EAAE,OAAO,CAAC,KAAK;IA+F3C,YAAY;IAiCZ,MAAM;CA6BP;AAED,eAAO,MAAM,QAAQ,2CAA4B,CAAA"}
package/dist/b3d-biped.js CHANGED
@@ -228,6 +228,7 @@ import { collidable, isOff, markUiMesh } from './b3d-utils.js';
228
228
  import { canMantle, mantleClip, mantlePath, defaultMantleLimits, } from './mantle.js';
229
229
  import { buoyantStep, submergedFraction, isSwimming, swimBuoyancy, } from './buoyancy.js';
230
230
  import { aimFromLook, clampAim, easeAim, aimTarget, surfaceAimLimit, } from './swim-aim.js';
231
+ import { iceSide } from './water-shore.js';
231
232
  import { fitChase } from './camera-fit.js';
232
233
  import { DEFAULT_AIM_LIMITS, aimDirection as aimToDirection, aimPoseWeights, bodyCatchUp, relaxAim, stepAim, wrapDeg, } from './aim.js';
233
234
  import { xrControllers } from './gamepad.js';
@@ -366,6 +367,7 @@ const CROUCH_HALF = 0.45;
366
367
  const STEP_UP = 0.5;
367
368
  /** How far the ground may drop before it becomes a FALL rather than a step. */
368
369
  const STEP_DOWN = 0.6;
370
+ const ICE_GROUP = ['ice'];
369
371
  /**
370
372
  * Vertical kick while swimming, m/s². Enough to beat buoyancy comfortably
371
373
  * (which is ~1.5 m/s² of upward push at full submersion) without feeling like a
@@ -1155,6 +1157,8 @@ export class B3dBiped extends B3dControllable {
1155
1157
  /** Zoom 0..1, now integrated from the d-pad rather than read off a stick. */
1156
1158
  _camZoom = 0;
1157
1159
  _waterEl;
1160
+ /** Which side of weight-bearing ice we are on; see water-shore's `iceSide`. */
1161
+ _iceSide = 'none';
1158
1162
  /**
1159
1163
  * Surface height of the scene's water, or `null` if there is none.
1160
1164
  *
@@ -1166,7 +1170,8 @@ export class B3dBiped extends B3dControllable {
1166
1170
  _waterSurfaceY() {
1167
1171
  if (this._waterEl === undefined) {
1168
1172
  this._waterEl =
1169
- this.owner?.querySelector('tosi-b3d-water') ?? null;
1173
+ this.owner?.querySelector('tosi-b3d-water') ??
1174
+ null;
1170
1175
  }
1171
1176
  const mesh = this._waterEl?.mesh;
1172
1177
  return mesh ? mesh.absolutePosition.y : null;
@@ -2137,7 +2142,12 @@ export class B3dBiped extends B3dControllable {
2137
2142
  // `collidable()` for the shared rules (UI never counts as floor,
2138
2143
  // isPickable/isEnabled re-checked because a predicate replaces
2139
2144
  // Babylon's own filter); `checkCollisions` stays as OUR clause.
2140
- collidable((m) => m === node || !m.checkCollisions));
2145
+ // Not the water's ice mesh: which SIDE of the ice we are on is kept
2146
+ // below (`iceSide`), and a probe from just under it would put a diver
2147
+ // on top.
2148
+ collidable((m) => m === node || !m.checkCollisions, {
2149
+ ignoreGroups: ICE_GROUP,
2150
+ }));
2141
2151
  /*
2142
2152
  WATER IS A MEDIUM, NOT A LINE.
2143
2153
 
@@ -2177,7 +2187,25 @@ export class B3dBiped extends B3dControllable {
2177
2187
  this button is the SURFACE control and continuous, so it never charges.
2178
2188
  */
2179
2189
  const jumpDown = (input.jump ?? 0) > 0.5;
2180
- const surfaceY = this._waterSurfaceY();
2190
+ /*
2191
+ ICE IS WATER UNTIL IT IS SOLID.
2192
+
2193
+ Where the water's ice bears weight (`iceBearsAt`), the surface is ground
2194
+ from above and a ceiling from below; everywhere else, plates included,
2195
+ it is water and nothing here changes. Which side we are on is decided
2196
+ once, where we meet the ice, and kept (`iceSide` says why). On top, there
2197
+ is no water as far as the rest of this frame is concerned: `surfaceY` is
2198
+ null and the ice stands in for the floor.
2199
+ */
2200
+ const seaY = this._waterSurfaceY();
2201
+ const eyeLevel = this.eyeHeight || 1.6;
2202
+ this._iceSide =
2203
+ seaY != null && node.position.y < seaY + eyeLevel + 1
2204
+ ? iceSide(this._iceSide, this._waterEl?.iceBearsAt?.(node.position.x, node.position.z) ===
2205
+ true, seaY - node.position.y, this._swimming, STEP_UP)
2206
+ : 'none';
2207
+ const onIce = this._iceSide === 'over' && seaY != null;
2208
+ const surfaceY = onIce ? null : seaY;
2181
2209
  // `eyeHeight` as a proxy for body height. It is a little short by
2182
2210
  // definition, which is the harmless direction: equilibrium is a FRACTION
2183
2211
  // of whatever height you give it, so erring small floats you a touch
@@ -2235,8 +2263,15 @@ export class B3dBiped extends B3dControllable {
2235
2263
  */
2236
2264
  const headDepth = surfaceY == null ? 0 : surfaceY - (feetY + bodyHeight);
2237
2265
  const submerged = surfaceY == null ? 0 : submergedFraction(feetY, bodyHeight, surfaceY);
2238
- const grounded = hit?.hit === true && hit.pickedPoint != null;
2239
- const groundY = grounded ? hit.pickedPoint.y : -Infinity;
2266
+ const floorHit = hit?.hit === true && hit.pickedPoint != null;
2267
+ const floorY = floorHit ? hit.pickedPoint.y : -Infinity;
2268
+ // The ice is in reach when we are below it (climbing out, or it froze
2269
+ // around us) or within the same drop the ground probe allows.
2270
+ const iceFloor = onIce &&
2271
+ seaY > floorY &&
2272
+ seaY >= node.position.y - (STEP_DOWN + fallStep);
2273
+ const grounded = floorHit || iceFloor;
2274
+ const groundY = iceFloor ? seaY : floorY;
2240
2275
  /*
2241
2276
  THE SWIM/STAND TEST MUST NOT USE THE POSE, or it feeds back on itself.
2242
2277
 
@@ -2427,6 +2462,15 @@ export class B3dBiped extends B3dControllable {
2427
2462
  });
2428
2463
  let nextY = node.position.y + this._fallVel * dt;
2429
2464
  let onFloor = false;
2465
+ // Under bearing ice the head stops at its underside. Before the floor
2466
+ // test, so in water too shallow for both, the floor wins.
2467
+ if (this._iceSide === 'under' && seaY != null) {
2468
+ const top = seaY - 0.1 - (bodyBottom + bodyHeight);
2469
+ if (nextY > top) {
2470
+ nextY = top;
2471
+ this._fallVel = Math.min(0, this._fallVel);
2472
+ }
2473
+ }
2430
2474
  // The floor stops the body's LOWEST point, which in a swim pose is the
2431
2475
  // trailing legs rather than the root — treading, they hang 1.37 m below
2432
2476
  // it. Clamping the root instead buried them in the seabed.