@adatechnology/game-items 0.7.2 → 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.
package/dist/index.js CHANGED
@@ -162,6 +162,9 @@ var ITEM_CATEGORIES = [
162
162
  { id: "keys", name: "Keys" }
163
163
  ];
164
164
 
165
+ // src/check-items.ts
166
+ import { ITEM_TOOLS } from "@adatechnology/game-contracts";
167
+
165
168
  // src/consumable.ts
166
169
  var KG_PER_GRAM = 1e-3;
167
170
  var WATER_DENSITY = 1;
@@ -217,6 +220,7 @@ var checkItem = (item, { categories, places }) => {
217
220
  if (item.shelfLife !== void 0 && !isPositive(item.shelfLife)) issue(`has a shelf life of ${item.shelfLife} days`);
218
221
  if (item.portions !== void 0 && !(Number.isInteger(item.portions) && item.portions > 0)) issue(`has ${item.portions} portions`);
219
222
  if (item.durability && !DURABILITY_KINDS.includes(item.durability.kind)) issue(`has unknown durability kind "${item.durability.kind}"`);
223
+ for (const tool of item.tools ?? []) if (!ITEM_TOOLS.includes(tool)) issue(`works as unknown tool "${tool}"`);
220
224
  if (item.consumable) for (const problem of consumableProblems(item.consumable)) issue(problem);
221
225
  const { protection } = item;
222
226
  if (protection) {
@@ -787,7 +791,7 @@ function createFindsProvider(catalog, options = {}) {
787
791
  }
788
792
 
789
793
  // src/finds/place-finds.ts
790
- import { fitsSize } from "@adatechnology/game-interactables";
794
+ import { fitsSize, laidSize } from "@adatechnology/game-interactables";
791
795
  var placeFinds = (stacks, slots, catalog) => {
792
796
  const contents = slots.map(() => null);
793
797
  const leftover = [];
@@ -796,7 +800,7 @@ var placeFinds = (stacks, slots, catalog) => {
796
800
  const stackMax = item.stack ?? 1;
797
801
  let remaining = stack.count;
798
802
  while (remaining > 0) {
799
- const index = slots.findIndex((slot, position) => contents[position] === null && fitsSize(item.size, slot.max));
803
+ const index = slots.findIndex((slot, position) => contents[position] === null && fitsSize(laidSize(item.size, slot.lay), slot.max));
800
804
  if (index < 0) break;
801
805
  const qty = Math.min(remaining, stackMax);
802
806
  contents[index] = { type: item.id, qty, ...stack.data ? { data: { ...stack.data } } : {} };
@@ -1917,19 +1921,1317 @@ var hand_uses_default = [
1917
1921
  ]
1918
1922
  }
1919
1923
  ]
1924
+ },
1925
+ {
1926
+ id: "wash_dishes",
1927
+ body: "two_hands",
1928
+ duration: 3,
1929
+ note: "both hands low in front at the height of a sink basin, the dish tipped toward the body and scrubbed in small circles, three rounds, and back; the scrubbing keys reach under the tap (aimHandUse)",
1930
+ keys: [
1931
+ {
1932
+ t: 0,
1933
+ position: [
1934
+ 0.22,
1935
+ -0.2,
1936
+ -0.4
1937
+ ],
1938
+ rotation: [
1939
+ 0,
1940
+ 0,
1941
+ 0
1942
+ ]
1943
+ },
1944
+ {
1945
+ t: 0.4,
1946
+ position: [
1947
+ 0,
1948
+ -0.55,
1949
+ -0.45
1950
+ ],
1951
+ rotation: [
1952
+ -0.5,
1953
+ 0,
1954
+ 0
1955
+ ],
1956
+ reach: true
1957
+ },
1958
+ {
1959
+ t: 0.7,
1960
+ position: [
1961
+ 0.04,
1962
+ -0.55,
1963
+ -0.41
1964
+ ],
1965
+ rotation: [
1966
+ -0.5,
1967
+ 0,
1968
+ 0
1969
+ ],
1970
+ action: "scrub",
1971
+ reach: true
1972
+ },
1973
+ {
1974
+ t: 0.95,
1975
+ position: [
1976
+ 0,
1977
+ -0.55,
1978
+ -0.37
1979
+ ],
1980
+ rotation: [
1981
+ -0.5,
1982
+ 0,
1983
+ 0
1984
+ ],
1985
+ reach: true
1986
+ },
1987
+ {
1988
+ t: 1.2,
1989
+ position: [
1990
+ -0.04,
1991
+ -0.55,
1992
+ -0.41
1993
+ ],
1994
+ rotation: [
1995
+ -0.5,
1996
+ 0,
1997
+ 0
1998
+ ],
1999
+ reach: true
2000
+ },
2001
+ {
2002
+ t: 1.45,
2003
+ position: [
2004
+ 0,
2005
+ -0.55,
2006
+ -0.45
2007
+ ],
2008
+ rotation: [
2009
+ -0.5,
2010
+ 0,
2011
+ 0
2012
+ ],
2013
+ action: "scrub",
2014
+ reach: true
2015
+ },
2016
+ {
2017
+ t: 1.7,
2018
+ position: [
2019
+ 0.04,
2020
+ -0.55,
2021
+ -0.41
2022
+ ],
2023
+ rotation: [
2024
+ -0.5,
2025
+ 0,
2026
+ 0
2027
+ ],
2028
+ reach: true
2029
+ },
2030
+ {
2031
+ t: 1.95,
2032
+ position: [
2033
+ 0,
2034
+ -0.55,
2035
+ -0.37
2036
+ ],
2037
+ rotation: [
2038
+ -0.5,
2039
+ 0,
2040
+ 0
2041
+ ],
2042
+ reach: true
2043
+ },
2044
+ {
2045
+ t: 2.2,
2046
+ position: [
2047
+ -0.04,
2048
+ -0.55,
2049
+ -0.41
2050
+ ],
2051
+ rotation: [
2052
+ -0.5,
2053
+ 0,
2054
+ 0
2055
+ ],
2056
+ action: "scrub",
2057
+ reach: true
2058
+ },
2059
+ {
2060
+ t: 2.5,
2061
+ position: [
2062
+ 0,
2063
+ -0.55,
2064
+ -0.45
2065
+ ],
2066
+ rotation: [
2067
+ -0.5,
2068
+ 0,
2069
+ 0
2070
+ ],
2071
+ reach: true
2072
+ },
2073
+ {
2074
+ t: 3,
2075
+ position: [
2076
+ 0.22,
2077
+ -0.2,
2078
+ -0.4
2079
+ ],
2080
+ rotation: [
2081
+ 0,
2082
+ 0,
2083
+ 0
2084
+ ]
2085
+ }
2086
+ ]
2087
+ },
2088
+ {
2089
+ id: "fill_cup",
2090
+ body: "hand",
2091
+ duration: 2.5,
2092
+ note: "the cup held upright, forward and low under where the tap runs, kept still while it fills, then brought back up; the keys under the tap reach where the stream is (aimHandUse)",
2093
+ keys: [
2094
+ {
2095
+ t: 0,
2096
+ position: [
2097
+ 0.22,
2098
+ -0.2,
2099
+ -0.4
2100
+ ],
2101
+ rotation: [
2102
+ 0,
2103
+ 0,
2104
+ 0
2105
+ ]
2106
+ },
2107
+ {
2108
+ t: 0.5,
2109
+ position: [
2110
+ 0.05,
2111
+ -0.55,
2112
+ -0.45
2113
+ ],
2114
+ rotation: [
2115
+ 0,
2116
+ 0,
2117
+ 0
2118
+ ],
2119
+ reach: true
2120
+ },
2121
+ {
2122
+ t: 0.7,
2123
+ position: [
2124
+ 0.05,
2125
+ -0.55,
2126
+ -0.45
2127
+ ],
2128
+ rotation: [
2129
+ 0,
2130
+ 0,
2131
+ 0
2132
+ ],
2133
+ action: "apply",
2134
+ reach: true
2135
+ },
2136
+ {
2137
+ t: 1.8,
2138
+ position: [
2139
+ 0.05,
2140
+ -0.55,
2141
+ -0.45
2142
+ ],
2143
+ rotation: [
2144
+ 0,
2145
+ 0,
2146
+ 0
2147
+ ],
2148
+ reach: true
2149
+ },
2150
+ {
2151
+ t: 2.1,
2152
+ position: [
2153
+ 0.15,
2154
+ -0.32,
2155
+ -0.42
2156
+ ],
2157
+ rotation: [
2158
+ 0,
2159
+ 0,
2160
+ 0
2161
+ ]
2162
+ },
2163
+ {
2164
+ t: 2.5,
2165
+ position: [
2166
+ 0.22,
2167
+ -0.2,
2168
+ -0.4
2169
+ ],
2170
+ rotation: [
2171
+ 0,
2172
+ 0,
2173
+ 0
2174
+ ]
2175
+ }
2176
+ ]
2177
+ },
2178
+ {
2179
+ id: "drink_cupped_hands",
2180
+ body: "two_hands",
2181
+ duration: 5,
2182
+ note: "bent over the sink: both hands cupped under the running tap, the water caught in them lifted to the mouth and drunk, three handfuls, and back; the cupped hands reach under the stream (aimHandUse) and come up to the mouth",
2183
+ keys: [
2184
+ {
2185
+ t: 0,
2186
+ position: [
2187
+ 0.22,
2188
+ -0.2,
2189
+ -0.4
2190
+ ],
2191
+ rotation: [
2192
+ 0,
2193
+ 0,
2194
+ 0
2195
+ ]
2196
+ },
2197
+ {
2198
+ t: 0.5,
2199
+ position: [
2200
+ 0,
2201
+ -0.55,
2202
+ -0.42
2203
+ ],
2204
+ rotation: [
2205
+ -0.3,
2206
+ 0,
2207
+ 0
2208
+ ],
2209
+ reach: true
2210
+ },
2211
+ {
2212
+ t: 1,
2213
+ position: [
2214
+ 0,
2215
+ -0.55,
2216
+ -0.42
2217
+ ],
2218
+ rotation: [
2219
+ -0.3,
2220
+ 0,
2221
+ 0
2222
+ ],
2223
+ reach: true
2224
+ },
2225
+ {
2226
+ t: 1.45,
2227
+ position: [
2228
+ 0,
2229
+ 0,
2230
+ -0.22
2231
+ ],
2232
+ rotation: [
2233
+ -0.9,
2234
+ 0,
2235
+ 0
2236
+ ],
2237
+ action: "swallow"
2238
+ },
2239
+ {
2240
+ t: 1.7,
2241
+ position: [
2242
+ 0,
2243
+ 0,
2244
+ -0.22
2245
+ ],
2246
+ rotation: [
2247
+ -0.9,
2248
+ 0,
2249
+ 0
2250
+ ]
2251
+ },
2252
+ {
2253
+ t: 1.9,
2254
+ position: [
2255
+ 0,
2256
+ -0.55,
2257
+ -0.42
2258
+ ],
2259
+ rotation: [
2260
+ -0.3,
2261
+ 0,
2262
+ 0
2263
+ ],
2264
+ reach: true
2265
+ },
2266
+ {
2267
+ t: 2.4,
2268
+ position: [
2269
+ 0,
2270
+ -0.55,
2271
+ -0.42
2272
+ ],
2273
+ rotation: [
2274
+ -0.3,
2275
+ 0,
2276
+ 0
2277
+ ],
2278
+ reach: true
2279
+ },
2280
+ {
2281
+ t: 2.85,
2282
+ position: [
2283
+ 0,
2284
+ 0,
2285
+ -0.22
2286
+ ],
2287
+ rotation: [
2288
+ -0.9,
2289
+ 0,
2290
+ 0
2291
+ ],
2292
+ action: "swallow"
2293
+ },
2294
+ {
2295
+ t: 3.1,
2296
+ position: [
2297
+ 0,
2298
+ 0,
2299
+ -0.22
2300
+ ],
2301
+ rotation: [
2302
+ -0.9,
2303
+ 0,
2304
+ 0
2305
+ ]
2306
+ },
2307
+ {
2308
+ t: 3.3,
2309
+ position: [
2310
+ 0,
2311
+ -0.55,
2312
+ -0.42
2313
+ ],
2314
+ rotation: [
2315
+ -0.3,
2316
+ 0,
2317
+ 0
2318
+ ],
2319
+ reach: true
2320
+ },
2321
+ {
2322
+ t: 3.8,
2323
+ position: [
2324
+ 0,
2325
+ -0.55,
2326
+ -0.42
2327
+ ],
2328
+ rotation: [
2329
+ -0.3,
2330
+ 0,
2331
+ 0
2332
+ ],
2333
+ reach: true
2334
+ },
2335
+ {
2336
+ t: 4.25,
2337
+ position: [
2338
+ 0,
2339
+ 0,
2340
+ -0.22
2341
+ ],
2342
+ rotation: [
2343
+ -0.9,
2344
+ 0,
2345
+ 0
2346
+ ],
2347
+ action: "swallow"
2348
+ },
2349
+ {
2350
+ t: 4.5,
2351
+ position: [
2352
+ 0,
2353
+ 0,
2354
+ -0.22
2355
+ ],
2356
+ rotation: [
2357
+ -0.9,
2358
+ 0,
2359
+ 0
2360
+ ]
2361
+ },
2362
+ {
2363
+ t: 5,
2364
+ position: [
2365
+ 0.22,
2366
+ -0.2,
2367
+ -0.4
2368
+ ],
2369
+ rotation: [
2370
+ 0,
2371
+ 0,
2372
+ 0
2373
+ ]
2374
+ }
2375
+ ]
2376
+ },
2377
+ {
2378
+ id: "lather_body",
2379
+ body: "body",
2380
+ duration: 6.4,
2381
+ note: "bar soap rubbed between wet hands, then over the other forearm, the chest and the belly; foam left on each",
2382
+ keys: [
2383
+ {
2384
+ t: 0,
2385
+ position: [
2386
+ 0.22,
2387
+ -0.2,
2388
+ -0.4
2389
+ ],
2390
+ rotation: [
2391
+ 0,
2392
+ 0,
2393
+ 0
2394
+ ]
2395
+ },
2396
+ {
2397
+ t: 0.4,
2398
+ position: [
2399
+ 0.02,
2400
+ -0.22,
2401
+ -0.32
2402
+ ],
2403
+ rotation: [
2404
+ 0,
2405
+ 0,
2406
+ 1.5
2407
+ ]
2408
+ },
2409
+ {
2410
+ t: 0.7,
2411
+ position: [
2412
+ -0.04,
2413
+ -0.22,
2414
+ -0.32
2415
+ ],
2416
+ rotation: [
2417
+ 0,
2418
+ 0,
2419
+ 1.5
2420
+ ],
2421
+ action: "dose"
2422
+ },
2423
+ {
2424
+ t: 1,
2425
+ position: [
2426
+ 0.05,
2427
+ -0.22,
2428
+ -0.32
2429
+ ],
2430
+ rotation: [
2431
+ 0,
2432
+ 0,
2433
+ 1.5
2434
+ ],
2435
+ action: "lather",
2436
+ surface: "hands"
2437
+ },
2438
+ {
2439
+ t: 1.3,
2440
+ position: [
2441
+ -0.04,
2442
+ -0.22,
2443
+ -0.32
2444
+ ],
2445
+ rotation: [
2446
+ 0,
2447
+ 0,
2448
+ 1.5
2449
+ ]
2450
+ },
2451
+ {
2452
+ t: 1.75,
2453
+ position: [
2454
+ -0.2,
2455
+ -0.3,
2456
+ -0.3
2457
+ ],
2458
+ rotation: [
2459
+ 0,
2460
+ 0,
2461
+ 1.2
2462
+ ]
2463
+ },
2464
+ {
2465
+ t: 2.2,
2466
+ position: [
2467
+ -0.24,
2468
+ -0.2,
2469
+ -0.26
2470
+ ],
2471
+ rotation: [
2472
+ 0,
2473
+ 0,
2474
+ 1.2
2475
+ ],
2476
+ action: "lather",
2477
+ surface: "arms"
2478
+ },
2479
+ {
2480
+ t: 2.65,
2481
+ position: [
2482
+ -0.2,
2483
+ -0.3,
2484
+ -0.3
2485
+ ],
2486
+ rotation: [
2487
+ 0,
2488
+ 0,
2489
+ 1.2
2490
+ ]
2491
+ },
2492
+ {
2493
+ t: 3.1,
2494
+ position: [
2495
+ -0.24,
2496
+ -0.2,
2497
+ -0.26
2498
+ ],
2499
+ rotation: [
2500
+ 0,
2501
+ 0,
2502
+ 1.2
2503
+ ],
2504
+ action: "lather",
2505
+ surface: "arms"
2506
+ },
2507
+ {
2508
+ t: 3.55,
2509
+ position: [
2510
+ 0,
2511
+ -0.32,
2512
+ -0.24
2513
+ ],
2514
+ rotation: [
2515
+ 0,
2516
+ 0,
2517
+ 1.5
2518
+ ]
2519
+ },
2520
+ {
2521
+ t: 4,
2522
+ position: [
2523
+ -0.08,
2524
+ -0.34,
2525
+ -0.24
2526
+ ],
2527
+ rotation: [
2528
+ 0,
2529
+ 0,
2530
+ 1.5
2531
+ ],
2532
+ action: "lather",
2533
+ surface: "torso"
2534
+ },
2535
+ {
2536
+ t: 4.45,
2537
+ position: [
2538
+ 0.06,
2539
+ -0.32,
2540
+ -0.24
2541
+ ],
2542
+ rotation: [
2543
+ 0,
2544
+ 0,
2545
+ 1.5
2546
+ ]
2547
+ },
2548
+ {
2549
+ t: 4.9,
2550
+ position: [
2551
+ 0,
2552
+ -0.5,
2553
+ -0.26
2554
+ ],
2555
+ rotation: [
2556
+ 0,
2557
+ 0,
2558
+ 1.5
2559
+ ]
2560
+ },
2561
+ {
2562
+ t: 5.35,
2563
+ position: [
2564
+ -0.08,
2565
+ -0.52,
2566
+ -0.26
2567
+ ],
2568
+ rotation: [
2569
+ 0,
2570
+ 0,
2571
+ 1.5
2572
+ ],
2573
+ action: "lather",
2574
+ surface: "torso"
2575
+ },
2576
+ {
2577
+ t: 5.8,
2578
+ position: [
2579
+ 0.06,
2580
+ -0.5,
2581
+ -0.26
2582
+ ],
2583
+ rotation: [
2584
+ 0,
2585
+ 0,
2586
+ 1.5
2587
+ ]
2588
+ },
2589
+ {
2590
+ t: 6.4,
2591
+ position: [
2592
+ 0.22,
2593
+ -0.2,
2594
+ -0.4
2595
+ ],
2596
+ rotation: [
2597
+ 0,
2598
+ 0,
2599
+ 0
2600
+ ]
2601
+ }
2602
+ ]
2603
+ },
2604
+ {
2605
+ id: "shampoo_hair",
2606
+ body: "scalp",
2607
+ duration: 4.5,
2608
+ note: "shampoo poured from the bottle into the palm, then both hands rub the hair at the top of the head; foam left in the hair",
2609
+ keys: [
2610
+ {
2611
+ t: 0,
2612
+ position: [
2613
+ 0.22,
2614
+ -0.2,
2615
+ -0.4
2616
+ ],
2617
+ rotation: [
2618
+ 0,
2619
+ 0,
2620
+ 0
2621
+ ]
2622
+ },
2623
+ {
2624
+ t: 0.45,
2625
+ position: [
2626
+ 0.02,
2627
+ -0.16,
2628
+ -0.32
2629
+ ],
2630
+ rotation: [
2631
+ -2.4,
2632
+ 0,
2633
+ 0
2634
+ ]
2635
+ },
2636
+ {
2637
+ t: 0.8,
2638
+ position: [
2639
+ 0.02,
2640
+ -0.16,
2641
+ -0.32
2642
+ ],
2643
+ rotation: [
2644
+ -2.6,
2645
+ 0,
2646
+ 0
2647
+ ],
2648
+ action: "dose"
2649
+ },
2650
+ {
2651
+ t: 1.2,
2652
+ position: [
2653
+ 0.02,
2654
+ -0.2,
2655
+ -0.34
2656
+ ],
2657
+ rotation: [
2658
+ 0,
2659
+ 0,
2660
+ 0
2661
+ ]
2662
+ },
2663
+ {
2664
+ t: 1.65,
2665
+ position: [
2666
+ -0.05,
2667
+ 0.1,
2668
+ -0.06
2669
+ ],
2670
+ rotation: [
2671
+ 0,
2672
+ 0,
2673
+ 1.2
2674
+ ]
2675
+ },
2676
+ {
2677
+ t: 2.1,
2678
+ position: [
2679
+ 0.05,
2680
+ 0.1,
2681
+ -0.06
2682
+ ],
2683
+ rotation: [
2684
+ 0,
2685
+ 0,
2686
+ 1.2
2687
+ ],
2688
+ action: "lather",
2689
+ surface: "hair"
2690
+ },
2691
+ {
2692
+ t: 2.55,
2693
+ position: [
2694
+ -0.05,
2695
+ 0.1,
2696
+ -0.06
2697
+ ],
2698
+ rotation: [
2699
+ 0,
2700
+ 0,
2701
+ 1.2
2702
+ ]
2703
+ },
2704
+ {
2705
+ t: 3,
2706
+ position: [
2707
+ 0.05,
2708
+ 0.1,
2709
+ -0.06
2710
+ ],
2711
+ rotation: [
2712
+ 0,
2713
+ 0,
2714
+ 1.2
2715
+ ],
2716
+ action: "lather",
2717
+ surface: "hair"
2718
+ },
2719
+ {
2720
+ t: 3.45,
2721
+ position: [
2722
+ -0.05,
2723
+ 0.1,
2724
+ -0.06
2725
+ ],
2726
+ rotation: [
2727
+ 0,
2728
+ 0,
2729
+ 1.2
2730
+ ]
2731
+ },
2732
+ {
2733
+ t: 3.9,
2734
+ position: [
2735
+ 0.05,
2736
+ 0.1,
2737
+ -0.06
2738
+ ],
2739
+ rotation: [
2740
+ 0,
2741
+ 0,
2742
+ 1.2
2743
+ ],
2744
+ action: "lather",
2745
+ surface: "hair"
2746
+ },
2747
+ {
2748
+ t: 4.5,
2749
+ position: [
2750
+ 0.22,
2751
+ -0.2,
2752
+ -0.4
2753
+ ],
2754
+ rotation: [
2755
+ 0,
2756
+ 0,
2757
+ 0
2758
+ ]
2759
+ }
2760
+ ]
2761
+ },
2762
+ {
2763
+ id: "brush_teeth",
2764
+ body: "mouth",
2765
+ duration: 5.9,
2766
+ note: "toothpaste squeezed on the brush, the brush scrubbed side to side in the mouth, foam spat into the basin, the brush rinsed under the tap",
2767
+ keys: [
2768
+ {
2769
+ t: 0,
2770
+ position: [
2771
+ 0.22,
2772
+ -0.2,
2773
+ -0.4
2774
+ ],
2775
+ rotation: [
2776
+ 0,
2777
+ 0,
2778
+ 0
2779
+ ]
2780
+ },
2781
+ {
2782
+ t: 0.5,
2783
+ position: [
2784
+ 0.04,
2785
+ -0.2,
2786
+ -0.34
2787
+ ],
2788
+ rotation: [
2789
+ 0,
2790
+ 0,
2791
+ 1.5
2792
+ ]
2793
+ },
2794
+ {
2795
+ t: 0.9,
2796
+ position: [
2797
+ 0.04,
2798
+ -0.2,
2799
+ -0.34
2800
+ ],
2801
+ rotation: [
2802
+ 0,
2803
+ 0,
2804
+ 1.5
2805
+ ],
2806
+ action: "dose"
2807
+ },
2808
+ {
2809
+ t: 1.4,
2810
+ position: [
2811
+ 0.02,
2812
+ -0.06,
2813
+ -0.17
2814
+ ],
2815
+ rotation: [
2816
+ 0,
2817
+ 0,
2818
+ 1.5
2819
+ ]
2820
+ },
2821
+ {
2822
+ t: 1.7,
2823
+ position: [
2824
+ 0,
2825
+ -0.06,
2826
+ -0.17
2827
+ ],
2828
+ rotation: [
2829
+ 0,
2830
+ 0,
2831
+ 1.5
2832
+ ]
2833
+ },
2834
+ {
2835
+ t: 2,
2836
+ position: [
2837
+ 0.04,
2838
+ -0.06,
2839
+ -0.17
2840
+ ],
2841
+ rotation: [
2842
+ 0,
2843
+ 0,
2844
+ 1.5
2845
+ ],
2846
+ action: "lather",
2847
+ surface: "mouth"
2848
+ },
2849
+ {
2850
+ t: 2.3,
2851
+ position: [
2852
+ 0,
2853
+ -0.06,
2854
+ -0.17
2855
+ ],
2856
+ rotation: [
2857
+ 0,
2858
+ 0,
2859
+ 1.5
2860
+ ]
2861
+ },
2862
+ {
2863
+ t: 2.6,
2864
+ position: [
2865
+ 0.04,
2866
+ -0.06,
2867
+ -0.17
2868
+ ],
2869
+ rotation: [
2870
+ 0,
2871
+ 0,
2872
+ 1.5
2873
+ ],
2874
+ action: "lather",
2875
+ surface: "mouth"
2876
+ },
2877
+ {
2878
+ t: 2.9,
2879
+ position: [
2880
+ 0,
2881
+ -0.06,
2882
+ -0.17
2883
+ ],
2884
+ rotation: [
2885
+ 0,
2886
+ 0,
2887
+ 1.5
2888
+ ]
2889
+ },
2890
+ {
2891
+ t: 3.2,
2892
+ position: [
2893
+ 0.04,
2894
+ -0.06,
2895
+ -0.17
2896
+ ],
2897
+ rotation: [
2898
+ 0,
2899
+ 0,
2900
+ 1.5
2901
+ ],
2902
+ action: "lather",
2903
+ surface: "mouth"
2904
+ },
2905
+ {
2906
+ t: 3.5,
2907
+ position: [
2908
+ 0,
2909
+ -0.06,
2910
+ -0.17
2911
+ ],
2912
+ rotation: [
2913
+ 0,
2914
+ 0,
2915
+ 1.5
2916
+ ]
2917
+ },
2918
+ {
2919
+ t: 3.8,
2920
+ position: [
2921
+ 0.04,
2922
+ -0.06,
2923
+ -0.17
2924
+ ],
2925
+ rotation: [
2926
+ 0,
2927
+ 0,
2928
+ 1.5
2929
+ ],
2930
+ action: "lather",
2931
+ surface: "mouth"
2932
+ },
2933
+ {
2934
+ t: 4.2,
2935
+ position: [
2936
+ 0.02,
2937
+ -0.06,
2938
+ -0.2
2939
+ ],
2940
+ rotation: [
2941
+ 0,
2942
+ 0,
2943
+ 1.5
2944
+ ],
2945
+ action: "spit",
2946
+ surface: "mouth"
2947
+ },
2948
+ {
2949
+ t: 4.7,
2950
+ position: [
2951
+ 0.04,
2952
+ -0.34,
2953
+ -0.44
2954
+ ],
2955
+ rotation: [
2956
+ 0,
2957
+ 0,
2958
+ 1.5
2959
+ ]
2960
+ },
2961
+ {
2962
+ t: 5.3,
2963
+ position: [
2964
+ 0.04,
2965
+ -0.34,
2966
+ -0.44
2967
+ ],
2968
+ rotation: [
2969
+ 0,
2970
+ 0,
2971
+ 1.5
2972
+ ],
2973
+ action: "rinse",
2974
+ surface: "brush"
2975
+ },
2976
+ {
2977
+ t: 5.9,
2978
+ position: [
2979
+ 0.22,
2980
+ -0.2,
2981
+ -0.4
2982
+ ],
2983
+ rotation: [
2984
+ 0,
2985
+ 0,
2986
+ 0
2987
+ ]
2988
+ }
2989
+ ]
2990
+ },
2991
+ {
2992
+ id: "wash_hands",
2993
+ body: "two_hands",
2994
+ duration: 6.5,
2995
+ note: "hands wet under the tap, the bar rubbed between them into foam, rinsed under the water and shaken dry",
2996
+ keys: [
2997
+ {
2998
+ t: 0,
2999
+ position: [
3000
+ 0.22,
3001
+ -0.2,
3002
+ -0.4
3003
+ ],
3004
+ rotation: [
3005
+ 0,
3006
+ 0,
3007
+ 0
3008
+ ]
3009
+ },
3010
+ {
3011
+ t: 0.5,
3012
+ position: [
3013
+ 0,
3014
+ -0.34,
3015
+ -0.44
3016
+ ],
3017
+ rotation: [
3018
+ 0,
3019
+ 0,
3020
+ 1.5
3021
+ ]
3022
+ },
3023
+ {
3024
+ t: 1,
3025
+ position: [
3026
+ 0,
3027
+ -0.34,
3028
+ -0.44
3029
+ ],
3030
+ rotation: [
3031
+ 0,
3032
+ 0,
3033
+ 1.5
3034
+ ],
3035
+ action: "rinse",
3036
+ surface: "hands"
3037
+ },
3038
+ {
3039
+ t: 1.4,
3040
+ position: [
3041
+ 0.02,
3042
+ -0.26,
3043
+ -0.36
3044
+ ],
3045
+ rotation: [
3046
+ 0,
3047
+ 0,
3048
+ 1.5
3049
+ ],
3050
+ action: "dose"
3051
+ },
3052
+ {
3053
+ t: 1.7,
3054
+ position: [
3055
+ -0.04,
3056
+ -0.26,
3057
+ -0.36
3058
+ ],
3059
+ rotation: [
3060
+ 0,
3061
+ 0,
3062
+ 1.5
3063
+ ]
3064
+ },
3065
+ {
3066
+ t: 2,
3067
+ position: [
3068
+ 0.06,
3069
+ -0.26,
3070
+ -0.36
3071
+ ],
3072
+ rotation: [
3073
+ 0,
3074
+ 0,
3075
+ 1.5
3076
+ ],
3077
+ action: "lather",
3078
+ surface: "hands"
3079
+ },
3080
+ {
3081
+ t: 2.3,
3082
+ position: [
3083
+ -0.04,
3084
+ -0.26,
3085
+ -0.36
3086
+ ],
3087
+ rotation: [
3088
+ 0,
3089
+ 0,
3090
+ 1.5
3091
+ ]
3092
+ },
3093
+ {
3094
+ t: 2.6,
3095
+ position: [
3096
+ 0.06,
3097
+ -0.26,
3098
+ -0.36
3099
+ ],
3100
+ rotation: [
3101
+ 0,
3102
+ 0,
3103
+ 1.5
3104
+ ],
3105
+ action: "lather",
3106
+ surface: "hands"
3107
+ },
3108
+ {
3109
+ t: 2.9,
3110
+ position: [
3111
+ -0.04,
3112
+ -0.26,
3113
+ -0.36
3114
+ ],
3115
+ rotation: [
3116
+ 0,
3117
+ 0,
3118
+ 1.5
3119
+ ]
3120
+ },
3121
+ {
3122
+ t: 3.2,
3123
+ position: [
3124
+ 0.06,
3125
+ -0.26,
3126
+ -0.36
3127
+ ],
3128
+ rotation: [
3129
+ 0,
3130
+ 0,
3131
+ 1.5
3132
+ ],
3133
+ action: "lather",
3134
+ surface: "hands"
3135
+ },
3136
+ {
3137
+ t: 3.7,
3138
+ position: [
3139
+ 0,
3140
+ -0.34,
3141
+ -0.44
3142
+ ],
3143
+ rotation: [
3144
+ 0,
3145
+ 0,
3146
+ 1.5
3147
+ ]
3148
+ },
3149
+ {
3150
+ t: 4.6,
3151
+ position: [
3152
+ 0.04,
3153
+ -0.34,
3154
+ -0.44
3155
+ ],
3156
+ rotation: [
3157
+ 0,
3158
+ 0,
3159
+ 1.5
3160
+ ],
3161
+ action: "rinse",
3162
+ surface: "hands"
3163
+ },
3164
+ {
3165
+ t: 5.1,
3166
+ position: [
3167
+ 0.04,
3168
+ -0.24,
3169
+ -0.36
3170
+ ],
3171
+ rotation: [
3172
+ 0,
3173
+ 0,
3174
+ 1.5
3175
+ ]
3176
+ },
3177
+ {
3178
+ t: 5.5,
3179
+ position: [
3180
+ -0.02,
3181
+ -0.24,
3182
+ -0.36
3183
+ ],
3184
+ rotation: [
3185
+ 0,
3186
+ 0,
3187
+ 1.5
3188
+ ],
3189
+ action: "dry",
3190
+ surface: "hands"
3191
+ },
3192
+ {
3193
+ t: 5.9,
3194
+ position: [
3195
+ 0.04,
3196
+ -0.24,
3197
+ -0.36
3198
+ ],
3199
+ rotation: [
3200
+ 0,
3201
+ 0,
3202
+ 1.5
3203
+ ]
3204
+ },
3205
+ {
3206
+ t: 6.5,
3207
+ position: [
3208
+ 0.22,
3209
+ -0.2,
3210
+ -0.4
3211
+ ],
3212
+ rotation: [
3213
+ 0,
3214
+ 0,
3215
+ 0
3216
+ ]
3217
+ }
3218
+ ]
1920
3219
  }
1921
3220
  ];
1922
3221
 
1923
3222
  // src/hand-use.ts
1924
3223
  var HAND_USES = hand_uses_default;
1925
3224
  var handUseOf = (id, defs = HAND_USES) => defs.find((def) => def.id === id);
1926
- var HAND_USE_REACH = 0.62;
3225
+ var HAND_USE_SHOULDER = [0.17, -0.24, 0.04];
3226
+ var HAND_USE_ARM = 0.66;
1927
3227
  var aimHandUse = (def, target) => {
1928
3228
  const anchor = def.keys.find((key) => key.reach);
1929
3229
  if (!anchor) return def;
1930
- const length = Math.hypot(target[0], target[1], target[2]);
1931
- const k = length > HAND_USE_REACH ? HAND_USE_REACH / length : 1;
1932
- const shift = [target[0] * k - anchor.position[0], target[1] * k - anchor.position[1], target[2] * k - anchor.position[2]];
3230
+ const [sx, sy, sz] = HAND_USE_SHOULDER;
3231
+ const length = Math.hypot(target[0] - sx, target[1] - sy, target[2] - sz);
3232
+ const k = length > HAND_USE_ARM ? HAND_USE_ARM / length : 1;
3233
+ const reached = [sx + (target[0] - sx) * k, sy + (target[1] - sy) * k, sz + (target[2] - sz) * k];
3234
+ const shift = [reached[0] - anchor.position[0], reached[1] - anchor.position[1], reached[2] - anchor.position[2]];
1933
3235
  const moved = (key) => ({ ...key, position: [key.position[0] + shift[0], key.position[1] + shift[1], key.position[2] + shift[2]] });
1934
3236
  return { ...def, keys: def.keys.map((key) => key.reach ? moved(key) : key) };
1935
3237
  };
@@ -1969,7 +3271,8 @@ var createHandUse = (def) => {
1969
3271
  const events = [];
1970
3272
  while (reached < actions.length && actions[reached].t <= time) {
1971
3273
  reached++;
1972
- events.push({ action: actions[reached - 1].action, share: reached / actions.length });
3274
+ const key = actions[reached - 1];
3275
+ events.push({ action: key.action, share: reached / actions.length, ...key.surface ? { surface: key.surface } : {} });
1973
3276
  }
1974
3277
  done = time >= def.duration;
1975
3278
  return events;
@@ -2000,7 +3303,8 @@ export {
2000
3303
  FOAM_GONE,
2001
3304
  FOAM_RINSE_LITRES,
2002
3305
  HAND_USES,
2003
- HAND_USE_REACH,
3306
+ HAND_USE_ARM,
3307
+ HAND_USE_SHOULDER,
2004
3308
  ITEM_CATEGORIES,
2005
3309
  RARITIES,
2006
3310
  addFoam,