tosijs-3d 0.10.8 → 0.10.10

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 (108) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/dist/b3d-panel.d.ts +6 -0
  3. package/dist/b3d-panel.d.ts.map +1 -1
  4. package/dist/b3d-panel.js +50 -1
  5. package/dist/b3d-panel.js.map +1 -1
  6. package/dist/b3d-planet.d.ts +35 -0
  7. package/dist/b3d-planet.d.ts.map +1 -1
  8. package/dist/b3d-planet.js +207 -58
  9. package/dist/b3d-planet.js.map +1 -1
  10. package/dist/b3d-ssao-projected.d.ts +2 -0
  11. package/dist/b3d-ssao-projected.d.ts.map +1 -1
  12. package/dist/b3d-ssao-projected.js +28 -0
  13. package/dist/b3d-ssao-projected.js.map +1 -1
  14. package/dist/b3d-star-system.d.ts.map +1 -1
  15. package/dist/b3d-star-system.js +53 -2
  16. package/dist/b3d-star-system.js.map +1 -1
  17. package/dist/b3d-terrain.d.ts +13 -0
  18. package/dist/b3d-terrain.d.ts.map +1 -1
  19. package/dist/b3d-terrain.js +70 -6
  20. package/dist/b3d-terrain.js.map +1 -1
  21. package/dist/b3d-utils.d.ts +1 -0
  22. package/dist/b3d-utils.d.ts.map +1 -1
  23. package/dist/b3d-utils.js +11 -0
  24. package/dist/b3d-utils.js.map +1 -1
  25. package/dist/bone-heat.d.ts +22 -0
  26. package/dist/bone-heat.d.ts.map +1 -0
  27. package/dist/bone-heat.js +238 -0
  28. package/dist/bone-heat.js.map +1 -0
  29. package/dist/dial-art.d.ts +3 -0
  30. package/dist/dial-art.d.ts.map +1 -0
  31. package/dist/dial-art.js +4 -0
  32. package/dist/dial-art.js.map +1 -0
  33. package/dist/dials.d.ts +76 -0
  34. package/dist/dials.d.ts.map +1 -0
  35. package/dist/dials.js +253 -0
  36. package/dist/dials.js.map +1 -0
  37. package/dist/frame-panel.d.ts +15 -0
  38. package/dist/frame-panel.d.ts.map +1 -1
  39. package/dist/frame-panel.js +41 -0
  40. package/dist/frame-panel.js.map +1 -1
  41. package/dist/gas-giant-material.d.ts +26 -0
  42. package/dist/gas-giant-material.d.ts.map +1 -1
  43. package/dist/gas-giant-material.js +45 -1
  44. package/dist/gas-giant-material.js.map +1 -1
  45. package/dist/gas-giant.d.ts +1 -0
  46. package/dist/gas-giant.d.ts.map +1 -1
  47. package/dist/gas-giant.js +57 -0
  48. package/dist/gas-giant.js.map +1 -1
  49. package/dist/icon-data.d.ts +2 -0
  50. package/dist/icon-data.d.ts.map +1 -1
  51. package/dist/icon-data.js +2 -0
  52. package/dist/icon-data.js.map +1 -1
  53. package/dist/index.d.ts +17 -1
  54. package/dist/index.d.ts.map +1 -1
  55. package/dist/index.js +8 -0
  56. package/dist/index.js.map +1 -1
  57. package/dist/keyboard.d.ts.map +1 -1
  58. package/dist/keyboard.js +18 -1
  59. package/dist/keyboard.js.map +1 -1
  60. package/dist/retarget-babylon.d.ts +39 -0
  61. package/dist/retarget-babylon.d.ts.map +1 -0
  62. package/dist/retarget-babylon.js +252 -0
  63. package/dist/retarget-babylon.js.map +1 -0
  64. package/dist/retarget.d.ts +74 -0
  65. package/dist/retarget.d.ts.map +1 -0
  66. package/dist/retarget.js +558 -0
  67. package/dist/retarget.js.map +1 -0
  68. package/dist/rig-build.d.ts +20 -0
  69. package/dist/rig-build.d.ts.map +1 -0
  70. package/dist/rig-build.js +256 -0
  71. package/dist/rig-build.js.map +1 -0
  72. package/dist/rig-fit.d.ts +107 -0
  73. package/dist/rig-fit.d.ts.map +1 -0
  74. package/dist/rig-fit.js +658 -0
  75. package/dist/rig-fit.js.map +1 -0
  76. package/dist/rig-markers.d.ts +42 -0
  77. package/dist/rig-markers.d.ts.map +1 -0
  78. package/dist/rig-markers.js +348 -0
  79. package/dist/rig-markers.js.map +1 -0
  80. package/dist/scene-schemas.d.ts.map +1 -1
  81. package/dist/scene-schemas.js +21 -0
  82. package/dist/scene-schemas.js.map +1 -1
  83. package/dist/sol.d.ts.map +1 -1
  84. package/dist/sol.js +13 -1
  85. package/dist/sol.js.map +1 -1
  86. package/dist/sphere-map.d.ts.map +1 -1
  87. package/dist/sphere-map.js +5 -14
  88. package/dist/sphere-map.js.map +1 -1
  89. package/dist/spring-chain-babylon.d.ts +45 -0
  90. package/dist/spring-chain-babylon.d.ts.map +1 -0
  91. package/dist/spring-chain-babylon.js +347 -0
  92. package/dist/spring-chain-babylon.js.map +1 -0
  93. package/dist/spring-chain.d.ts +59 -0
  94. package/dist/spring-chain.d.ts.map +1 -0
  95. package/dist/spring-chain.js +195 -0
  96. package/dist/spring-chain.js.map +1 -0
  97. package/dist/system-layout.d.ts +15 -0
  98. package/dist/system-layout.d.ts.map +1 -1
  99. package/dist/tosi-b3d.d.ts +26 -1
  100. package/dist/tosi-b3d.d.ts.map +1 -1
  101. package/dist/tosi-b3d.js +170 -35
  102. package/dist/tosi-b3d.js.map +1 -1
  103. package/dist/widgets3d.d.ts +27 -2
  104. package/dist/widgets3d.d.ts.map +1 -1
  105. package/dist/widgets3d.js.map +1 -1
  106. package/package.json +2 -1
  107. package/static/attributes.json +35 -0
  108. package/static/attributes.txt +10 -0
