tosijs-3d 0.12.5 → 0.13.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.
- package/CHANGELOG.md +2 -2
- package/Migration.md +18 -0
- package/README.md +8 -2
- package/changelog/v0.12.6.md +46 -0
- package/changelog/v0.13.0.md +48 -0
- package/dist/aim-ik.d.ts +13 -0
- package/dist/aim-ik.d.ts.map +1 -0
- package/dist/aim-ik.js +111 -0
- package/dist/aim-ik.js.map +1 -0
- package/dist/b3d-biped.d.ts +5 -0
- package/dist/b3d-biped.d.ts.map +1 -1
- package/dist/b3d-biped.js +59 -1
- package/dist/b3d-biped.js.map +1 -1
- package/dist/b3d-cloud-deck.d.ts +7 -0
- package/dist/b3d-cloud-deck.d.ts.map +1 -1
- package/dist/b3d-cloud-deck.js +10 -2
- package/dist/b3d-cloud-deck.js.map +1 -1
- package/dist/b3d-crowd.d.ts +31 -0
- package/dist/b3d-crowd.d.ts.map +1 -1
- package/dist/b3d-crowd.js +191 -3
- package/dist/b3d-crowd.js.map +1 -1
- package/dist/b3d-hud.d.ts.map +1 -1
- package/dist/b3d-hud.js +3 -1
- package/dist/b3d-hud.js.map +1 -1
- package/dist/b3d-launcher.d.ts.map +1 -1
- package/dist/b3d-launcher.js +5 -2
- package/dist/b3d-launcher.js.map +1 -1
- package/dist/b3d-panel.d.ts +3 -0
- package/dist/b3d-panel.d.ts.map +1 -1
- package/dist/b3d-panel.js +3 -0
- package/dist/b3d-panel.js.map +1 -1
- package/dist/b3d-skybox.d.ts +3 -0
- package/dist/b3d-skybox.d.ts.map +1 -1
- package/dist/b3d-skybox.js +40 -17
- package/dist/b3d-skybox.js.map +1 -1
- package/dist/b3d-sound.d.ts.map +1 -1
- package/dist/b3d-sound.js +18 -5
- package/dist/b3d-sound.js.map +1 -1
- package/dist/b3d-utils.d.ts +1 -0
- package/dist/b3d-utils.d.ts.map +1 -1
- package/dist/b3d-utils.js +79 -0
- package/dist/b3d-utils.js.map +1 -1
- package/dist/bar-menu.d.ts +1 -1
- package/dist/bar-menu.d.ts.map +1 -1
- package/dist/bar-menu.js +187 -136
- package/dist/bar-menu.js.map +1 -1
- package/dist/body-export.d.ts +25 -0
- package/dist/body-export.d.ts.map +1 -1
- package/dist/body-export.js +61 -3
- package/dist/body-export.js.map +1 -1
- package/dist/body-sweep.d.ts +47 -0
- package/dist/body-sweep.d.ts.map +1 -0
- package/dist/body-sweep.js +468 -0
- package/dist/body-sweep.js.map +1 -0
- package/dist/bvh.d.ts +26 -0
- package/dist/bvh.d.ts.map +1 -0
- package/dist/bvh.js +415 -0
- package/dist/bvh.js.map +1 -0
- package/dist/character-builder.d.ts.map +1 -1
- package/dist/character-builder.js +179 -53
- package/dist/character-builder.js.map +1 -1
- package/dist/character-core.js +3 -3
- package/dist/character-file.d.ts +12 -0
- package/dist/character-file.d.ts.map +1 -1
- package/dist/character-file.js +27 -0
- package/dist/character-file.js.map +1 -1
- package/dist/character-sources.d.ts +4 -2
- package/dist/character-sources.d.ts.map +1 -1
- package/dist/character-sources.js +16 -4
- package/dist/character-sources.js.map +1 -1
- package/dist/character-store.d.ts +1 -1
- package/dist/character-store.d.ts.map +1 -1
- package/dist/character-store.js +15 -0
- package/dist/character-store.js.map +1 -1
- package/dist/character.d.ts +38 -4
- package/dist/character.d.ts.map +1 -1
- package/dist/character.js +346 -33
- package/dist/character.js.map +1 -1
- package/dist/city-drive.js +3 -3
- package/dist/clip-store.d.ts +17 -0
- package/dist/clip-store.d.ts.map +1 -0
- package/dist/clip-store.js +42 -0
- package/dist/clip-store.js.map +1 -0
- package/dist/cloth-bake.d.ts +23 -1
- package/dist/cloth-bake.d.ts.map +1 -1
- package/dist/cloth-bake.js +88 -0
- package/dist/cloth-bake.js.map +1 -1
- package/dist/cross-country.js +3 -3
- package/dist/effect-audio.d.ts +6 -0
- package/dist/effect-audio.d.ts.map +1 -1
- package/dist/effect-audio.js +23 -1
- package/dist/effect-audio.js.map +1 -1
- package/dist/eye-art.d.ts +19 -0
- package/dist/eye-art.d.ts.map +1 -1
- package/dist/eye-art.js +73 -0
- package/dist/eye-art.js.map +1 -1
- package/dist/frame-panel.d.ts +6 -0
- package/dist/frame-panel.d.ts.map +1 -1
- package/dist/frame-panel.js +13 -0
- package/dist/frame-panel.js.map +1 -1
- package/dist/garment-cut.d.ts.map +1 -1
- package/dist/garment-cut.js +4 -1
- package/dist/garment-cut.js.map +1 -1
- package/dist/garment-proxy.d.ts +28 -1
- package/dist/garment-proxy.d.ts.map +1 -1
- package/dist/garment-proxy.js +75 -10
- package/dist/garment-proxy.js.map +1 -1
- package/dist/glb-clips.d.ts +2 -0
- package/dist/glb-clips.d.ts.map +1 -1
- package/dist/glb-clips.js +4 -1
- package/dist/glb-clips.js.map +1 -1
- package/dist/glb-rig.d.ts +6 -0
- package/dist/glb-rig.d.ts.map +1 -1
- package/dist/glb-rig.js +17 -0
- package/dist/glb-rig.js.map +1 -1
- package/dist/hair-place.d.ts +29 -1
- package/dist/hair-place.d.ts.map +1 -1
- package/dist/hair-place.js +90 -1
- package/dist/hair-place.js.map +1 -1
- package/dist/human-face.d.ts.map +1 -1
- package/dist/human-face.js +7 -74
- package/dist/human-face.js.map +1 -1
- package/dist/human-hair.d.ts +1 -1
- package/dist/human-hair.d.ts.map +1 -1
- package/dist/human-hair.js +1 -1
- package/dist/human-hair.js.map +1 -1
- package/dist/index.d.ts +13 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/jpeg.d.ts +6 -0
- package/dist/jpeg.d.ts.map +1 -0
- package/dist/jpeg.js +534 -0
- package/dist/jpeg.js.map +1 -0
- package/dist/moon-light.d.ts +16 -0
- package/dist/moon-light.d.ts.map +1 -0
- package/dist/moon-light.js +33 -0
- package/dist/moon-light.js.map +1 -0
- package/dist/outline-field.d.ts +9 -0
- package/dist/outline-field.d.ts.map +1 -1
- package/dist/outline-field.js +83 -5
- package/dist/outline-field.js.map +1 -1
- package/dist/panel-layer.d.ts +9 -0
- package/dist/panel-layer.d.ts.map +1 -1
- package/dist/panel-layer.js +6 -2
- package/dist/panel-layer.js.map +1 -1
- package/dist/playground.d.ts.map +1 -1
- package/dist/playground.js +6 -1
- package/dist/playground.js.map +1 -1
- package/dist/png.d.ts +4 -3
- package/dist/png.d.ts.map +1 -1
- package/dist/png.js +12 -10
- package/dist/png.js.map +1 -1
- package/dist/popup-surface.d.ts +9 -0
- package/dist/popup-surface.d.ts.map +1 -1
- package/dist/popup-surface.js +109 -21
- package/dist/popup-surface.js.map +1 -1
- package/dist/remesh.js +2 -1
- package/dist/remesh.js.map +1 -1
- package/dist/retarget-babylon.d.ts +15 -0
- package/dist/retarget-babylon.d.ts.map +1 -1
- package/dist/retarget-babylon.js +29 -11
- package/dist/retarget-babylon.js.map +1 -1
- package/dist/retarget.d.ts +10 -0
- package/dist/retarget.d.ts.map +1 -1
- package/dist/retarget.js +164 -0
- package/dist/retarget.js.map +1 -1
- package/dist/rig-build.d.ts.map +1 -1
- package/dist/rig-build.js +23 -7
- package/dist/rig-build.js.map +1 -1
- package/dist/rig-fit.d.ts +21 -0
- package/dist/rig-fit.d.ts.map +1 -1
- package/dist/rig-fit.js +69 -2
- package/dist/rig-fit.js.map +1 -1
- package/dist/rig-recipe.d.ts +12 -1
- package/dist/rig-recipe.d.ts.map +1 -1
- package/dist/rig-recipe.js +26 -0
- package/dist/rig-recipe.js.map +1 -1
- package/dist/rig-tool.d.ts.map +1 -1
- package/dist/rig-tool.js +101 -17
- package/dist/rig-tool.js.map +1 -1
- package/dist/rigged-body-glb.d.ts +69 -1
- package/dist/rigged-body-glb.d.ts.map +1 -1
- package/dist/rigged-body-glb.js +164 -40
- package/dist/rigged-body-glb.js.map +1 -1
- package/dist/rigged-body.d.ts +3 -1
- package/dist/rigged-body.d.ts.map +1 -1
- package/dist/rigged-body.js +4 -0
- package/dist/rigged-body.js.map +1 -1
- package/dist/scene-schemas.d.ts.map +1 -1
- package/dist/scene-schemas.js +4 -0
- package/dist/scene-schemas.js.map +1 -1
- package/dist/shadow-decal.d.ts.map +1 -1
- package/dist/shadow-decal.js +3 -0
- package/dist/shadow-decal.js.map +1 -1
- package/dist/shared-mute.d.ts +8 -0
- package/dist/shared-mute.d.ts.map +1 -0
- package/dist/shared-mute.js +30 -0
- package/dist/shared-mute.js.map +1 -0
- package/dist/skin-paint.d.ts +15 -0
- package/dist/skin-paint.d.ts.map +1 -1
- package/dist/skin-paint.js +34 -0
- package/dist/skin-paint.js.map +1 -1
- package/dist/system-bar.d.ts.map +1 -1
- package/dist/system-bar.js +8 -2
- package/dist/system-bar.js.map +1 -1
- package/dist/tailor-panel.d.ts.map +1 -1
- package/dist/tailor-panel.js +13 -5
- package/dist/tailor-panel.js.map +1 -1
- package/dist/tailor-recipe.d.ts +65 -0
- package/dist/tailor-recipe.d.ts.map +1 -0
- package/dist/tailor-recipe.js +260 -0
- package/dist/tailor-recipe.js.map +1 -0
- package/dist/tailor-tool.d.ts +2 -17
- package/dist/tailor-tool.d.ts.map +1 -1
- package/dist/tailor-tool.js +77 -129
- package/dist/tailor-tool.js.map +1 -1
- package/dist/tosi-b3d.d.ts +7 -0
- package/dist/tosi-b3d.d.ts.map +1 -1
- package/dist/tosi-b3d.js +159 -116
- package/dist/tosi-b3d.js.map +1 -1
- package/dist/touch-orbit.d.ts +18 -3
- package/dist/touch-orbit.d.ts.map +1 -1
- package/dist/touch-orbit.js +54 -6
- package/dist/touch-orbit.js.map +1 -1
- package/dist/widgets3d.d.ts +8 -0
- package/dist/widgets3d.d.ts.map +1 -1
- package/dist/widgets3d.js +16 -5
- package/dist/widgets3d.js.map +1 -1
- package/package.json +2 -2
- package/static/attributes.json +9 -1
- package/static/attributes.txt +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -12,9 +12,9 @@ Upgrading across a minor? Start with [Migration](/Migration/).
|
|
|
12
12
|
|
|
13
13
|
## Unreleased
|
|
14
14
|
|
|
15
|
-
## 0.
|
|
15
|
+
## 0.13.0
|
|
16
16
|
|
|
17
|
-
The latest release.
|
|
17
|
+
The latest release. Biped gunplay aims where you look, crowds move figure by figure, system-bar menus cascade flat and in VR, and headset panels, presses and the chase camera behave. Garment exports bake their look only when given the baker. See [0.13.0](/v0.13.0/).
|
|
18
18
|
|
|
19
19
|
## Every version
|
|
20
20
|
|
package/Migration.md
CHANGED
|
@@ -9,6 +9,24 @@ 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.12.x → 0.13.0
|
|
13
|
+
|
|
14
|
+
The peer ranges are unchanged. Four things change under you:
|
|
15
|
+
|
|
16
|
+
1. **`riggedBodyGlb` no longer recolours garment pictures by default.** Its
|
|
17
|
+
`bake` option is now the baker itself: pass `bake: bakeClothLook` (from
|
|
18
|
+
`tosijs-3d/cloth-bake`) to keep the baked look. Without it the pictures
|
|
19
|
+
are written as they are, and it warns once. `bake: false` still means no
|
|
20
|
+
bake; `bake: true` no longer means anything. `exportBody` passes the baker
|
|
21
|
+
for you.
|
|
22
|
+
2. **The settings panel's Slow motion button is gone.** Set `timeScale` on
|
|
23
|
+
the `<tosi-b3d>` from your own control if you want one.
|
|
24
|
+
3. **`barMenu` submenus cascade** beside the list, all on one surface,
|
|
25
|
+
instead of replacing it with a way back. A press opens one; a press on its
|
|
26
|
+
row again closes it.
|
|
27
|
+
4. **`viewMenu` leaves the system bar during a headset session**, since in VR
|
|
28
|
+
the camera is your head. It comes back when the session ends.
|
|
29
|
+
|
|
12
30
|
## 0.11.x → 0.12.0
|
|
13
31
|
|
|
14
32
|
The peer ranges are unchanged. Four things change under you:
|
package/README.md
CHANGED
|
@@ -130,7 +130,10 @@ tubes bored through them, arches, caverns.
|
|
|
130
130
|
|
|
131
131
|
**Biped control** — a [character controller](https://3d.tosijs.net/b3d-biped/)
|
|
132
132
|
with an animation state machine and follow/XR cameras, from a GLB: walk, run
|
|
133
|
-
and sprint, jump, swim, climb ledges
|
|
133
|
+
and sprint, jump, swim, climb ledges, and hold a gun that
|
|
134
|
+
[points where you aim](https://3d.tosijs.net/aim-ik/), crouched or standing.
|
|
135
|
+
[Crowds](https://3d.tosijs.net/b3d-crowd/) of thousands are drawn on the GPU,
|
|
136
|
+
and each figure can be moved, turned and re-clipped.
|
|
134
137
|
|
|
135
138
|
**Any character on one animation library** — [retargeting](https://3d.tosijs.net/retarget/)
|
|
136
139
|
plays the Universal Animation Library's clips on a Mixamo, Kenney or
|
|
@@ -167,6 +170,9 @@ renders as a DOM overlay, as a texture on a surface in the scene, and as a
|
|
|
167
170
|
floating panel in a headset, from the same declaration. Includes a
|
|
168
171
|
[flowing box model](https://3d.tosijs.net/box/), [menus and panels](https://3d.tosijs.net/surface/),
|
|
169
172
|
a data table, and an on-screen keyboard — because a headset has nowhere to type.
|
|
173
|
+
A [system bar](https://3d.tosijs.net/system-bar/) of buttons and
|
|
174
|
+
[cascading menus](https://3d.tosijs.net/bar-menu/) sits in the corner flat and
|
|
175
|
+
up ahead in VR.
|
|
170
176
|
|
|
171
177
|
**SVG textures** — [draw with SVG](https://3d.tosijs.net/svg-texture/), use it as
|
|
172
178
|
a live texture. Designer artwork becomes a HUD, a gauge, or a control surface
|
|
@@ -196,7 +202,7 @@ or a server imports them without Babylon.
|
|
|
196
202
|
|
|
197
203
|
**Pure models, actually tested** — the flight model, ballistics, guidance, biome
|
|
198
204
|
classification, layout and text editing are engine-free and unit-tested (about
|
|
199
|
-
3,
|
|
205
|
+
3,900 tests, run in about a minute with no GPU). If it can be a function of its inputs,
|
|
200
206
|
it is.
|
|
201
207
|
|
|
202
208
|
## Development
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# 0.12.6
|
|
2
|
+
|
|
3
|
+
<!--{ "parent": "CHANGELOG", "order": 9987994 }-->
|
|
4
|
+
|
|
5
|
+
For the character builder and the rig tool: clips from motion capture (BVH) kept in the browser and carried in character files, exports of MakeHuman's body in its clothes, hair, skin, eyes and lashes, a tailor's garment that fits any body, and retargeted feet that stay on the ground. Rigs from markers place the pelvis, neck and the AI cast's knees as UAL's mannequins have them.
|
|
6
|
+
|
|
7
|
+
Size: barrel (min, packages external) 1698.6 KB raw / 591.0 KB gz, up 43.5 KB / 17.5 KB gz (+2.6%) on 0.12.5.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Rig tool: drag a marker forward or back in a side view to set its joint's depth (the fit puts each at the middle of the body's thickness, and the mannequin's pelvis is well behind it). Kept in the rig recipe as `binding.depths`, an offset per marker from the fit's depth; `fitSkeleton`'s `depths`, `bodyFromMarkers`'s `depths` and `rigFromMarkers`'s sixth argument take it too.
|
|
12
|
+
- Rig tool: a **floor** slider (Motion) moves the body up or down from where its soles stand, for one that floats or sinks; kept in the rig recipe as `floor` (metres), and the character builder stands the body the same way. At rest the soles, not the mesh's lowest point, are put on the floor.
|
|
13
|
+
- Character builder: exporting MakeHuman's body writes the clothes it wears (MakeHuman's own and garments of your own made on it), fitted as drawn, with their pictures and looks. `character.exportGarments()` gives them for `riggedBodyGlb`'s `garments` on either kind of body; `onSkin` (`garment-proxy`) binds a piece made for MakeHuman's pack to the skin a body draws, and `packGarmentMaterial` gives a pack piece's material as data.
|
|
14
|
+
- The export of MakeHuman's body carries its eyelashes, drawn and faded as in the builder, following the head. The fade is a small ramp picture, so it needs no vertex alpha (`shortenLashes`, `lashAlpha`, `lashUvs`, `lashPicture` in `eye-art`).
|
|
15
|
+
- The export of MakeHuman's body carries its hair, beard, moustache and brows: Quaternius' pieces placed as the builder places them (scalp hair following the head, tucked under a hat), MakeHuman's own hair and brows bound like clothes, each picture coloured as the builder colours hair (`recolourHair`, `cloth-bake`). A garment may `follow` one joint wholly; `riggedBodyGlb` tucks the skin under clothes only. `readHairLibrary` now gives each part's uvs and material, and `readHairMaterials` the library's pictures.
|
|
16
|
+
- The export of MakeHuman's body carries its skin (its tone as the material, lips and stubble as vertex colours: `skinSurface`, `skin-paint`) and its eyes with Tonio's eye art in its iris colour (`riggedBodyGlb`'s `eyeTexture`, laid on by `gltfEyeUvs`). `character.exportCharacter()` gives the body, garments and eye picture together.
|
|
17
|
+
- Export (rig tool, character builder): **animation** puts the clip playing in the GLB, retargeted onto the skeleton as written, whether it is UAL's, a GLB of your own or a BVH capture. A host passes it as `clip` on the export target (`ExportClip`: the file and the clip's name); `exportClip` reads one into `riggedBodyGlb`'s `clips`.
|
|
18
|
+
- A character file carries the clip it plays when that is one of your own (`clips`: the BVH or GLB file, by name), so it plays on a page that has never seen the file; the builder reads and keeps it on load. `characterStore` keeps the bytes once, as it does garments.
|
|
19
|
+
- A garment's look goes out in its picture: `riggedBodyGlb` writes a recoloured cloth's texture recoloured, so any engine shows what the builder does (`bake: false` keeps the pictures as they came). `bakeClothLook(picture, look)` (`cloth-bake`) is the step on its own.
|
|
20
|
+
- `jpegDecode` and `decodeImage` (`tosijs-3d/jpeg`): JPEGs read with no engine or canvas (baseline and progressive, grey or colour, any chroma subsampling), as `pngDecode`'s `RgbaImage`; `decodeImage` reads either. `pngDecode` now reads grey PNGs too.
|
|
21
|
+
- Character builder: **clips from a file…** takes BVH motion captures as well as GLBs, and keeps them in this browser (`clipStore`, IndexedDB `tosijs-clips`), so they come back next visit; **forget** drops one. `retargetSourceClip` plays a clip held as data (a BVH, or a GLB read with `readGlbClips`) on a loaded skeleton, as `retargetClip` does a loaded one.
|
|
22
|
+
- `readBvh` and `writeBvh` (`tosijs-3d/bvh`): BVH motion capture files read as clips (any skeleton, any Euler order, units guessed or given) that `bakeClip` and `retargetClip` play on any body, and any clip written out as BVH.
|
|
23
|
+
- A tailor's garment fits any body (`tailor-recipe`): a cut records the joints of the body it was drawn on (`TailorCut.on`), and `recutGarment(body, cut)` makes it on another rigged body, its outlines carried by the joints so a hem drawn at the knee stays at the knee. In the tailor, outlines now follow the body when it is reshaped. `fitCut`, `warpOutline`, `outlineLandmarks` and `tailorBody` are the parts.
|
|
24
|
+
- `heldParts(joints, held, bases)` (`tosijs-3d/rigged-body-glb`): a held item for any skeleton at rest, as `riggedBodyGlb` writes one: the socket joint under the hand (local transform and inverse bind), and the item's mesh skinned to it with its materials and pictures. For a GLB writer whose skeleton `riggedBodyGlb` did not make; `riggedBodyGlb` now uses the same code.
|
|
25
|
+
- `loftGarment` (`body-sweep`): a garment lofted along a chain of bones, as rings round the hull of the body's slice plus thickness and an `ease` curve, with mitred or rounded (`steps`) bends and open, sealed or capped ends. It returns a `GarmentCut` binding, so it fits and bends like a tailor's cut. The first piece of the sweep core; no tool uses it yet.
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- Rigs bound from markers put the pelvis behind the thigh joints by 0.028 of the body's height and below them by 0.008, as UAL's mannequins have it, not above them at the middle of the hips' thickness (a seat, a belly or armour moved it). Every marker rig changes, saved ones too: look at yours in a crouch. `fitSkeleton`'s `pelvis: 'middle'` gives the old placement.
|
|
30
|
+
- Rigs bound from markers put the neck joint at the top of the shoulders, an eighth of the way down from the head joint to the pelvis as on UAL's mannequins; on a body with its arms down it sat in the upper chest (5 to 9 cm low on the AI cast), so the head turned from there.
|
|
31
|
+
- Tailor: a new garment, or one with nothing drawn yet, is cut from the body's own triangles (**cloth mesh: as the body**), not draped: the cheapest and surest way. Saved garments keep how they were made.
|
|
32
|
+
- `loadCharacterAssets` no longer fetches Quaternius' hair library (13.9 MB) at start: a character fetches it the first time it wears one of its pieces, and offers the pieces by name before then (`QUATERNIUS_HAIR`). `CharacterAssets.hair` is null until then; `assets.loadHair()` loads it, and `loadCharacterAssets(scene, { hair: 'now' })` keeps the old behaviour.
|
|
33
|
+
- Character builder: the panel runs from the most basic, least changeable choices to the most: tabs Body, Skin, Eyes, Face, Hair, Clothes, Hold, Motion, Export; in the Body tab, shape (gender, age, height) then ancestry then figure (weight, muscle and the rest); in Hair, brows and the style before beard, moustache and stubble. Control paths that moved: `Body/figure/weight`, `Body/figure/muscle`.
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
|
|
37
|
+
- Retargeted clips keep the feet on the ground on bodies whose thigh and shin are proportioned differently from the clip's (the rig tool's AI characters crouched with one foot in the air): a foot near the ground goes where the source's went and the leg bends to reach it; a foot in the air keeps the copied angles. On by default in `retargeter`, `retargetClip` and `bakeClip`; `footIk: false` turns it off.
|
|
38
|
+
- Rig tool: a recipe handed over through `api.recipe` with new markers now binds the mesh again (it kept the old binding).
|
|
39
|
+
- The African American female's and Eurasian male's knee joints sit higher (2.5 and 4.4 cm), at the hollow behind the knee rather than below it.
|
|
40
|
+
- Tailor: switching to a slot that wears something the body shown cannot (MakeHuman's shoes while another body is on show) opened as "(new garment)" but said there was no outline; it now starts a new garment.
|
|
41
|
+
- Tailor: undo and redo work while an outline is being clicked out, a point at a time (they did nothing until it was closed). `outlineField3d` gains `undoPoint`/`redoPoint`. A panel's tooltips stay inside its padding, so the undo button's is no longer cut off at the edge.
|
|
42
|
+
- `riggedBodyGlb` wrote a garment's uvs upside down (ours run up the image, glTF's down), so a textured garment's picture landed flipped on it in other engines.
|
|
43
|
+
- The tailor could not cut a large garment ("Maximum call stack size exceeded"): a big cut's triangle list was spread into a call. The same pattern is gone from `remesh` and `loadRigTriangles`.
|
|
44
|
+
- A body opened from the builder's own export GLB (`riggedBodyGlb`) is its skin and eyes only: `glbRigTriangles`, `loadRigTriangles` and `loadSkinnedBody` leave out the garments and the held item it also carries, which were merged into the body.
|
|
45
|
+
- A menu opened from a scene panel (a select's list) closes on a press anywhere else: outside it, or on its panel anywhere but the control that opened it, which still toggles it. `showLayer` takes `dismissOutside`, and `showPopup` (every menu) asks for it.
|
|
46
|
+
- A popup dropped with its title band off screen comes back on release until the band is reachable (its top on screen, 48 px of it across), as a frame panel's screen drag already does. It may still be slid partly off to see past it.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# 0.13.0
|
|
2
|
+
|
|
3
|
+
<!--{ "parent": "CHANGELOG", "order": 9987000 }-->
|
|
4
|
+
|
|
5
|
+
Biped gunplay that aims where you look, crowds you can move figure by figure, cascading system-bar menus that work flat and in a headset (the character builder's Animation menu among them), and a round of headset fixes: panels that keep their place under the bar, presses from either hand, a chase camera that keeps its seat. Garment exports bake their cloth look only when given the baker.
|
|
6
|
+
|
|
7
|
+
Size: barrel (min, packages external) 1707.6 KB raw / 594.0 KB gz, up 9.2 KB / 3.0 KB gz (+0.5%) on 0.12.6.
|
|
8
|
+
|
|
9
|
+
### ⚠️ Breaking
|
|
10
|
+
|
|
11
|
+
- `riggedBodyGlb` bakes a garment's cloth look only when given the baker: pass `bake: bakeClothLook` (from `tosijs-3d/cloth-bake`). Without it the pictures are written as they are, and a bundle that imports `tosijs-3d/rigged-body-glb` alone no longer carries an image decoder (about 11 KiB gzip less; the barrel still exports both). It warns once when a garment has a look and no baker. `exportBody` passes it. `bake: false` still means no bake.
|
|
12
|
+
|
|
13
|
+
See [Migration](/Migration/) for the other changes that need attention (Slow motion removed, cascading `barMenu` submenus, `viewMenu` in a headset).
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- `<tosi-b3d-crowd>`: `setFigure(i, { x, y, z, yaw, clip, speed })` moves, turns or re-clips a figure; changes are uploaded once per frame however many figures moved. `clipNames` lists the clips. The doc page has a demo of walkers crossing a field.
|
|
18
|
+
- `aimSpine(chain, held, target)` turns a spine after the clips have posed it so a held item points along an aim.
|
|
19
|
+
- `<tosi-b3d-cloud-deck sky-clock="off">`: the deck drifts in world time, not the sky's, so a fast day passes under clouds that move at their own pace. City Drive and Cross Country use it.
|
|
20
|
+
- `<tosi-b3d-panel bar-button="off">`: a system panel with no button of its own on the bar, for one something else opens (`el.show()` from a menu entry).
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- `<tosi-b3d-biped>` holding a weapon in `gunplay` points it along its aim: the spine is turned after the animations. Crouched, the gun used to point about 45° low, and standing 11° low.
|
|
25
|
+
- `viewMenu` leaves the system bar during a headset session; in VR the camera is your head.
|
|
26
|
+
- A trackpad pinch on an orbit camera zooms three times as far (`PINCH_GAIN`), and pinching works in Safari, which sends gesture events rather than a ctrl-wheel.
|
|
27
|
+
- The character builder has an **Animation** menu on the system bar (play/pause and the clip); its **Playback controls** entry opens a small panel for scrubbing and speed. The page is titled **Character Builder**. While rigging, Play goes to the perspective view and Pause back to the face view last held.
|
|
28
|
+
- `barMenu` submenus open beside the list (cascading, all on one surface) instead of replacing it with a way back. A submenu opens on a press, and a press on its row again closes it.
|
|
29
|
+
- A system panel's button on the system bar stays lit while its panel is open (its HTML button carries `aria-pressed`).
|
|
30
|
+
- Nothing is heard before the scene is shown: the effect voices (traffic, street lights, effects) and Babylon's own sounds stay silent until the loading spinner gives way. `holdEffectAudio()` (from `tosijs-3d/effect-audio`) holds them for a page's own reasons.
|
|
31
|
+
- The settings panel no longer has a Slow motion button. Set `timeScale` from a page that wants one.
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
- In a headset, a system panel whose content grows after it opens (the rig tool once a body is rigged, the tailor) grows downward from under the system bar. It used to grow about its centre, up over the bar. `attachFramePanel` takes `keepTop: true` for this.
|
|
36
|
+
- A trackpad pinch sent as ctrl-wheel notches (many Windows trackpad drivers) zooms one wheel step a notch; each notch used to move the camera about twenty times as far.
|
|
37
|
+
- `<tosi-b3d-launcher>`'s `reloadModel()` no longer disposes the library's materials with the old model: after the first weapon swap, every weapon from that library was drawn white (the Biped Playground's loadout). `<tosi-b3d-crowd>`'s actors had the same fault when removed.
|
|
38
|
+
- `<tosi-b3d-hud>`: changing `size` resizes the HUD straight away; it used to wait for the next window resize. Any `handleResize()` call made after setting it can go.
|
|
39
|
+
- `<tosi-b3d-sound>` removed while its file loads no longer throws an unhandled rejection ("No volume subnode"); it is disposed once Babylon has finished loading it, and never starts playing.
|
|
40
|
+
- Removing a `<tosi-b3d>` no longer warns "WebGL context LOST": the teardown loses the context on purpose. An unexpected loss still warns.
|
|
41
|
+
- A skybox with its own `<tosi-b3d-moon>`s takes its night light from the brightest moon above the horizon. A moon that has set no longer lights the ground from below, and with every moon set the night has only ambient light.
|
|
42
|
+
- In a headset, a press on the hand that is not pointing now counts on every way into VR (`enterXR` and the biped's own XR camera), not only `<tosi-b3d>`'s.
|
|
43
|
+
- A popup whose content changes shape after it opens follows the new shape. It used to be drawn stretched or squashed until it was closed and opened again.
|
|
44
|
+
- The tailor: an outline that lies past the outline field (one carried over from another body) is clipped to the field, and its points are drawn at the field's edge so you can drag them back. It used to draw over the panel's buttons.
|
|
45
|
+
- In a headset, the system bar follows its panels during the session: a menu that leaves the bar (`viewMenu`) or a panel added late now does so in VR too. It used to keep the buttons it had when you entered.
|
|
46
|
+
- A select (or other popup) in a system panel opens on its own surface in front of the panel instead of being cropped inside it.
|
|
47
|
+
- The biped's aim reticle and the shadow blob under characters and vehicles are never culled. They used to vanish when the spot where they were created went out of view (in a headset, sometimes from one eye only).
|
|
48
|
+
- In a headset, the vehicle chase camera keeps its seat through a brief moment with nothing piloted. It used to take wherever you were looking as forward again, a re-seat you did not ask for.
|
package/dist/aim-ik.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as BABYLON from '@babylonjs/core';
|
|
2
|
+
export interface AimSpineOptions {
|
|
3
|
+
/** 0..1: how much of the correction to apply. Default 1. */
|
|
4
|
+
weight?: number;
|
|
5
|
+
/** The largest turn, degrees, over the whole chain. Default 70. */
|
|
6
|
+
maxDeg?: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Turn `chain` so `held` points along `target`. Returns the angle, degrees,
|
|
10
|
+
* left between them afterwards (0 when it got there).
|
|
11
|
+
*/
|
|
12
|
+
export declare function aimSpine(chain: BABYLON.TransformNode[], held: BABYLON.TransformNode, target: BABYLON.Vector3, options?: AimSpineOptions): number;
|
|
13
|
+
//# sourceMappingURL=aim-ik.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aim-ik.d.ts","sourceRoot":"","sources":["../src/aim-ik.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAE1C,MAAM,WAAW,eAAe;IAC9B,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAyBD;;;GAGG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,OAAO,CAAC,aAAa,EAAE,EAC9B,IAAI,EAAE,OAAO,CAAC,aAAa,EAC3B,MAAM,EAAE,OAAO,CAAC,OAAO,EACvB,OAAO,GAAE,eAAoB,GAC5B,MAAM,CA0DR"}
|
package/dist/aim-ik.js
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/*#
|
|
2
|
+
# aim IK
|
|
3
|
+
|
|
4
|
+
**Point what is held where the aim goes**, by turning the spine after the
|
|
5
|
+
clips have posed the body. An aim pose is drawn standing; laid over a crouch it
|
|
6
|
+
leans with the crouch's hips, and the gun points at the floor. This measures
|
|
7
|
+
where the held thing actually points and turns the spine bones, a share each,
|
|
8
|
+
until it points along the aim.
|
|
9
|
+
|
|
10
|
+
```javascript
|
|
11
|
+
import { aimSpine } from 'tosijs-3d'
|
|
12
|
+
|
|
13
|
+
// Each frame, after the animations (scene.onAfterAnimationsObservable):
|
|
14
|
+
aimSpine([spine01, spine02, spine03], gun, aimDirection, { weight: 1, maxDeg: 70 })
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
- `chain`: the bones to turn, root first (their TransformNodes, which a glTF
|
|
18
|
+
skeleton's bones are linked to)
|
|
19
|
+
- `held`: a node below the chain whose `forward` (its +Z) is the barrel
|
|
20
|
+
- `target`: the world direction to point along
|
|
21
|
+
- `weight` 0..1 eases it in and out; `maxDeg` caps the turn, so a target
|
|
22
|
+
behind the body turns the spine only so far
|
|
23
|
+
|
|
24
|
+
It works on directions in each bone's parent's frame, so a glTF root's
|
|
25
|
+
handedness mirror and a uniform scale make no difference. `<tosi-b3d-biped>`
|
|
26
|
+
runs it on its spine while it holds a weapon in `gunplay`.
|
|
27
|
+
*/
|
|
28
|
+
/*{ "parent": "aim" }*/
|
|
29
|
+
import * as BABYLON from '@babylonjs/core';
|
|
30
|
+
/** The nodes from `node` up to (not including) `top`, top first. */
|
|
31
|
+
function pathBelow(top, node) {
|
|
32
|
+
const path = [];
|
|
33
|
+
let n = node;
|
|
34
|
+
while (n != null && n !== top) {
|
|
35
|
+
path.unshift(n);
|
|
36
|
+
n = n.parent;
|
|
37
|
+
}
|
|
38
|
+
return n === top ? path : null;
|
|
39
|
+
}
|
|
40
|
+
function refresh(nodes) {
|
|
41
|
+
for (const n of nodes)
|
|
42
|
+
n.computeWorldMatrix(true);
|
|
43
|
+
}
|
|
44
|
+
const unit = (v) => {
|
|
45
|
+
const l = v.length();
|
|
46
|
+
return l > 1e-9 ? v.scale(1 / l) : null;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Turn `chain` so `held` points along `target`. Returns the angle, degrees,
|
|
50
|
+
* left between them afterwards (0 when it got there).
|
|
51
|
+
*/
|
|
52
|
+
export function aimSpine(chain, held, target, options = {}) {
|
|
53
|
+
const weight = Math.max(0, Math.min(1, options.weight ?? 1));
|
|
54
|
+
const maxRad = ((options.maxDeg ?? 70) * Math.PI) / 180;
|
|
55
|
+
const want = unit(target);
|
|
56
|
+
if (want == null || chain.length === 0)
|
|
57
|
+
return 0;
|
|
58
|
+
const top = chain[0].parent;
|
|
59
|
+
const below = top != null ? pathBelow(top, held) : null;
|
|
60
|
+
if (top == null || below == null)
|
|
61
|
+
return 0;
|
|
62
|
+
const all = [top, ...below];
|
|
63
|
+
refresh(all);
|
|
64
|
+
const pointing = () => unit(held.getWorldMatrix().getRow(2).toVector3());
|
|
65
|
+
const now = pointing();
|
|
66
|
+
if (now == null)
|
|
67
|
+
return 0;
|
|
68
|
+
const total = Math.acos(Math.max(-1, Math.min(1, BABYLON.Vector3.Dot(now, want))));
|
|
69
|
+
// The whole correction, capped and weighted, shared down the chain.
|
|
70
|
+
let left = Math.min(total, maxRad) * weight;
|
|
71
|
+
for (let k = 0; k < chain.length && left > 1e-5; k++) {
|
|
72
|
+
const bone = chain[k];
|
|
73
|
+
const parent = bone.parent;
|
|
74
|
+
if (parent == null || bone.rotationQuaternion == null)
|
|
75
|
+
continue;
|
|
76
|
+
const from = pointing();
|
|
77
|
+
if (from == null)
|
|
78
|
+
break;
|
|
79
|
+
// The two directions in the bone's PARENT's frame: a turn there is a turn
|
|
80
|
+
// of this bone's local rotation, whatever mirror sits above.
|
|
81
|
+
const inv = parent.getWorldMatrix().clone().invert();
|
|
82
|
+
const a = unit(BABYLON.Vector3.TransformNormal(from, inv));
|
|
83
|
+
const b = unit(BABYLON.Vector3.TransformNormal(want, inv));
|
|
84
|
+
if (a == null || b == null)
|
|
85
|
+
break;
|
|
86
|
+
const axis = unit(BABYLON.Vector3.Cross(a, b));
|
|
87
|
+
const between = Math.acos(Math.max(-1, Math.min(1, BABYLON.Vector3.Dot(a, b))));
|
|
88
|
+
if (axis == null || between < 1e-5)
|
|
89
|
+
break;
|
|
90
|
+
const share = Math.min(between, left / (chain.length - k));
|
|
91
|
+
// Which way round Babylon's axis-angle turns is checked, not assumed.
|
|
92
|
+
let turn = BABYLON.Matrix.RotationAxis(axis, share);
|
|
93
|
+
const test = BABYLON.Vector3.TransformNormal(a, turn);
|
|
94
|
+
if (BABYLON.Vector3.Dot(test, b) < Math.cos(between - share) - 1e-4) {
|
|
95
|
+
turn = BABYLON.Matrix.RotationAxis(axis, -share);
|
|
96
|
+
}
|
|
97
|
+
// Row vectors: the local rotation, then the turn in the parent's frame.
|
|
98
|
+
const local = new BABYLON.Matrix();
|
|
99
|
+
bone.rotationQuaternion.toRotationMatrix(local);
|
|
100
|
+
BABYLON.Quaternion.FromRotationMatrixToRef(local.multiply(turn), bone.rotationQuaternion);
|
|
101
|
+
left -= share;
|
|
102
|
+
refresh(all.slice(all.indexOf(bone)));
|
|
103
|
+
}
|
|
104
|
+
const after = pointing();
|
|
105
|
+
return after == null
|
|
106
|
+
? 0
|
|
107
|
+
: (Math.acos(Math.max(-1, Math.min(1, BABYLON.Vector3.Dot(after, want)))) *
|
|
108
|
+
180) /
|
|
109
|
+
Math.PI;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=aim-ik.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aim-ik.js","sourceRoot":"","sources":["../src/aim-ik.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BE;AACF,uBAAuB;AAEvB,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAS1C,oEAAoE;AACpE,SAAS,SAAS,CAChB,GAAiB,EACjB,IAAkB;IAElB,MAAM,IAAI,GAA4B,EAAE,CAAA;IACxC,IAAI,CAAC,GAAwB,IAAI,CAAA;IACjC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAC9B,IAAI,CAAC,OAAO,CAAC,CAA0B,CAAC,CAAA;QACxC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAA;IACd,CAAC;IACD,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;AAChC,CAAC;AAED,SAAS,OAAO,CAAC,KAA8B;IAC7C,KAAK,MAAM,CAAC,IAAI,KAAK;QAAE,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAA;AACnD,CAAC;AAED,MAAM,IAAI,GAAG,CAAC,CAAkB,EAAE,EAAE;IAClC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAA;IACpB,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AACzC,CAAC,CAAA;AAED;;;GAGG;AACH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C,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;YACrE,GAAG,CAAC;YACJ,IAAI,CAAC,EAAE,CAAA;AACf,CAAC"}
|
package/dist/b3d-biped.d.ts
CHANGED
|
@@ -655,6 +655,11 @@ export declare class B3dBiped extends B3dControllable {
|
|
|
655
655
|
private _aimLayer;
|
|
656
656
|
private _aimLayerKey;
|
|
657
657
|
private _updateAimLayer;
|
|
658
|
+
private _aimIkObs;
|
|
659
|
+
private _aimIkWeight;
|
|
660
|
+
private _aimIkChain;
|
|
661
|
+
private _aimIkOf;
|
|
662
|
+
private _aimIk;
|
|
658
663
|
/** Seconds left of the one-shot fire pose. */
|
|
659
664
|
private _shootFor;
|
|
660
665
|
private _eased;
|
package/dist/b3d-biped.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"b3d-biped.d.ts","sourceRoot":"","sources":["../src/b3d-biped.ts"],"names":[],"mappings":"AAoTA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EACL,OAAO,
|
|
1
|
+
{"version":3,"file":"b3d-biped.d.ts","sourceRoot":"","sources":["../src/b3d-biped.ts"],"names":[],"mappings":"AAoTA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EACL,OAAO,EAOR,MAAM,gBAAgB,CAAA;AAyBvB,OAAO,EAQL,KAAK,GAAG,EAET,MAAM,UAAU,CAAA;AAEjB,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,YAA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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,8EAA8E;IAC9E,YAAY,EAAE,OAAO,CAAO;IAC5B,4FAA4F;IAC5F,MAAM,EAAE,GAAG,CAAO;IAElB,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK;YAsC7B,cAAc;YAYd,cAAc;IAkI5B,OAAO,CAAC,WAAW;IAkFnB,YAAY;IA+CZ,MAAM;CA6BP;AAED,eAAO,MAAM,QAAQ,2CAA4B,CAAA"}
|
package/dist/b3d-biped.js
CHANGED
|
@@ -306,13 +306,14 @@ on: under when you swim under, above otherwise.
|
|
|
306
306
|
*/
|
|
307
307
|
/*{ "parent": "characters-and-vehicles", "order": 10 }*/
|
|
308
308
|
import * as BABYLON from '@babylonjs/core';
|
|
309
|
-
import { collidable, isOff, markUiMesh, refuseOwnAncestor, } from './b3d-utils.js';
|
|
309
|
+
import { collidable, isOff, markUiMesh, pressWithEitherHand, refuseOwnAncestor, sceneDelta, } from './b3d-utils.js';
|
|
310
310
|
import { CLIMB_PHASE, canMantle, mantleClip, mantlePath, defaultMantleLimits, } from './mantle.js';
|
|
311
311
|
import { buoyantStep, diveBuoyancy, submergedFraction, isSwimming, swimBuoyancy, } from './buoyancy.js';
|
|
312
312
|
import { aimFromLook, clampAim, easeAim, aimTarget, surfaceAimLimit, } from './swim-aim.js';
|
|
313
313
|
import { iceSide } from './water-shore.js';
|
|
314
314
|
import { fitChase } from './camera-fit.js';
|
|
315
315
|
import { DEFAULT_AIM_LIMITS, aimDirection as aimToDirection, aimPoseWeights, bodyCatchUp, relaxAim, stepAim, wrapDeg, } from './aim.js';
|
|
316
|
+
import { aimSpine } from './aim-ik.js';
|
|
316
317
|
import { xrControllers } from './gamepad.js';
|
|
317
318
|
import { B3dControllable } from './b3d-controllable.js';
|
|
318
319
|
import { CompositeInputProvider } from './control-input.js';
|
|
@@ -1067,7 +1068,11 @@ export class B3dBiped extends B3dControllable {
|
|
|
1067
1068
|
mat.zOffset = -8;
|
|
1068
1069
|
this._reticle.material = mat;
|
|
1069
1070
|
this._reticle.isPickable = false;
|
|
1071
|
+
// It moves every frame and its bounds are never synced, so it is never
|
|
1072
|
+
// culled: the bounds stayed where it was made, and the sight vanished
|
|
1073
|
+
// whenever that spot was out of view (in a headset, out of one eye's).
|
|
1070
1074
|
this._reticle.doNotSyncBoundingInfo = true;
|
|
1075
|
+
this._reticle.alwaysSelectAsActiveMesh = true;
|
|
1071
1076
|
markUiMesh(this._reticle);
|
|
1072
1077
|
}
|
|
1073
1078
|
const origin = this.aimOrigin;
|
|
@@ -1770,6 +1775,50 @@ export class B3dBiped extends B3dControllable {
|
|
|
1770
1775
|
this._aimLayer = layerOnUpperBody(scene, skeleton, baseGroup, layerGroup);
|
|
1771
1776
|
this._aimLayer?.play(layerClip !== 'Pistol_Shoot');
|
|
1772
1777
|
}
|
|
1778
|
+
/*
|
|
1779
|
+
THE GUN POINTS WHERE THE AIM GOES, whatever the legs are doing. The aim
|
|
1780
|
+
poses are drawn standing; over a crouch they lean with its hips (the gun
|
|
1781
|
+
pointed 56° down at a level aim) and even standing it sat 11° low. So after
|
|
1782
|
+
the clips have posed the body, `aimSpine` turns the spine until the held
|
|
1783
|
+
weapon points along `aimDirection`. Eased in and out over `blendSeconds`.
|
|
1784
|
+
*/
|
|
1785
|
+
_aimIkObs = null;
|
|
1786
|
+
_aimIkWeight = 0;
|
|
1787
|
+
_aimIkChain = null;
|
|
1788
|
+
_aimIkOf = null;
|
|
1789
|
+
_aimIk(scene) {
|
|
1790
|
+
const skeleton = this.entries?.skeletons?.[0] ?? null;
|
|
1791
|
+
const held = this._weapons().find((w) => w.socketed === true)?.mesh;
|
|
1792
|
+
const want = this.gunplay && held != null && !this._swimming ? 1 : 0;
|
|
1793
|
+
const blend = Math.max(0, this.blendSeconds ?? 0.25);
|
|
1794
|
+
const dt = sceneDelta(scene);
|
|
1795
|
+
this._aimIkWeight =
|
|
1796
|
+
blend > 0
|
|
1797
|
+
? want > this._aimIkWeight
|
|
1798
|
+
? Math.min(want, this._aimIkWeight + dt / blend)
|
|
1799
|
+
: Math.max(want, this._aimIkWeight - dt / blend)
|
|
1800
|
+
: want;
|
|
1801
|
+
if (this._aimIkWeight <= 0 || skeleton == null || held == null)
|
|
1802
|
+
return;
|
|
1803
|
+
if (this._aimIkOf !== skeleton) {
|
|
1804
|
+
this._aimIkOf = skeleton;
|
|
1805
|
+
const node = (names) => {
|
|
1806
|
+
const bone = skeleton.bones.find((b) => names.includes(b.name));
|
|
1807
|
+
return bone?.getTransformNode() ?? null;
|
|
1808
|
+
};
|
|
1809
|
+
const chain = [
|
|
1810
|
+
node(['spine_01', 'mixamorig:Spine', 'Spine']),
|
|
1811
|
+
node(['spine_02', 'mixamorig:Spine1', 'Spine1']),
|
|
1812
|
+
node(['spine_03', 'mixamorig:Spine2', 'Spine2']),
|
|
1813
|
+
].filter((n) => n != null);
|
|
1814
|
+
this._aimIkChain = chain.length > 0 ? chain : null;
|
|
1815
|
+
}
|
|
1816
|
+
if (this._aimIkChain == null)
|
|
1817
|
+
return;
|
|
1818
|
+
aimSpine(this._aimIkChain, held, this.aimDirection, {
|
|
1819
|
+
weight: this._aimIkWeight,
|
|
1820
|
+
});
|
|
1821
|
+
}
|
|
1773
1822
|
/** Seconds left of the one-shot fire pose. */
|
|
1774
1823
|
_shootFor = 0;
|
|
1775
1824
|
/*
|
|
@@ -3108,6 +3157,8 @@ export class B3dBiped extends B3dControllable {
|
|
|
3108
3157
|
// The right hand points first (see tosi-b3d: otherwise a first press is lost).
|
|
3109
3158
|
pointerSelectionOptions: { preferredHandedness: 'right' },
|
|
3110
3159
|
});
|
|
3160
|
+
if (xr.pointerSelection != null)
|
|
3161
|
+
pressWithEitherHand(xr, scene);
|
|
3111
3162
|
// Register controller observables BEFORE entering XR so we catch controller connect events
|
|
3112
3163
|
this.setupXRInput(xr);
|
|
3113
3164
|
// Now enter XR
|
|
@@ -3387,6 +3438,7 @@ export class B3dBiped extends B3dControllable {
|
|
|
3387
3438
|
figure = null;
|
|
3388
3439
|
sceneReady(owner, scene) {
|
|
3389
3440
|
super.sceneReady(owner, scene);
|
|
3441
|
+
this._aimIkObs = scene.onAfterAnimationsObservable.add(() => this._aimIk(scene));
|
|
3390
3442
|
const attrs = this;
|
|
3391
3443
|
if ((attrs.character !== '' || this.characterDoc != null) &&
|
|
3392
3444
|
!this.entries) {
|
|
@@ -3608,6 +3660,12 @@ export class B3dBiped extends B3dControllable {
|
|
|
3608
3660
|
this.queueRender();
|
|
3609
3661
|
}
|
|
3610
3662
|
sceneDispose() {
|
|
3663
|
+
if (this._aimIkObs != null) {
|
|
3664
|
+
this.owner?.scene.onAfterAnimationsObservable.remove(this._aimIkObs);
|
|
3665
|
+
this._aimIkObs = null;
|
|
3666
|
+
}
|
|
3667
|
+
this._aimIkOf = null;
|
|
3668
|
+
this._aimIkChain = null;
|
|
3611
3669
|
this._reticle?.dispose();
|
|
3612
3670
|
this._reticle = null;
|
|
3613
3671
|
// The layer owns AnimationGroups it built; the source clips are the GLB's
|