@adatechnology/game-items 0.2.25 → 0.4.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.
@@ -25,9 +25,12 @@ var GameItems = (() => {
25
25
  BODY_SLOTS: () => BODY_SLOTS,
26
26
  DEFAULT_RULES: () => DEFAULT_RULES,
27
27
  DURABILITY_KINDS: () => DURABILITY_KINDS,
28
+ HAND_USES: () => HAND_USES,
29
+ HAND_USE_REACH: () => HAND_USE_REACH,
28
30
  ITEM_CATEGORIES: () => ITEM_CATEGORIES,
29
31
  RARITIES: () => RARITIES,
30
32
  advanceAge: () => advanceAge,
33
+ aimHandUse: () => aimHandUse,
31
34
  bagOption: () => bagOption,
32
35
  blockChance: () => blockChance,
33
36
  canCraft: () => canCraft,
@@ -37,12 +40,14 @@ var GameItems = (() => {
37
40
  checkItems: () => checkItems,
38
41
  craft: () => craft,
39
42
  createFindsProvider: () => createFindsProvider,
43
+ createHandUse: () => createHandUse,
40
44
  createInventory: () => createInventory,
41
45
  createItems: () => createItems,
42
46
  depletionFactor: () => depletionFactor,
43
47
  failsToStart: () => failsToStart,
44
48
  fitsInside: () => fitsInside,
45
49
  freshness: () => freshness,
50
+ handUseOf: () => handUseOf,
46
51
  itemLitres: () => itemLitres,
47
52
  itemsFromArsenal: () => itemsFromArsenal,
48
53
  loadState: () => loadState,
@@ -1084,6 +1089,1078 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
1084
1089
  }
1085
1090
  return { id: "arsenal", items, categories: ARSENAL_CATEGORIES };
1086
1091
  };
1092
+
1093
+ // src/data/hand-uses.json
1094
+ var hand_uses_default = [
1095
+ {
1096
+ id: "eat_food",
1097
+ body: "mouth",
1098
+ duration: 3.4,
1099
+ note: "three bites: the food to the mouth, a bite, down a little to chew, and again",
1100
+ keys: [
1101
+ {
1102
+ t: 0,
1103
+ position: [
1104
+ 0.22,
1105
+ -0.2,
1106
+ -0.4
1107
+ ],
1108
+ rotation: [
1109
+ 0,
1110
+ 0,
1111
+ 0
1112
+ ]
1113
+ },
1114
+ {
1115
+ t: 0.45,
1116
+ position: [
1117
+ 0.01,
1118
+ 0,
1119
+ -0.17
1120
+ ],
1121
+ rotation: [
1122
+ -0.3,
1123
+ 0,
1124
+ 0
1125
+ ],
1126
+ action: "bite"
1127
+ },
1128
+ {
1129
+ t: 0.8,
1130
+ position: [
1131
+ 0.05,
1132
+ -0.08,
1133
+ -0.26
1134
+ ],
1135
+ rotation: [
1136
+ -0.15,
1137
+ 0,
1138
+ 0
1139
+ ]
1140
+ },
1141
+ {
1142
+ t: 1.25,
1143
+ position: [
1144
+ 0.01,
1145
+ 0,
1146
+ -0.17
1147
+ ],
1148
+ rotation: [
1149
+ -0.3,
1150
+ 0,
1151
+ 0
1152
+ ],
1153
+ action: "bite"
1154
+ },
1155
+ {
1156
+ t: 1.6,
1157
+ position: [
1158
+ 0.05,
1159
+ -0.08,
1160
+ -0.26
1161
+ ],
1162
+ rotation: [
1163
+ -0.15,
1164
+ 0,
1165
+ 0
1166
+ ]
1167
+ },
1168
+ {
1169
+ t: 2.05,
1170
+ position: [
1171
+ 0.01,
1172
+ 0,
1173
+ -0.17
1174
+ ],
1175
+ rotation: [
1176
+ -0.3,
1177
+ 0,
1178
+ 0
1179
+ ],
1180
+ action: "bite"
1181
+ },
1182
+ {
1183
+ t: 2.8,
1184
+ position: [
1185
+ 0.05,
1186
+ -0.08,
1187
+ -0.26
1188
+ ],
1189
+ rotation: [
1190
+ -0.15,
1191
+ 0,
1192
+ 0
1193
+ ]
1194
+ },
1195
+ {
1196
+ t: 3.4,
1197
+ position: [
1198
+ 0.22,
1199
+ -0.2,
1200
+ -0.4
1201
+ ],
1202
+ rotation: [
1203
+ 0,
1204
+ 0,
1205
+ 0
1206
+ ]
1207
+ }
1208
+ ]
1209
+ },
1210
+ {
1211
+ id: "drink",
1212
+ body: "mouth",
1213
+ duration: 2.5,
1214
+ note: "a drink without a liquid of its own (a juice box): to the mouth and tipped up, as the fluid drink",
1215
+ keys: [
1216
+ {
1217
+ t: 0,
1218
+ position: [
1219
+ 0.22,
1220
+ -0.2,
1221
+ -0.4
1222
+ ],
1223
+ rotation: [
1224
+ 0,
1225
+ 0,
1226
+ 0
1227
+ ]
1228
+ },
1229
+ {
1230
+ t: 0.5,
1231
+ position: [
1232
+ 0,
1233
+ 0.02,
1234
+ -0.2
1235
+ ],
1236
+ rotation: [
1237
+ 0,
1238
+ 0,
1239
+ 0
1240
+ ]
1241
+ },
1242
+ {
1243
+ t: 0.8,
1244
+ position: [
1245
+ 0,
1246
+ 0.02,
1247
+ -0.2
1248
+ ],
1249
+ rotation: [
1250
+ -1.22,
1251
+ 0,
1252
+ 0
1253
+ ],
1254
+ action: "swallow"
1255
+ },
1256
+ {
1257
+ t: 2,
1258
+ position: [
1259
+ 0,
1260
+ 0.02,
1261
+ -0.2
1262
+ ],
1263
+ rotation: [
1264
+ -1.22,
1265
+ 0,
1266
+ 0
1267
+ ]
1268
+ },
1269
+ {
1270
+ t: 2.5,
1271
+ position: [
1272
+ 0.22,
1273
+ -0.2,
1274
+ -0.4
1275
+ ],
1276
+ rotation: [
1277
+ 0,
1278
+ 0,
1279
+ 0
1280
+ ]
1281
+ }
1282
+ ]
1283
+ },
1284
+ {
1285
+ id: "take_medicine",
1286
+ body: "mouth",
1287
+ duration: 2.6,
1288
+ note: "the box before the chest, shaken for a pill, the pill to the mouth and swallowed",
1289
+ keys: [
1290
+ {
1291
+ t: 0,
1292
+ position: [
1293
+ 0.22,
1294
+ -0.2,
1295
+ -0.4
1296
+ ],
1297
+ rotation: [
1298
+ 0,
1299
+ 0,
1300
+ 0
1301
+ ]
1302
+ },
1303
+ {
1304
+ t: 0.4,
1305
+ position: [
1306
+ 0.06,
1307
+ -0.16,
1308
+ -0.3
1309
+ ],
1310
+ rotation: [
1311
+ 0,
1312
+ 0,
1313
+ 0
1314
+ ]
1315
+ },
1316
+ {
1317
+ t: 0.65,
1318
+ position: [
1319
+ 0.06,
1320
+ -0.16,
1321
+ -0.3
1322
+ ],
1323
+ rotation: [
1324
+ 0,
1325
+ 0,
1326
+ 0.5
1327
+ ]
1328
+ },
1329
+ {
1330
+ t: 0.85,
1331
+ position: [
1332
+ 0.06,
1333
+ -0.16,
1334
+ -0.3
1335
+ ],
1336
+ rotation: [
1337
+ 0,
1338
+ 0,
1339
+ -0.5
1340
+ ]
1341
+ },
1342
+ {
1343
+ t: 1.05,
1344
+ position: [
1345
+ 0.06,
1346
+ -0.16,
1347
+ -0.3
1348
+ ],
1349
+ rotation: [
1350
+ 0,
1351
+ 0,
1352
+ 0
1353
+ ]
1354
+ },
1355
+ {
1356
+ t: 1.6,
1357
+ position: [
1358
+ 0,
1359
+ 0.02,
1360
+ -0.18
1361
+ ],
1362
+ rotation: [
1363
+ -0.6,
1364
+ 0,
1365
+ 0
1366
+ ],
1367
+ action: "swallow"
1368
+ },
1369
+ {
1370
+ t: 2,
1371
+ position: [
1372
+ 0,
1373
+ 0.02,
1374
+ -0.18
1375
+ ],
1376
+ rotation: [
1377
+ -0.6,
1378
+ 0,
1379
+ 0
1380
+ ]
1381
+ },
1382
+ {
1383
+ t: 2.6,
1384
+ position: [
1385
+ 0.22,
1386
+ -0.2,
1387
+ -0.4
1388
+ ],
1389
+ rotation: [
1390
+ 0,
1391
+ 0,
1392
+ 0
1393
+ ]
1394
+ }
1395
+ ]
1396
+ },
1397
+ {
1398
+ id: "apply_dressing",
1399
+ body: "two_hands",
1400
+ duration: 3.2,
1401
+ note: "the dressing laid on the other forearm and wound round it twice",
1402
+ keys: [
1403
+ {
1404
+ t: 0,
1405
+ position: [
1406
+ 0.22,
1407
+ -0.2,
1408
+ -0.4
1409
+ ],
1410
+ rotation: [
1411
+ 0,
1412
+ 0,
1413
+ 0
1414
+ ]
1415
+ },
1416
+ {
1417
+ t: 0.5,
1418
+ position: [
1419
+ -0.06,
1420
+ -0.12,
1421
+ -0.3
1422
+ ],
1423
+ rotation: [
1424
+ 0,
1425
+ 0,
1426
+ 1.2
1427
+ ]
1428
+ },
1429
+ {
1430
+ t: 1,
1431
+ position: [
1432
+ -0.1,
1433
+ -0.15,
1434
+ -0.28
1435
+ ],
1436
+ rotation: [
1437
+ 0.4,
1438
+ 0,
1439
+ 1.4
1440
+ ],
1441
+ action: "apply"
1442
+ },
1443
+ {
1444
+ t: 1.5,
1445
+ position: [
1446
+ -0.02,
1447
+ -0.1,
1448
+ -0.32
1449
+ ],
1450
+ rotation: [
1451
+ 0,
1452
+ 0,
1453
+ 1.2
1454
+ ]
1455
+ },
1456
+ {
1457
+ t: 2,
1458
+ position: [
1459
+ -0.1,
1460
+ -0.15,
1461
+ -0.28
1462
+ ],
1463
+ rotation: [
1464
+ 0.4,
1465
+ 0,
1466
+ 1.4
1467
+ ],
1468
+ action: "apply"
1469
+ },
1470
+ {
1471
+ t: 2.6,
1472
+ position: [
1473
+ -0.06,
1474
+ -0.12,
1475
+ -0.3
1476
+ ],
1477
+ rotation: [
1478
+ 0,
1479
+ 0,
1480
+ 1.2
1481
+ ]
1482
+ },
1483
+ {
1484
+ t: 3.2,
1485
+ position: [
1486
+ 0.22,
1487
+ -0.2,
1488
+ -0.4
1489
+ ],
1490
+ rotation: [
1491
+ 0,
1492
+ 0,
1493
+ 0
1494
+ ]
1495
+ }
1496
+ ]
1497
+ },
1498
+ {
1499
+ id: "use_hygiene",
1500
+ body: "two_hands",
1501
+ duration: 3,
1502
+ note: "soap (or what is rubbed in) between both hands in front of the body, rubbed side to side",
1503
+ keys: [
1504
+ {
1505
+ t: 0,
1506
+ position: [
1507
+ 0.22,
1508
+ -0.2,
1509
+ -0.4
1510
+ ],
1511
+ rotation: [
1512
+ 0,
1513
+ 0,
1514
+ 0
1515
+ ]
1516
+ },
1517
+ {
1518
+ t: 0.4,
1519
+ position: [
1520
+ 0.02,
1521
+ -0.18,
1522
+ -0.32
1523
+ ],
1524
+ rotation: [
1525
+ 0,
1526
+ 0,
1527
+ 1.5
1528
+ ]
1529
+ },
1530
+ {
1531
+ t: 0.7,
1532
+ position: [
1533
+ -0.04,
1534
+ -0.18,
1535
+ -0.32
1536
+ ],
1537
+ rotation: [
1538
+ 0,
1539
+ 0,
1540
+ 1.5
1541
+ ],
1542
+ action: "scrub"
1543
+ },
1544
+ {
1545
+ t: 1,
1546
+ position: [
1547
+ 0.06,
1548
+ -0.18,
1549
+ -0.32
1550
+ ],
1551
+ rotation: [
1552
+ 0,
1553
+ 0,
1554
+ 1.5
1555
+ ]
1556
+ },
1557
+ {
1558
+ t: 1.3,
1559
+ position: [
1560
+ -0.04,
1561
+ -0.18,
1562
+ -0.32
1563
+ ],
1564
+ rotation: [
1565
+ 0,
1566
+ 0,
1567
+ 1.5
1568
+ ],
1569
+ action: "scrub"
1570
+ },
1571
+ {
1572
+ t: 1.6,
1573
+ position: [
1574
+ 0.06,
1575
+ -0.18,
1576
+ -0.32
1577
+ ],
1578
+ rotation: [
1579
+ 0,
1580
+ 0,
1581
+ 1.5
1582
+ ]
1583
+ },
1584
+ {
1585
+ t: 1.9,
1586
+ position: [
1587
+ -0.04,
1588
+ -0.18,
1589
+ -0.32
1590
+ ],
1591
+ rotation: [
1592
+ 0,
1593
+ 0,
1594
+ 1.5
1595
+ ],
1596
+ action: "scrub"
1597
+ },
1598
+ {
1599
+ t: 2.3,
1600
+ position: [
1601
+ 0.02,
1602
+ -0.18,
1603
+ -0.32
1604
+ ],
1605
+ rotation: [
1606
+ 0,
1607
+ 0,
1608
+ 1.5
1609
+ ]
1610
+ },
1611
+ {
1612
+ t: 3,
1613
+ position: [
1614
+ 0.22,
1615
+ -0.2,
1616
+ -0.4
1617
+ ],
1618
+ rotation: [
1619
+ 0,
1620
+ 0,
1621
+ 0
1622
+ ]
1623
+ }
1624
+ ]
1625
+ },
1626
+ {
1627
+ id: "toggle_flashlight",
1628
+ body: "hand",
1629
+ duration: 1.1,
1630
+ note: "the flashlight raised before the chest and pointed ahead, the thumb pressing the tail switch (a small push), and back",
1631
+ keys: [
1632
+ {
1633
+ t: 0,
1634
+ position: [
1635
+ 0.22,
1636
+ -0.2,
1637
+ -0.4
1638
+ ],
1639
+ rotation: [
1640
+ 0,
1641
+ 0,
1642
+ 0
1643
+ ]
1644
+ },
1645
+ {
1646
+ t: 0.35,
1647
+ position: [
1648
+ 0.12,
1649
+ -0.12,
1650
+ -0.42
1651
+ ],
1652
+ rotation: [
1653
+ -1.45,
1654
+ 0,
1655
+ 0
1656
+ ]
1657
+ },
1658
+ {
1659
+ t: 0.47,
1660
+ position: [
1661
+ 0.12,
1662
+ -0.13,
1663
+ -0.42
1664
+ ],
1665
+ rotation: [
1666
+ -1.5,
1667
+ 0,
1668
+ 0
1669
+ ]
1670
+ },
1671
+ {
1672
+ t: 0.52,
1673
+ position: [
1674
+ 0.12,
1675
+ -0.125,
1676
+ -0.42
1677
+ ],
1678
+ rotation: [
1679
+ -1.47,
1680
+ 0,
1681
+ 0
1682
+ ],
1683
+ action: "switch"
1684
+ },
1685
+ {
1686
+ t: 0.7,
1687
+ position: [
1688
+ 0.12,
1689
+ -0.12,
1690
+ -0.42
1691
+ ],
1692
+ rotation: [
1693
+ -1.45,
1694
+ 0,
1695
+ 0
1696
+ ]
1697
+ },
1698
+ {
1699
+ t: 1.1,
1700
+ position: [
1701
+ 0.22,
1702
+ -0.2,
1703
+ -0.4
1704
+ ],
1705
+ rotation: [
1706
+ 0,
1707
+ 0,
1708
+ 0
1709
+ ]
1710
+ }
1711
+ ]
1712
+ },
1713
+ {
1714
+ id: "light_lighter",
1715
+ body: "hand",
1716
+ duration: 1.5,
1717
+ note: "the lighter brought before the chest, the thumb rolled down over the wheel (the lighter dips and tips with it), the flame catches and is held up a moment, and back",
1718
+ keys: [
1719
+ {
1720
+ t: 0,
1721
+ position: [
1722
+ 0.22,
1723
+ -0.2,
1724
+ -0.4
1725
+ ],
1726
+ rotation: [
1727
+ 0,
1728
+ 0,
1729
+ 0
1730
+ ]
1731
+ },
1732
+ {
1733
+ t: 0.4,
1734
+ position: [
1735
+ 0.07,
1736
+ -0.12,
1737
+ -0.34
1738
+ ],
1739
+ rotation: [
1740
+ 0,
1741
+ 0,
1742
+ 0
1743
+ ]
1744
+ },
1745
+ {
1746
+ t: 0.52,
1747
+ position: [
1748
+ 0.07,
1749
+ -0.137,
1750
+ -0.34
1751
+ ],
1752
+ rotation: [
1753
+ 0.14,
1754
+ 0,
1755
+ -0.12
1756
+ ]
1757
+ },
1758
+ {
1759
+ t: 0.58,
1760
+ position: [
1761
+ 0.07,
1762
+ -0.125,
1763
+ -0.34
1764
+ ],
1765
+ rotation: [
1766
+ 0,
1767
+ 0,
1768
+ 0
1769
+ ],
1770
+ action: "ignite"
1771
+ },
1772
+ {
1773
+ t: 1.15,
1774
+ position: [
1775
+ 0.07,
1776
+ -0.115,
1777
+ -0.34
1778
+ ],
1779
+ rotation: [
1780
+ 0,
1781
+ 0,
1782
+ 0
1783
+ ]
1784
+ },
1785
+ {
1786
+ t: 1.5,
1787
+ position: [
1788
+ 0.22,
1789
+ -0.2,
1790
+ -0.4
1791
+ ],
1792
+ rotation: [
1793
+ 0,
1794
+ 0,
1795
+ 0
1796
+ ]
1797
+ }
1798
+ ]
1799
+ },
1800
+ {
1801
+ id: "use_radio",
1802
+ body: "mouth",
1803
+ duration: 3,
1804
+ note: "the radio brought up beside the face, the thumb turning the knob (the radio twists a little with it), held at the mouth while talking, and back down",
1805
+ keys: [
1806
+ {
1807
+ t: 0,
1808
+ position: [
1809
+ 0.22,
1810
+ -0.2,
1811
+ -0.4
1812
+ ],
1813
+ rotation: [
1814
+ 0,
1815
+ 0,
1816
+ 0
1817
+ ]
1818
+ },
1819
+ {
1820
+ t: 0.5,
1821
+ position: [
1822
+ 0.08,
1823
+ -0.05,
1824
+ -0.22
1825
+ ],
1826
+ rotation: [
1827
+ 0,
1828
+ 0,
1829
+ 0.15
1830
+ ]
1831
+ },
1832
+ {
1833
+ t: 0.85,
1834
+ position: [
1835
+ 0.08,
1836
+ -0.05,
1837
+ -0.22
1838
+ ],
1839
+ rotation: [
1840
+ 0,
1841
+ 0,
1842
+ 0.15
1843
+ ]
1844
+ },
1845
+ {
1846
+ t: 1.05,
1847
+ position: [
1848
+ 0.08,
1849
+ -0.05,
1850
+ -0.22
1851
+ ],
1852
+ rotation: [
1853
+ 0,
1854
+ 0.3,
1855
+ 0.15
1856
+ ],
1857
+ action: "tune"
1858
+ },
1859
+ {
1860
+ t: 1.25,
1861
+ position: [
1862
+ 0.08,
1863
+ -0.05,
1864
+ -0.22
1865
+ ],
1866
+ rotation: [
1867
+ 0,
1868
+ 0,
1869
+ 0.15
1870
+ ]
1871
+ },
1872
+ {
1873
+ t: 1.45,
1874
+ position: [
1875
+ 0.05,
1876
+ -0.02,
1877
+ -0.19
1878
+ ],
1879
+ rotation: [
1880
+ -0.1,
1881
+ 0,
1882
+ 0.15
1883
+ ],
1884
+ action: "talk"
1885
+ },
1886
+ {
1887
+ t: 2.4,
1888
+ position: [
1889
+ 0.05,
1890
+ -0.02,
1891
+ -0.19
1892
+ ],
1893
+ rotation: [
1894
+ -0.1,
1895
+ 0,
1896
+ 0.15
1897
+ ]
1898
+ },
1899
+ {
1900
+ t: 3,
1901
+ position: [
1902
+ 0.22,
1903
+ -0.2,
1904
+ -0.4
1905
+ ],
1906
+ rotation: [
1907
+ 0,
1908
+ 0,
1909
+ 0
1910
+ ]
1911
+ }
1912
+ ]
1913
+ },
1914
+ {
1915
+ id: "turn_key",
1916
+ body: "reach",
1917
+ duration: 1.9,
1918
+ note: "the key carried out at arm's length and pointed into the lock (the keys marked reach go to the lock the host aims them at, or stay in the air before the chest), turned about itself a quarter and more, turned back, drawn out",
1919
+ keys: [
1920
+ {
1921
+ t: 0,
1922
+ position: [
1923
+ 0.22,
1924
+ -0.2,
1925
+ -0.4
1926
+ ],
1927
+ rotation: [
1928
+ 0,
1929
+ 0,
1930
+ 0
1931
+ ]
1932
+ },
1933
+ {
1934
+ t: 0.5,
1935
+ position: [
1936
+ 0.1,
1937
+ -0.15,
1938
+ -0.55
1939
+ ],
1940
+ rotation: [
1941
+ 0,
1942
+ 1.524,
1943
+ 0
1944
+ ],
1945
+ reach: true
1946
+ },
1947
+ {
1948
+ t: 0.75,
1949
+ position: [
1950
+ 0.1,
1951
+ -0.15,
1952
+ -0.57
1953
+ ],
1954
+ rotation: [
1955
+ 0,
1956
+ 1.524,
1957
+ 0
1958
+ ],
1959
+ reach: true
1960
+ },
1961
+ {
1962
+ t: 0.84,
1963
+ position: [
1964
+ 0.1,
1965
+ -0.15,
1966
+ -0.57
1967
+ ],
1968
+ rotation: [
1969
+ -1.46,
1970
+ 1.168,
1971
+ 1.45
1972
+ ],
1973
+ reach: true
1974
+ },
1975
+ {
1976
+ t: 0.93,
1977
+ position: [
1978
+ 0.1,
1979
+ -0.15,
1980
+ -0.57
1981
+ ],
1982
+ rotation: [
1983
+ -1.525,
1984
+ 0.77,
1985
+ 1.505
1986
+ ],
1987
+ reach: true
1988
+ },
1989
+ {
1990
+ t: 1.01,
1991
+ position: [
1992
+ 0.1,
1993
+ -0.15,
1994
+ -0.57
1995
+ ],
1996
+ rotation: [
1997
+ -1.552,
1998
+ 0.37,
1999
+ 1.52
2000
+ ],
2001
+ reach: true
2002
+ },
2003
+ {
2004
+ t: 1.1,
2005
+ position: [
2006
+ 0.1,
2007
+ -0.15,
2008
+ -0.57
2009
+ ],
2010
+ rotation: [
2011
+ -1.572,
2012
+ -0.029,
2013
+ 1.524
2014
+ ],
2015
+ action: "turn",
2016
+ reach: true
2017
+ },
2018
+ {
2019
+ t: 1.19,
2020
+ position: [
2021
+ 0.1,
2022
+ -0.15,
2023
+ -0.57
2024
+ ],
2025
+ rotation: [
2026
+ -1.552,
2027
+ 0.37,
2028
+ 1.52
2029
+ ],
2030
+ reach: true
2031
+ },
2032
+ {
2033
+ t: 1.27,
2034
+ position: [
2035
+ 0.1,
2036
+ -0.15,
2037
+ -0.57
2038
+ ],
2039
+ rotation: [
2040
+ -1.525,
2041
+ 0.77,
2042
+ 1.505
2043
+ ],
2044
+ reach: true
2045
+ },
2046
+ {
2047
+ t: 1.34,
2048
+ position: [
2049
+ 0.1,
2050
+ -0.15,
2051
+ -0.57
2052
+ ],
2053
+ rotation: [
2054
+ -1.46,
2055
+ 1.168,
2056
+ 1.45
2057
+ ],
2058
+ reach: true
2059
+ },
2060
+ {
2061
+ t: 1.4,
2062
+ position: [
2063
+ 0.1,
2064
+ -0.15,
2065
+ -0.57
2066
+ ],
2067
+ rotation: [
2068
+ 0,
2069
+ 1.524,
2070
+ 0
2071
+ ],
2072
+ reach: true
2073
+ },
2074
+ {
2075
+ t: 1.55,
2076
+ position: [
2077
+ 0.1,
2078
+ -0.15,
2079
+ -0.55
2080
+ ],
2081
+ rotation: [
2082
+ 0,
2083
+ 1.524,
2084
+ 0
2085
+ ],
2086
+ reach: true
2087
+ },
2088
+ {
2089
+ t: 1.9,
2090
+ position: [
2091
+ 0.22,
2092
+ -0.2,
2093
+ -0.4
2094
+ ],
2095
+ rotation: [
2096
+ 0,
2097
+ 0,
2098
+ 0
2099
+ ]
2100
+ }
2101
+ ]
2102
+ }
2103
+ ];
2104
+
2105
+ // src/hand-use.ts
2106
+ var HAND_USES = hand_uses_default;
2107
+ var handUseOf = (id, defs = HAND_USES) => defs.find((def) => def.id === id);
2108
+ var HAND_USE_REACH = 0.62;
2109
+ var aimHandUse = (def, target) => {
2110
+ const anchor = def.keys.find((key) => key.reach);
2111
+ if (!anchor) return def;
2112
+ const length = Math.hypot(target[0], target[1], target[2]);
2113
+ const k = length > HAND_USE_REACH ? HAND_USE_REACH / length : 1;
2114
+ const shift = [target[0] * k - anchor.position[0], target[1] * k - anchor.position[1], target[2] * k - anchor.position[2]];
2115
+ const moved = (key) => ({ ...key, position: [key.position[0] + shift[0], key.position[1] + shift[1], key.position[2] + shift[2]] });
2116
+ return { ...def, keys: def.keys.map((key) => key.reach ? moved(key) : key) };
2117
+ };
2118
+ var lerp = (a, b, k) => [
2119
+ a[0] + (b[0] - a[0]) * k,
2120
+ a[1] + (b[1] - a[1]) * k,
2121
+ a[2] + (b[2] - a[2]) * k
2122
+ ];
2123
+ var createHandUse = (def) => {
2124
+ const keys = [...def.keys].sort((a, b) => a.t - b.t);
2125
+ const actions = keys.filter((key) => key.action !== void 0);
2126
+ let time = 0;
2127
+ let reached = 0;
2128
+ let done = keys.length === 0 || def.duration <= 0;
2129
+ const pose3 = () => {
2130
+ const first = keys[0];
2131
+ if (!first) return { position: [0, 0, 0], rotation: [0, 0, 0] };
2132
+ let index = 0;
2133
+ while (index + 1 < keys.length && keys[index + 1].t <= time) index++;
2134
+ const a = keys[index];
2135
+ const b = keys[Math.min(index + 1, keys.length - 1)];
2136
+ const k = b.t > a.t ? Math.min(1, Math.max(0, (time - a.t) / (b.t - a.t))) : 1;
2137
+ return { position: lerp(a.position, b.position, k), rotation: lerp(a.rotation, b.rotation, k) };
2138
+ };
2139
+ return {
2140
+ def,
2141
+ get time() {
2142
+ return time;
2143
+ },
2144
+ get done() {
2145
+ return done;
2146
+ },
2147
+ pose: pose3,
2148
+ update(dt) {
2149
+ if (done) return [];
2150
+ time = Math.min(def.duration, time + Math.max(0, dt));
2151
+ const events = [];
2152
+ while (reached < actions.length && actions[reached].t <= time) {
2153
+ reached++;
2154
+ events.push({ action: actions[reached - 1].action, share: reached / actions.length });
2155
+ }
2156
+ done = time >= def.duration;
2157
+ return events;
2158
+ },
2159
+ cancel() {
2160
+ done = true;
2161
+ }
2162
+ };
2163
+ };
1087
2164
  return __toCommonJS(index_exports);
1088
2165
  })();
1089
2166
  //# sourceMappingURL=index.global.js.map