package/CHANGELOG.md CHANGED
@@ -6,6 +6,70 @@ 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.10.10
10
+
11
+ ### Fixed
12
+
13
+ - **`panel3d`'s return type says what it carries** (#104): the exported `Panel3d` type lists `handlePointer`, `scrollBy`, `scrollable`, `gripHeight`, `gripHit`, `measure`, `addLayerHost`, `useDomLayer` and `dispose`. The declaration was a bare `SVGSVGElement`, so calling `dispose()` (new in 0.10.8) did not typecheck. Existing casts to a subset of those methods still compile.
14
+ - **A per-axis scale set on a library destroyable's node survives moves and turns** (#105): the uniform `scale` attribute was rewritten onto the node on every render, so a consumer's `[2, 1, 3]` stretch was lost at the next unrelated attribute write. It is now written only when `scale` (or the node) changes, and the attribute still wins whenever it is set.
15
+ - **Projected AO darkens library pieces** (#107, from ensemble): it hooked only the materials in `scene.materials` and those created after it started, but a library's instances share its container's materials, which are in neither. So pieces placed from a `<tosi-b3d-library>` were left out of the depth picture and never occluded, while the plugin count said AO was running. It now also finds materials through the scene's meshes, at start and as meshes are added. On twelve pirate-kit pieces, the pixels it changes went from 0% to 5.8% at strength 1, and from 0.1% to 16.5% at strength 3 (screen AO: 13%).
16
+ - **A key is delivered once even when a handler re-renders its field group mid-keystroke** (#94, from ensemble): a `handleChange` that rebuilt its panel inside the keydown detached the focused field's group, so the window listener, deciding afterwards, typed the key a second time (`flagXXship`). Every route now marks the event it consumed and skips one already marked.
17
+ - **The Moon with NASA's maps is a globe again**: its height map was exaggerated 12×, which put its relief at 14% of the radius ("ridiculous"). It is 3× now, about 3.5%: basins still show at the limb.
18
+ - **A planet's golden hour peaks with the sun at the horizon, not well above it.** The gold at the limb was strongest with the sun about 50° from behind the planet and still bright at 70°: daylight over most of the limb. It now needs the sun close behind (full within about 15°, gone by about 50°) and keeps its breadth. A first attempt that narrowed the band itself was rejected ("a very thin effect which isn't what I wanted"); Tonio, on this one: "pretty perfect".
19
+ - **A star system's rocky worlds have continents, not one blob.** A planet reads its noise at `grossScale × radius`, and its presets' relief is tuned for radius 50, both in drawn units. A system draws a world a few units across, so the synthetic Earth read a fiftieth of one noise wave and came out as a single smooth landmass ("very Fisher Price Pangaea"). Its noise is now set per world (about 1.6 waves across it for continents, 6 for coastlines), and the preset's relief is scaled by drawn radius over 50, for planets and moons alike. A look that sets its own scales or relief still wins.
20
+
21
+ ### Added
22
+
23
+ - **Retargeting: one humanoid's animation on another's body.** The Universal Animation Library's clips now play on characters that weren't built for them. The demo (`/retarget/`) shows one clip on four bodies: UAL's mannequin, a Quaternius superhero, omnidude (Mixamo's bones) and a Kenney chibi (seven bones).
24
+ - **Roles:** `humanoidRoles` says which bone is which across UE, Mixamo, Kenney and Blender names.
25
+ - **Rotations:** `retargeter(source, target)` transfers each bone's world-space rotation since rest, so a clip made on an A-pose rig plays as shown on a T-pose one.
26
+ - The hips move in proportion to hip height.
27
+ - A target bone that stands for several source bones (a chibi's whole leg) aims along the source's chain.
28
+ - **The Babylon side:** `readSkeleton` reads a loaded character; `retargetClip`/`retargetClips` turn a clip into an AnimationGroup for it. All pure except the Babylon side, and tested on the real UAL, Mixamo and Kenney skeletons.
29
+ - **Auto-rig: a mesh with no skeleton, walking** (#3349). Eight markers on a front view, as on Mixamo's auto-rigger, are enough to rig a mesh for UAL's clips. The auto-rig page (`/rig-build/`) rigs Tonio's omnidude, two weasels and a space marine in the browser (CC BY 4.0, on the CDN under `tonio/rigging/`) and plays clips on them side by side.
30
+ - **Fitting:** `fitSkeleton(markers, meshQuery(positions, indices))` places UAL's 65 joints, each at the middle of the mesh's thickness. An optional tail tip grows a tail chain.
31
+ - **Binding:** `boneHeat` binds the mesh by bone heat (Baran & Popović), in about 0.1–0.3 s.
32
+ - **Building:** `buildRig` makes a Babylon skeleton of the result the way the glTF loader would, so `readSkeleton` and `retargetClip` work on it.
33
+ - **Reading files:** `objTriangles` reads an OBJ.
34
+ - **Spring bones: secondary motion for hair, tails and capes.**
35
+ - **Model:** `spring-chain` is the pure model: Verlet at a fixed 120 Hz step, stiffness toward the rest shape, damping, sphere colliders, and a correction that keeps the tip from whipping.
36
+ - **Babylon side:** `springBones` hangs a simulated chain from any node, after the animation has posed the body, and `skinTube` skins a tube to it. `springNodes` runs an existing chain, which is how the weasels' tails swing.
37
+ - **Demo:** a mannequin running in circles with a ponytail.
38
+
39
+ - **The auto-rig's marker step** (#3349). `markerField3d` shows a mesh's front silhouette with Mixamo's eight markers on it, to be dragged onto the joints, plus a side view for a tail tip. It is an ordinary panel control, so it works on a page, in the scene and in a headset. Symmetry is on by default, hovering names a marker, `handleChange` fires as a marker moves and `handleCommit` when it is let go. The pure half is in `rig-fit`:
40
+ - `rigSilhouette(positions, indices, view)` is a mesh's front or side view as runs on a grid (a few ms).
41
+ - `guessMarkers(silhouette)` gives a first placement read off the outline: the crotch, the arms' row, the neck and the legs. On Tonio's three OBJ meshes it lands within 10% of body height of the hand-placed markers, mostly within 3%.
42
+ - The auto-rig page (`/rig-build/`) now rigs a character from the panel: pick one, drag its markers, and on release it is fitted, bound and walking again (about 0.15 s). **guess** re-places the markers from the silhouette alone.
43
+ - **Arm space for retargeting** (Mixamo's "Character Arm-Space"): `retargeter(source, target, { armSpaceDeg })` and `retargetClip(..., { armSpaceDeg })` turn the upper arms out from the body after retargeting, and the forearm and hand follow. A Kenney chibi's arms are long for its height, so hanging where UAL's hang put its hands half a metre through the floor, and in the retarget demo it looked as if it were kneeling. At 55° it walks like Kenney's own walk for that character, compared side by side: the arms are held out at about 45° and the lowest point is −0.13 m against Kenney's −0.15 m. The retarget page's panel no longer opens over the characters.
44
+ - **System panels for an app's main chrome** (#106, from ensemble). Three new `<tosi-b3d-panel>` controls for a panel with an `icon`:
45
+ - **`exclusive="off"`** lets it stay open beside other system panels. Opening it closes nothing, and the settings panel or an exclusive panel (an inventory) opens and closes over it without closing it. The default is unchanged: one at a time.
46
+ - **`open`** opens it when the scene starts.
47
+ - **Its `screenAnchor` is where it first opens**, so a right-hand column can be declared. A drag still moves it and it reopens there; holding its button still puts it back.
48
+ - **In a headset** the non-exclusive panels that were open follow you in and back out. A left-pinned panel sits left of centre and a right-pinned one right, lower for a lower pixel `top`.
49
+ - A focused `inputField` in one takes typing as it does anywhere: keys come from a window listener, not the DOM (checked).
50
+ - **Screenshot from the scene panel.** A download icon on every scene's standard panel opens a popup with two buttons: **With panels** and **Scene only**. Each saves the canvas as a PNG. Scene only hides the `ui` and `modal` layers and world-layer panels (the system bar included) for the frame and puts them back. The popup closes itself first, so it is never in the picture. It is `b3d.saveScreenshot({ ui, name })` in code, and returns the Blob. `setPanelsHidden(scene)` (frame-panel) is the hide, and returns its undo. Feather's `download` icon is added.
51
+ - **Axial tilt.** Planets lean, with the axis fixed in space as they orbit, so seasons and a ring's shadow on its planet come and go with the year.
52
+ - **Moons orbit their own plane:** `inclination` on a moon (degrees from the ecliptic), by default its planet's equator, as regular moons do. Our Moon takes 5.1°; with the tilt on its holder it had dropped 23° below the ecliptic.
53
+ - **`SOL` carries the real tilts** (Earth 23.4°, Saturn 26.7°, Uranus 82.2°, Venus 2.6°; a negative `day` already makes Venus and Uranus turn backwards). A star system tilts each planet (and its rings).
54
+ - **`tilt` on `<tosi-b3d-planet>`** does the same for a standalone planet; the spin runs about the tilted axis.
55
+ - **What it fixes:** Saturn's rings shadowed nothing in the Solar System demo, because they lay in the plane of the orbit, edge-on to the Sun, and their shadow was a hairline on the equator. The sun's elevation above the rings now runs from −26.7° to +26.7° round Saturn's year: two equinoxes (the demo's clock starts at one) and two solstices.
56
+
57
+ Size: barrel (min, packages external) 1152.8 KB raw / 394.5 KB gz, +3.46% on 0.10.9 (retargeting, the auto-rig and spring bones).
58
+
59
+ ## 0.10.9
60
+
61
+ ### Added
62
+
63
+ - **A compass and a watch** (`import … from 'tosijs-3d/dials'`, not in the barrel: the artwork is 36 KB). Both are drawn by Tonio, and the code only moves their named parts. The compass needle points north as you turn (`sceneCompass(b3d)` follows the active camera, flat or in a headset; north is +Z). On the watch, a dot on the ring is the time of day (noon at the top, midnight at the bottom) and a dot on the bar is how fast it passes, from still to an hour a second. Drag either: `skyWatch(skybox)` reads and writes the sky's `timeOfDay` and `realtimeScale`. Each goes on the system bar as a `<tosi-b3d-panel icon title>`. Feather's `clock` icon is added. `bun run dial-art` re-embeds the SVGs after they are redrawn.
64
+ - **A planet and its sphere terrain are one world** (#3344). Tonio: "if you pick a point in the middle of what looks like the ocean, coast, mountain range on a planet you end up with corresponding terrain in the sphere terrain and vice versa." Either can be the source, stated by one attribute:
65
+ - **`<tosi-b3d-terrain planet="#p">`**: the ground takes its large shape (sea, coasts, mountain ranges) from the planet, scaled to its `radius` with the sea at 0. Its own detail layer and landforms ride on top, and it rebuilds when the planet changes (`planet.shapeKey`). Measured at 200 random places: the ground sits within the detail layer of the globe's height (mean 2.5 m, worst 3.9 m with 5 m of detail), and sea or land agrees except at the waterline.
66
+ - **`<tosi-b3d-planet terrain="#t">`**: the globe is drawn from the ground's own height function, and again whenever the ground's shape changes. This replaces the hand-written `planet.surface = terrain.planetSurface()` loop, and the sphere-map demo now uses it.
67
+
68
+ Linked, not automatic: a gas giant in a moon's sky, or every body of a star system, must not become the ground you stand on. `planet.relativeHeightAt(direction)` is the globe's height above its sea as a fraction of its radius. Both attributes are in the schemas.
69
+ - **Planetary rings catch shadows** (#3320). Both are worked out in the shaders for a sphere and a flat ring lit by one star, with no shadow maps. **The planet's shadow falls across its rings** (the dark wedge behind Saturn): each ring fragment asks whether the ray toward the star passes through the planet, softened slightly at the edge. This applies to any `<tosi-b3d-planet>` with `rings`. **The rings' shadow bands a gas giant**: each fragment finds where the ray toward the star crosses the ring plane and dims by how much ring is there, so the shadow has the ring's own gaps (a lighter stripe where the Cassini gap lets light through). The ring is now one GLSL function (`RING_GLSL` in `gas-giant`) that the ring draws itself from and the planet reads, and `createGasGiantMaterial` takes `ring: () => RingShadow | null` for a planet built by hand. Not yet: the rings' shadow on a ROCKY planet's surface.
70
+
71
+ Size: barrel (min, packages external) 1114.2 KB raw / 379.4 KB gz, +0.46% on 0.10.8.
72
+
9
73
  ## 0.10.8
10
74
 
11
75
  ### Added
@@ -27,6 +27,10 @@ export declare class B3dPanel extends Component {
27
27
  resolution: number;
28
28
  /** 'world' | 'ui' | 'modal': drawn and picked over the world (ui), or over that too (modal). */
29
29
  layer: string;
30
+ /** System panel: 'off' stays open beside other system panels (an app's chrome). */
31
+ exclusive: string;
32
+ /** System panel: open when the scene starts. */
33
+ open: boolean;
30
34
  };
31
35
  static shadowStyleSpec: {
32
36
  ':host': {
@@ -55,6 +59,8 @@ export declare class B3dPanel extends Component {
55
59
  presence: string;
56
60
  flatFrame: string;
57
61
  resolution: number;
62
+ exclusive: string;
63
+ open: boolean;
58
64
  /** Live content (JS only): an SVG, with its own `handlePointer` if it takes the pointer. */
59
65
  svg: SVGSVGElement | null;
60
66
  /** Where it goes in the flat view, in place of the anchor (JS only). */
@@ -1 +1 @@
1
- {"version":3,"file":"b3d-panel.d.ts","sourceRoot":"","sources":["../src/b3d-panel.ts"],"names":[],"mappings":"AA8MA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAClC,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,YAAY,EACZ,YAAY,EACb,MAAM,kBAAkB,CAAA;AAGzB,qBAAa,QAAS,SAAQ,SAAS;IACrC,MAAM,CAAC,gBAAgB,SAAmB;IAE1C,MAAM,CAAC,cAAc;;;;;;;;;;;;;;;;;;;;;QAqBnB,gFAAgF;;QAEhF,gGAAgG;;MAEjG;IAED,MAAM,CAAC,eAAe;;;;MAErB;IAEO,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAE1B,4FAA4F;IAC5F,GAAG,EAAE,aAAa,GAAG,IAAI,CAAO;IA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,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,OAAO,CAAA;IAErB,4FAA4F;IAC5F,GAAG,EAAE,aAAa,GAAG,IAAI,CAAO;IAChC,wEAAwE;IACxE,UAAU,EAAE,YAAY,GAAG,UAAU,GAAG,IAAI,CAAO;IACnD,gGAAgG;IAChG,YAAY,EAAE,YAAY,GAAG,IAAI,CAAO;IACxC,qFAAqF;IACrF,WAAW,EAAE,YAAY,GAAG,UAAU,GAAG,IAAI,CAAO;IACpD,UAAU,SAAI;IAQd,OAAO,CAAC,MAAM,CAA6B;IAC3C,OAAO,CAAC,QAAQ;IAOhB,sDAAsD;IACtD,MAAM,IAAI,cAAc;CAyDzB;AAED,eAAO,MAAM,QAAQ,EAAgC,CACnD,GAAG,IAAI,EAAE,OAAO,EAAE,KACf,QAAQ,CAAA"}
package/dist/b3d-panel.js CHANGED
@@ -148,6 +148,46 @@ preview.append(
148
148
  tosi-b3d { width: 100%; height: 100%; }
149
149
  ```
150
150
 
151
+ ## An app's chrome: several open at once
152
+
153
+ An editor's tools are several panels used together, not one at a time.
154
+ `exclusive="off"` lets a system panel stay open beside the others, `open`
155
+ opens it when the scene starts, and its `screenAnchor` is where it first
156
+ appears (drag one and it reopens where you left it; hold its button to put it
157
+ back). In a headset the same panels follow you in, left column left, right
158
+ column right. An exclusive panel (the settings panel, an inventory) still
159
+ opens and closes over them without closing them.
160
+
161
+ ```js
162
+ import { b3d, b3dPanel, b3dLight, b3dSkybox, b3dGround, panel3d, label3d, slider3d, ui } from 'tosijs-3d'
163
+ import { tosi } from 'tosijs'
164
+
165
+ const { editor } = tosi({ editor: { size: 1, name: 'crate' } })
166
+ // One app panel: open at start, pinned flat to a side of the screen.
167
+ const chrome = (icon, title, screenAnchor, ...widgets) => {
168
+ const el = b3dPanel({ icon, title, exclusive: 'off', open: true })
169
+ el.screenAnchor = screenAnchor
170
+ el.svg = panel3d({ width: 220 }, ...widgets)
171
+ return el
172
+ }
173
+
174
+ preview.append(
175
+ b3d(
176
+ {},
177
+ b3dLight({ y: 1, intensity: 0.8 }),
178
+ b3dSkybox({ timeOfDay: 12 }),
179
+ b3dGround({ width: 20, height: 20, texture: 'checker', textureTiles: 10 }),
180
+ chrome('mousePointer', 'Tools', { left: 8, top: 66 }, label3d({ text: 'select · move · rotate' })),
181
+ chrome('menu', 'Pieces', { left: 8, top: 190 }, label3d({ text: 'crate' }), label3d({ text: 'barrel' })),
182
+ chrome('settings', 'Options', { right: 8, top: 66 }, slider3d({ label: 'size', value: editor.size, min: 0.5, max: 4 })),
183
+ chrome('checkSquare', 'Properties', { right: 8, top: 190 }, ui.inputField({ value: editor.name.value, handleChange: (v) => (editor.name.value = v) })),
184
+ )
185
+ )
186
+ ```
187
+ ```css
188
+ tosi-b3d { width: 100%; height: 100%; }
189
+ ```
190
+
151
191
  ## Three ways to place a panel
152
192
 
153
193
  - **World-anchored (`b3d-svg-plane`)** — a panel that IS a mesh in the scene: visible
@@ -184,6 +224,8 @@ The `<tosi-b3d-panel>` children are the set (none ship by default):
184
224
  | `view` | `both` | `first` / `third` / `both` — restrict to a camera view |
185
225
  | `title` | `''` | Placeholder card title (ignored if `url` set) |
186
226
  | `icon` | `''` | Puts it on the scene's system bar: its button's picture, an `svgIcons` name (e.g. `personStanding`, `book`, `map`); unknown draws a square. Its `title` is the button's tooltip and the panel's caption |
227
+ | `exclusive` | `'on'` | On the system bar: one system panel is open at a time. `'off'` lets this one stay open beside the others and leaves them open when it opens (an app's main chrome: a tool palette, a properties panel). The settings panel and exclusive panels still close each other |
228
+ | `open` | `false` | On the system bar: open when the scene starts (and again in a headset, if it was open flat) |
187
229
  | `chrome` | `''` | On the system bar: the panel opens with the settings panel's title bar (move, its title, ×; flat, a drag moves it and it reopens where you left it; holding its button on the bar puts it back). `'none'` for content with chrome of its own |
188
230
  | `url` | `''` | SVG URL (e.g. a reticle) |
189
231
  | `width` | `0.26` | Panel width (m); height follows aspect |
@@ -197,7 +239,7 @@ The `<tosi-b3d-panel>` children are the set (none ship by default):
197
239
 
198
240
  Four more are JavaScript properties, not attributes, because they are
199
241
  objects: `svg` (live content, in place of an `<svg>` child: an `<svg>` whose own `handlePointer(kind, x, y)`
200
- gets the panel's pointer, such as an `inventoryDock`'s), `screenAnchor` (flat, pinned to the screen's edges in pixels, `%` or `vmin`: `{ left: '2vmin', top: '2vmin' }`), `flatAnchor` (where
242
+ gets the panel's pointer, such as an `inventoryDock`'s), `screenAnchor` (flat, pinned to the screen's edges in pixels, `%` or `vmin`: `{ left: '2vmin', top: '2vmin' }`; for a system panel, where it first opens, before it is dragged, and in a headset which side it goes), `flatAnchor` (where
201
243
  it goes in the flat view instead), `focusAnchor` and `focusScale` (where it
202
244
  comes, and how much bigger, when its content asks for focus with a
203
245
  `panelfocus` event). A system-bar panel with no `svg` opens a card with its title.
@@ -231,6 +273,10 @@ export class B3dPanel extends Component {
231
273
  resolution: 0,
232
274
  /** 'world' | 'ui' | 'modal': drawn and picked over the world (ui), or over that too (modal). */
233
275
  layer: 'world',
276
+ /** System panel: 'off' stays open beside other system panels (an app's chrome). */
277
+ exclusive: 'on',
278
+ /** System panel: open when the scene starts. */
279
+ open: false,
234
280
  };
235
281
  static shadowStyleSpec = {
236
282
  ':host': { display: 'none' }, // config-only element, no visual presence
@@ -301,6 +347,9 @@ export class B3dPanel extends Component {
301
347
  title: this.title || undefined,
302
348
  icon: this.icon || undefined,
303
349
  chrome: this.chrome === 'none' ? 'none' : undefined,
350
+ // 'off' (or a stray `false`, as b3d-utils' isOff reads it).
351
+ exclusive: !['off', 'false', false].includes(this.exclusive),
352
+ open: this.open || undefined,
304
353
  url: this.url || undefined,
305
354
  width: this.width,
306
355
  maxDistance: this.maxDistance > 0 ? this.maxDistance : undefined,
@@ -1 +1 @@
1
- {"version":3,"file":"b3d-panel.js","sourceRoot":"","sources":["../src/b3d-panel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2ME;AACF,4CAA4C;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AASlC,MAAM,OAAO,QAAS,SAAQ,SAAS;IACrC,MAAM,CAAC,gBAAgB,GAAG,gBAAgB,CAAA;IAE1C,MAAM,CAAC,cAAc,GAAG;QACtB,KAAK,EAAE,KAAK;QACZ,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,CAAC;QACV,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,GAAG;QACb,QAAQ,EAAE,EAAE,EAAE,UAAU;QACxB,IAAI,EAAE,CAAC;QACP,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,WAAW;QAClB,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,EAAE;QACR,MAAM,EAAE,EAAE;QACV,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,IAAI;QACX,WAAW,EAAE,EAAE;QACf,UAAU,EAAE,EAAE;QACd,WAAW,EAAE,CAAC;QACd,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,EAAE;QACb,gFAAgF;QAChF,UAAU,EAAE,CAAC;QACb,gGAAgG;QAChG,KAAK,EAAE,OAAO;KACf,CAAA;IAED,MAAM,CAAC,eAAe,GAAG;QACvB,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AAS;YAC7D,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,SAAS;YACjC,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,SAAS;YACxC,YAAY,EAAE,IAAI,CAAC,YAAY,IAAI,SAAS;YAC5C,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,SAAS;YAC1C,UAAU,EAAE,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;SAC9D,CAAA;IACH,CAAC;;AAGH,MAAM,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC,cAAc,EAElC,CAAA"}
@@ -32,6 +32,8 @@ export declare class B3dPlanet extends B3dChild {
32
32
  ringOuter: number;
33
33
  ringOpacity: number;
34
34
  ringColor: string;
35
+ tilt: number;
36
+ terrain: string;
35
37
  world: string;
36
38
  craters: number;
37
39
  seaShallow: string;
@@ -115,6 +117,35 @@ export declare class B3dPlanet extends B3dChild {
115
117
  private _builtSea;
116
118
  private _seaKey;
117
119
  private _surfaceFromMap;
120
+ /** The sea level of the last build, in this planet's units. */
121
+ private _seaAt;
122
+ /** Bumped by every build: what `shapeKey` reports. */
123
+ private _shapeGen;
124
+ /**
125
+ * Changes whenever this planet's SHAPE does (every build). A terrain that
126
+ * takes its shape from this planet (`planet` on the terrain) compares it to
127
+ * know when to rebuild.
128
+ */
129
+ get shapeKey(): string;
130
+ /**
131
+ * HOW HIGH THE GROUND IS ABOVE THE SEA in a direction from the centre, as
132
+ * a fraction of the planet's radius: what this globe draws there, with
133
+ * its sea at 0 (on a world with no sea, its lowest ground). A terrain
134
+ * with `planet` set multiplies it by its own radius, which is how the
135
+ * ground under a pin is the place the globe shows. Null before the
136
+ * planet is built, and for a gas giant.
137
+ */
138
+ relativeHeightAt(d: {
139
+ x: number;
140
+ y: number;
141
+ z: number;
142
+ }): number | null;
143
+ /** The terrain `terrain` names, when it is a sphere. */
144
+ private _linkedTerrain;
145
+ private _terrainWarned;
146
+ private _terrainBuilt;
147
+ private _surfaceFromTerrain;
148
+ private _followTerrain;
118
149
  /**
119
150
  * Fetch `heightMap` (once per URL and sea setting) and rebuild from it. The
120
151
  * planet shows as a smooth ball, in its colours, until the heights arrive.
@@ -138,6 +169,10 @@ export declare class B3dPlanet extends B3dChild {
138
169
  * buildPlanet). Kept as a named step so the build order still reads.
139
170
  */
140
171
  private buildOcean;
172
+ /** The ring's shape, for its shadow on the planet (null: no ring). */
173
+ private _ring;
174
+ /** The ring as the gas giant material's shadow needs it, now. */
175
+ private _ringShadow;
141
176
  private buildRings;
142
177
  /** The rocky world's look, when `world` names one (and it is not a gas giant). */
143
178
  private _look;
@@ -1 +1 @@
1
- {"version":3,"file":"b3d-planet.d.ts","sourceRoot":"","sources":["../src/b3d-planet.ts"],"names":[],"mappings":"AA2MA,OAAO,EAAS,QAAQ,EAA4B,MAAM,gBAAgB,CAAA;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAEpD,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAErE,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAOzE,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGzE,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAC1C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AAGxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAoB1D,qBAAa,SAAU,SAAQ,QAAQ;IACrC,MAAM,CAAC,gBAAgB,SAAoB;IAE3C,MAAM,CAAC,eAAe;;;;MAIrB;IAED,MAAM,CAAC,cAAc;eAIH,IAAI,GAAG,KAAK;;;;;iBAaV,IAAI,GAAG,KAAK;;;qBAKR,IAAI,GAAG,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+CnC;IAED,KAAK,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