tosijs-3d 0.8.15 → 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 (91) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/Migration.md +38 -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-galaxy.d.ts +1 -1
  14. package/dist/b3d-galaxy.js +1 -1
  15. package/dist/b3d-lightning.js +1 -1
  16. package/dist/b3d-manipulator.d.ts +2 -2
  17. package/dist/b3d-manipulator.d.ts.map +1 -1
  18. package/dist/b3d-manipulator.js +3 -3
  19. package/dist/b3d-manipulator.js.map +1 -1
  20. package/dist/b3d-skybox.d.ts.map +1 -1
  21. package/dist/b3d-skybox.js +49 -1
  22. package/dist/b3d-skybox.js.map +1 -1
  23. package/dist/b3d-terrain.d.ts.map +1 -1
  24. package/dist/b3d-terrain.js +26 -9
  25. package/dist/b3d-terrain.js.map +1 -1
  26. package/dist/b3d-trigger.d.ts +2 -2
  27. package/dist/b3d-trigger.d.ts.map +1 -1
  28. package/dist/b3d-trigger.js +4 -4
  29. package/dist/b3d-trigger.js.map +1 -1
  30. package/dist/b3d-water.d.ts +25 -0
  31. package/dist/b3d-water.d.ts.map +1 -1
  32. package/dist/b3d-water.js +282 -5
  33. package/dist/b3d-water.js.map +1 -1
  34. package/dist/biome-chart.d.ts +21 -0
  35. package/dist/biome-chart.d.ts.map +1 -1
  36. package/dist/biome-chart.js +38 -0
  37. package/dist/biome-chart.js.map +1 -1
  38. package/dist/box.d.ts +2 -2
  39. package/dist/box.d.ts.map +1 -1
  40. package/dist/cloud-field.d.ts.map +1 -1
  41. package/dist/cloud-field.js +14 -4
  42. package/dist/cloud-field.js.map +1 -1
  43. package/dist/color-field.d.ts +1 -1
  44. package/dist/color-field.d.ts.map +1 -1
  45. package/dist/curve-field.d.ts +2 -2
  46. package/dist/curve-field.d.ts.map +1 -1
  47. package/dist/footprint-field.d.ts +2 -2
  48. package/dist/footprint-field.d.ts.map +1 -1
  49. package/dist/galaxy-data.d.ts +1 -1
  50. package/dist/galaxy-data.js +1 -1
  51. package/dist/handler-of.js +2 -2
  52. package/dist/handler-of.js.map +1 -1
  53. package/dist/index.d.ts +2 -1
  54. package/dist/index.d.ts.map +1 -1
  55. package/dist/index.js +2 -1
  56. package/dist/index.js.map +1 -1
  57. package/dist/keyboard.d.ts +8 -8
  58. package/dist/keyboard.d.ts.map +1 -1
  59. package/dist/land-and-sky.js +50 -17
  60. package/dist/land-and-sky.js.map +1 -1
  61. package/dist/picker.d.ts +1 -1
  62. package/dist/picker.d.ts.map +1 -1
  63. package/dist/scene-schemas.d.ts.map +1 -1
  64. package/dist/scene-schemas.js +5 -2
  65. package/dist/scene-schemas.js.map +1 -1
  66. package/dist/surface.d.ts +1 -1
  67. package/dist/surface.d.ts.map +1 -1
  68. package/dist/table.d.ts +2 -2
  69. package/dist/table.d.ts.map +1 -1
  70. package/dist/terrain-editor.d.ts +1 -1
  71. package/dist/terrain-editor.d.ts.map +1 -1
  72. package/dist/theme-editor.d.ts +1 -1
  73. package/dist/theme-editor.d.ts.map +1 -1
  74. package/dist/tosi-b3d.d.ts +1 -1
  75. package/dist/tosi-b3d.d.ts.map +1 -1
  76. package/dist/vector-field.d.ts +1 -1
  77. package/dist/vector-field.d.ts.map +1 -1
  78. package/dist/water-shore-shader.d.ts +24 -0
  79. package/dist/water-shore-shader.d.ts.map +1 -0
  80. package/dist/water-shore-shader.js +241 -0
  81. package/dist/water-shore-shader.js.map +1 -0
  82. package/dist/water-shore.d.ts +100 -0
  83. package/dist/water-shore.d.ts.map +1 -0
  84. package/dist/water-shore.js +374 -0
  85. package/dist/water-shore.js.map +1 -0
  86. package/dist/widgets3d.d.ts +9 -9
  87. package/dist/widgets3d.d.ts.map +1 -1
  88. package/dist/widgets3d.js +1 -1
  89. package/package.json +1 -1
  90. package/static/attributes.json +13 -3
  91. package/static/attributes.txt +4 -2
package/CHANGELOG.md CHANGED
@@ -6,6 +6,96 @@ 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
+
9
99
  ## 0.8.15
10
100
 
11
101
  **Rocks and trees that belong to the land.** Procedural rocks, Quaternius
package/Migration.md CHANGED
@@ -9,6 +9,42 @@ 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
+
12
48
  ## 0.8.14 → 0.8.15
13
49
 
14
50
  **Nothing breaks at compile time. Three defaults change what you see.**
@@ -150,7 +186,8 @@ Use **`isOff()`** from `tosijs-3d`, which accepts `'off'`, `false` and
150
186
  ### 2. Callback options: `onX` → `handleX`
151
187
 
152
188
  Every callback option in the library now takes `handleX`. The old `onX` spelling
153
- 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).
154
191
 
155
192
  | widget | old | new |
156
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,EAAE,GAAG,KAAK,IAAI,CAAA;CACjC;AAED,MAAM,WAAW,QAAS,SAAQ,QAAQ;IACxC,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAA;IACnB,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAA;IAC7B,WAAW,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAA;CACrC;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,eAAe;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8EAA8E;IAC9E,MAAM,CAAC,EAAE,GAAG,CAAA;IACZ,0DAA0D;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,uDAAuD;IACvD,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9B,YAAY,CAAC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*/
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,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,MAAM,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;CACd,CAAA;AAKD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAqBzE;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,QAAQ,EACjB,MAAM,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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;;;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AAC,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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KAAK,SAAI;IA+EzC,eAAe,IAAI,OAAO,CAAC,IAAI,GAAG,IAAI;IAItC,UAAU,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM;IAspC1C,OAAO,CAAC,YAAY;IASd,aAAa;IAkJb,iBAAiB;IAwDvB;;;mDAG+C;IAC/C,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,KAAK;IAyBnC;;;;+EAI2E;IAC3E,OAAO,CAAC,aAAa;IAUrB,iBAAiB;IAoBjB;;mDAE+C;IAC/C,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAmB5B,OAAO,CAAC,SAAS,CAAiD;IAElE;;;;;OAKG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAoB1C,6CAA6C;IAC7C,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAQ/B,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,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.