@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.
package/dist/index.js CHANGED
@@ -871,14 +871,1089 @@ var itemsFromArsenal = (arsenal, options = {}) => {
871
871
  }
872
872
  return { id: "arsenal", items, categories: ARSENAL_CATEGORIES };
873
873
  };
874
+
875
+ // src/data/hand-uses.json
876
+ var hand_uses_default = [
877
+ {
878
+ id: "eat_food",
879
+ body: "mouth",
880
+ duration: 3.4,
881
+ note: "three bites: the food to the mouth, a bite, down a little to chew, and again",
882
+ keys: [
883
+ {
884
+ t: 0,
885
+ position: [
886
+ 0.22,
887
+ -0.2,
888
+ -0.4
889
+ ],
890
+ rotation: [
891
+ 0,
892
+ 0,
893
+ 0
894
+ ]
895
+ },
896
+ {
897
+ t: 0.45,
898
+ position: [
899
+ 0.01,
900
+ 0,
901
+ -0.17
902
+ ],
903
+ rotation: [
904
+ -0.3,
905
+ 0,
906
+ 0
907
+ ],
908
+ action: "bite"
909
+ },
910
+ {
911
+ t: 0.8,
912
+ position: [
913
+ 0.05,
914
+ -0.08,
915
+ -0.26
916
+ ],
917
+ rotation: [
918
+ -0.15,
919
+ 0,
920
+ 0
921
+ ]
922
+ },
923
+ {
924
+ t: 1.25,
925
+ position: [
926
+ 0.01,
927
+ 0,
928
+ -0.17
929
+ ],
930
+ rotation: [
931
+ -0.3,
932
+ 0,
933
+ 0
934
+ ],
935
+ action: "bite"
936
+ },
937
+ {
938
+ t: 1.6,
939
+ position: [
940
+ 0.05,
941
+ -0.08,
942
+ -0.26
943
+ ],
944
+ rotation: [
945
+ -0.15,
946
+ 0,
947
+ 0
948
+ ]
949
+ },
950
+ {
951
+ t: 2.05,
952
+ position: [
953
+ 0.01,
954
+ 0,
955
+ -0.17
956
+ ],
957
+ rotation: [
958
+ -0.3,
959
+ 0,
960
+ 0
961
+ ],
962
+ action: "bite"
963
+ },
964
+ {
965
+ t: 2.8,
966
+ position: [
967
+ 0.05,
968
+ -0.08,
969
+ -0.26
970
+ ],
971
+ rotation: [
972
+ -0.15,
973
+ 0,
974
+ 0
975
+ ]
976
+ },
977
+ {
978
+ t: 3.4,
979
+ position: [
980
+ 0.22,
981
+ -0.2,
982
+ -0.4
983
+ ],
984
+ rotation: [
985
+ 0,
986
+ 0,
987
+ 0
988
+ ]
989
+ }
990
+ ]
991
+ },
992
+ {
993
+ id: "drink",
994
+ body: "mouth",
995
+ duration: 2.5,
996
+ note: "a drink without a liquid of its own (a juice box): to the mouth and tipped up, as the fluid drink",
997
+ keys: [
998
+ {
999
+ t: 0,
1000
+ position: [
1001
+ 0.22,
1002
+ -0.2,
1003
+ -0.4
1004
+ ],
1005
+ rotation: [
1006
+ 0,
1007
+ 0,
1008
+ 0
1009
+ ]
1010
+ },
1011
+ {
1012
+ t: 0.5,
1013
+ position: [
1014
+ 0,
1015
+ 0.02,
1016
+ -0.2
1017
+ ],
1018
+ rotation: [
1019
+ 0,
1020
+ 0,
1021
+ 0
1022
+ ]
1023
+ },
1024
+ {
1025
+ t: 0.8,
1026
+ position: [
1027
+ 0,
1028
+ 0.02,
1029
+ -0.2
1030
+ ],
1031
+ rotation: [
1032
+ -1.22,
1033
+ 0,
1034
+ 0
1035
+ ],
1036
+ action: "swallow"
1037
+ },
1038
+ {
1039
+ t: 2,
1040
+ position: [
1041
+ 0,
1042
+ 0.02,
1043
+ -0.2
1044
+ ],
1045
+ rotation: [
1046
+ -1.22,
1047
+ 0,
1048
+ 0
1049
+ ]
1050
+ },
1051
+ {
1052
+ t: 2.5,
1053
+ position: [
1054
+ 0.22,
1055
+ -0.2,
1056
+ -0.4
1057
+ ],
1058
+ rotation: [
1059
+ 0,
1060
+ 0,
1061
+ 0
1062
+ ]
1063
+ }
1064
+ ]
1065
+ },
1066
+ {
1067
+ id: "take_medicine",
1068
+ body: "mouth",
1069
+ duration: 2.6,
1070
+ note: "the box before the chest, shaken for a pill, the pill to the mouth and swallowed",
1071
+ keys: [
1072
+ {
1073
+ t: 0,
1074
+ position: [
1075
+ 0.22,
1076
+ -0.2,
1077
+ -0.4
1078
+ ],
1079
+ rotation: [
1080
+ 0,
1081
+ 0,
1082
+ 0
1083
+ ]
1084
+ },
1085
+ {
1086
+ t: 0.4,
1087
+ position: [
1088
+ 0.06,
1089
+ -0.16,
1090
+ -0.3
1091
+ ],
1092
+ rotation: [
1093
+ 0,
1094
+ 0,
1095
+ 0
1096
+ ]
1097
+ },
1098
+ {
1099
+ t: 0.65,
1100
+ position: [
1101
+ 0.06,
1102
+ -0.16,
1103
+ -0.3
1104
+ ],
1105
+ rotation: [
1106
+ 0,
1107
+ 0,
1108
+ 0.5
1109
+ ]
1110
+ },
1111
+ {
1112
+ t: 0.85,
1113
+ position: [
1114
+ 0.06,
1115
+ -0.16,
1116
+ -0.3
1117
+ ],
1118
+ rotation: [
1119
+ 0,
1120
+ 0,
1121
+ -0.5
1122
+ ]
1123
+ },
1124
+ {
1125
+ t: 1.05,
1126
+ position: [
1127
+ 0.06,
1128
+ -0.16,
1129
+ -0.3
1130
+ ],
1131
+ rotation: [
1132
+ 0,
1133
+ 0,
1134
+ 0
1135
+ ]
1136
+ },
1137
+ {
1138
+ t: 1.6,
1139
+ position: [
1140
+ 0,
1141
+ 0.02,
1142
+ -0.18
1143
+ ],
1144
+ rotation: [
1145
+ -0.6,
1146
+ 0,
1147
+ 0
1148
+ ],
1149
+ action: "swallow"
1150
+ },
1151
+ {
1152
+ t: 2,
1153
+ position: [
1154
+ 0,
1155
+ 0.02,
1156
+ -0.18
1157
+ ],
1158
+ rotation: [
1159
+ -0.6,
1160
+ 0,
1161
+ 0
1162
+ ]
1163
+ },
1164
+ {
1165
+ t: 2.6,
1166
+ position: [
1167
+ 0.22,
1168
+ -0.2,
1169
+ -0.4
1170
+ ],
1171
+ rotation: [
1172
+ 0,
1173
+ 0,
1174
+ 0
1175
+ ]
1176
+ }
1177
+ ]
1178
+ },
1179
+ {
1180
+ id: "apply_dressing",
1181
+ body: "two_hands",
1182
+ duration: 3.2,
1183
+ note: "the dressing laid on the other forearm and wound round it twice",
1184
+ keys: [
1185
+ {
1186
+ t: 0,
1187
+ position: [
1188
+ 0.22,
1189
+ -0.2,
1190
+ -0.4
1191
+ ],
1192
+ rotation: [
1193
+ 0,
1194
+ 0,
1195
+ 0
1196
+ ]
1197
+ },
1198
+ {
1199
+ t: 0.5,
1200
+ position: [
1201
+ -0.06,
1202
+ -0.12,
1203
+ -0.3
1204
+ ],
1205
+ rotation: [
1206
+ 0,
1207
+ 0,
1208
+ 1.2
1209
+ ]
1210
+ },
1211
+ {
1212
+ t: 1,
1213
+ position: [
1214
+ -0.1,
1215
+ -0.15,
1216
+ -0.28
1217
+ ],
1218
+ rotation: [
1219
+ 0.4,
1220
+ 0,
1221
+ 1.4
1222
+ ],
1223
+ action: "apply"
1224
+ },
1225
+ {
1226
+ t: 1.5,
1227
+ position: [
1228
+ -0.02,
1229
+ -0.1,
1230
+ -0.32
1231
+ ],
1232
+ rotation: [
1233
+ 0,
1234
+ 0,
1235
+ 1.2
1236
+ ]
1237
+ },
1238
+ {
1239
+ t: 2,
1240
+ position: [
1241
+ -0.1,
1242
+ -0.15,
1243
+ -0.28
1244
+ ],
1245
+ rotation: [
1246
+ 0.4,
1247
+ 0,
1248
+ 1.4
1249
+ ],
1250
+ action: "apply"
1251
+ },
1252
+ {
1253
+ t: 2.6,
1254
+ position: [
1255
+ -0.06,
1256
+ -0.12,
1257
+ -0.3
1258
+ ],
1259
+ rotation: [
1260
+ 0,
1261
+ 0,
1262
+ 1.2
1263
+ ]
1264
+ },
1265
+ {
1266
+ t: 3.2,
1267
+ position: [
1268
+ 0.22,
1269
+ -0.2,
1270
+ -0.4
1271
+ ],
1272
+ rotation: [
1273
+ 0,
1274
+ 0,
1275
+ 0
1276
+ ]
1277
+ }
1278
+ ]
1279
+ },
1280
+ {
1281
+ id: "use_hygiene",
1282
+ body: "two_hands",
1283
+ duration: 3,
1284
+ note: "soap (or what is rubbed in) between both hands in front of the body, rubbed side to side",
1285
+ keys: [
1286
+ {
1287
+ t: 0,
1288
+ position: [
1289
+ 0.22,
1290
+ -0.2,
1291
+ -0.4
1292
+ ],
1293
+ rotation: [
1294
+ 0,
1295
+ 0,
1296
+ 0
1297
+ ]
1298
+ },
1299
+ {
1300
+ t: 0.4,
1301
+ position: [
1302
+ 0.02,
1303
+ -0.18,
1304
+ -0.32
1305
+ ],
1306
+ rotation: [
1307
+ 0,
1308
+ 0,
1309
+ 1.5
1310
+ ]
1311
+ },
1312
+ {
1313
+ t: 0.7,
1314
+ position: [
1315
+ -0.04,
1316
+ -0.18,
1317
+ -0.32
1318
+ ],
1319
+ rotation: [
1320
+ 0,
1321
+ 0,
1322
+ 1.5
1323
+ ],
1324
+ action: "scrub"
1325
+ },
1326
+ {
1327
+ t: 1,
1328
+ position: [
1329
+ 0.06,
1330
+ -0.18,
1331
+ -0.32
1332
+ ],
1333
+ rotation: [
1334
+ 0,
1335
+ 0,
1336
+ 1.5
1337
+ ]
1338
+ },
1339
+ {
1340
+ t: 1.3,
1341
+ position: [
1342
+ -0.04,
1343
+ -0.18,
1344
+ -0.32
1345
+ ],
1346
+ rotation: [
1347
+ 0,
1348
+ 0,
1349
+ 1.5
1350
+ ],
1351
+ action: "scrub"
1352
+ },
1353
+ {
1354
+ t: 1.6,
1355
+ position: [
1356
+ 0.06,
1357
+ -0.18,
1358
+ -0.32
1359
+ ],
1360
+ rotation: [
1361
+ 0,
1362
+ 0,
1363
+ 1.5
1364
+ ]
1365
+ },
1366
+ {
1367
+ t: 1.9,
1368
+ position: [
1369
+ -0.04,
1370
+ -0.18,
1371
+ -0.32
1372
+ ],
1373
+ rotation: [
1374
+ 0,
1375
+ 0,
1376
+ 1.5
1377
+ ],
1378
+ action: "scrub"
1379
+ },
1380
+ {
1381
+ t: 2.3,
1382
+ position: [
1383
+ 0.02,
1384
+ -0.18,
1385
+ -0.32
1386
+ ],
1387
+ rotation: [
1388
+ 0,
1389
+ 0,
1390
+ 1.5
1391
+ ]
1392
+ },
1393
+ {
1394
+ t: 3,
1395
+ position: [
1396
+ 0.22,
1397
+ -0.2,
1398
+ -0.4
1399
+ ],
1400
+ rotation: [
1401
+ 0,
1402
+ 0,
1403
+ 0
1404
+ ]
1405
+ }
1406
+ ]
1407
+ },
1408
+ {
1409
+ id: "toggle_flashlight",
1410
+ body: "hand",
1411
+ duration: 1.1,
1412
+ note: "the flashlight raised before the chest and pointed ahead, the thumb pressing the tail switch (a small push), and back",
1413
+ keys: [
1414
+ {
1415
+ t: 0,
1416
+ position: [
1417
+ 0.22,
1418
+ -0.2,
1419
+ -0.4
1420
+ ],
1421
+ rotation: [
1422
+ 0,
1423
+ 0,
1424
+ 0
1425
+ ]
1426
+ },
1427
+ {
1428
+ t: 0.35,
1429
+ position: [
1430
+ 0.12,
1431
+ -0.12,
1432
+ -0.42
1433
+ ],
1434
+ rotation: [
1435
+ -1.45,
1436
+ 0,
1437
+ 0
1438
+ ]
1439
+ },
1440
+ {
1441
+ t: 0.47,
1442
+ position: [
1443
+ 0.12,
1444
+ -0.13,
1445
+ -0.42
1446
+ ],
1447
+ rotation: [
1448
+ -1.5,
1449
+ 0,
1450
+ 0
1451
+ ]
1452
+ },
1453
+ {
1454
+ t: 0.52,
1455
+ position: [
1456
+ 0.12,
1457
+ -0.125,
1458
+ -0.42
1459
+ ],
1460
+ rotation: [
1461
+ -1.47,
1462
+ 0,
1463
+ 0
1464
+ ],
1465
+ action: "switch"
1466
+ },
1467
+ {
1468
+ t: 0.7,
1469
+ position: [
1470
+ 0.12,
1471
+ -0.12,
1472
+ -0.42
1473
+ ],
1474
+ rotation: [
1475
+ -1.45,
1476
+ 0,
1477
+ 0
1478
+ ]
1479
+ },
1480
+ {
1481
+ t: 1.1,
1482
+ position: [
1483
+ 0.22,
1484
+ -0.2,
1485
+ -0.4
1486
+ ],
1487
+ rotation: [
1488
+ 0,
1489
+ 0,
1490
+ 0
1491
+ ]
1492
+ }
1493
+ ]
1494
+ },
1495
+ {
1496
+ id: "light_lighter",
1497
+ body: "hand",
1498
+ duration: 1.5,
1499
+ 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",
1500
+ keys: [
1501
+ {
1502
+ t: 0,
1503
+ position: [
1504
+ 0.22,
1505
+ -0.2,
1506
+ -0.4
1507
+ ],
1508
+ rotation: [
1509
+ 0,
1510
+ 0,
1511
+ 0
1512
+ ]
1513
+ },
1514
+ {
1515
+ t: 0.4,
1516
+ position: [
1517
+ 0.07,
1518
+ -0.12,
1519
+ -0.34
1520
+ ],
1521
+ rotation: [
1522
+ 0,
1523
+ 0,
1524
+ 0
1525
+ ]
1526
+ },
1527
+ {
1528
+ t: 0.52,
1529
+ position: [
1530
+ 0.07,
1531
+ -0.137,
1532
+ -0.34
1533
+ ],
1534
+ rotation: [
1535
+ 0.14,
1536
+ 0,
1537
+ -0.12
1538
+ ]
1539
+ },
1540
+ {
1541
+ t: 0.58,
1542
+ position: [
1543
+ 0.07,
1544
+ -0.125,
1545
+ -0.34
1546
+ ],
1547
+ rotation: [
1548
+ 0,
1549
+ 0,
1550
+ 0
1551
+ ],
1552
+ action: "ignite"
1553
+ },
1554
+ {
1555
+ t: 1.15,
1556
+ position: [
1557
+ 0.07,
1558
+ -0.115,
1559
+ -0.34
1560
+ ],
1561
+ rotation: [
1562
+ 0,
1563
+ 0,
1564
+ 0
1565
+ ]
1566
+ },
1567
+ {
1568
+ t: 1.5,
1569
+ position: [
1570
+ 0.22,
1571
+ -0.2,
1572
+ -0.4
1573
+ ],
1574
+ rotation: [
1575
+ 0,
1576
+ 0,
1577
+ 0
1578
+ ]
1579
+ }
1580
+ ]
1581
+ },
1582
+ {
1583
+ id: "use_radio",
1584
+ body: "mouth",
1585
+ duration: 3,
1586
+ 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",
1587
+ keys: [
1588
+ {
1589
+ t: 0,
1590
+ position: [
1591
+ 0.22,
1592
+ -0.2,
1593
+ -0.4
1594
+ ],
1595
+ rotation: [
1596
+ 0,
1597
+ 0,
1598
+ 0
1599
+ ]
1600
+ },
1601
+ {
1602
+ t: 0.5,
1603
+ position: [
1604
+ 0.08,
1605
+ -0.05,
1606
+ -0.22
1607
+ ],
1608
+ rotation: [
1609
+ 0,
1610
+ 0,
1611
+ 0.15
1612
+ ]
1613
+ },
1614
+ {
1615
+ t: 0.85,
1616
+ position: [
1617
+ 0.08,
1618
+ -0.05,
1619
+ -0.22
1620
+ ],
1621
+ rotation: [
1622
+ 0,
1623
+ 0,
1624
+ 0.15
1625
+ ]
1626
+ },
1627
+ {
1628
+ t: 1.05,
1629
+ position: [
1630
+ 0.08,
1631
+ -0.05,
1632
+ -0.22
1633
+ ],
1634
+ rotation: [
1635
+ 0,
1636
+ 0.3,
1637
+ 0.15
1638
+ ],
1639
+ action: "tune"
1640
+ },
1641
+ {
1642
+ t: 1.25,
1643
+ position: [
1644
+ 0.08,
1645
+ -0.05,
1646
+ -0.22
1647
+ ],
1648
+ rotation: [
1649
+ 0,
1650
+ 0,
1651
+ 0.15
1652
+ ]
1653
+ },
1654
+ {
1655
+ t: 1.45,
1656
+ position: [
1657
+ 0.05,
1658
+ -0.02,
1659
+ -0.19
1660
+ ],
1661
+ rotation: [
1662
+ -0.1,
1663
+ 0,
1664
+ 0.15
1665
+ ],
1666
+ action: "talk"
1667
+ },
1668
+ {
1669
+ t: 2.4,
1670
+ position: [
1671
+ 0.05,
1672
+ -0.02,
1673
+ -0.19
1674
+ ],
1675
+ rotation: [
1676
+ -0.1,
1677
+ 0,
1678
+ 0.15
1679
+ ]
1680
+ },
1681
+ {
1682
+ t: 3,
1683
+ position: [
1684
+ 0.22,
1685
+ -0.2,
1686
+ -0.4
1687
+ ],
1688
+ rotation: [
1689
+ 0,
1690
+ 0,
1691
+ 0
1692
+ ]
1693
+ }
1694
+ ]
1695
+ },
1696
+ {
1697
+ id: "turn_key",
1698
+ body: "reach",
1699
+ duration: 1.9,
1700
+ 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",
1701
+ keys: [
1702
+ {
1703
+ t: 0,
1704
+ position: [
1705
+ 0.22,
1706
+ -0.2,
1707
+ -0.4
1708
+ ],
1709
+ rotation: [
1710
+ 0,
1711
+ 0,
1712
+ 0
1713
+ ]
1714
+ },
1715
+ {
1716
+ t: 0.5,
1717
+ position: [
1718
+ 0.1,
1719
+ -0.15,
1720
+ -0.55
1721
+ ],
1722
+ rotation: [
1723
+ 0,
1724
+ 1.524,
1725
+ 0
1726
+ ],
1727
+ reach: true
1728
+ },
1729
+ {
1730
+ t: 0.75,
1731
+ position: [
1732
+ 0.1,
1733
+ -0.15,
1734
+ -0.57
1735
+ ],
1736
+ rotation: [
1737
+ 0,
1738
+ 1.524,
1739
+ 0
1740
+ ],
1741
+ reach: true
1742
+ },
1743
+ {
1744
+ t: 0.84,
1745
+ position: [
1746
+ 0.1,
1747
+ -0.15,
1748
+ -0.57
1749
+ ],
1750
+ rotation: [
1751
+ -1.46,
1752
+ 1.168,
1753
+ 1.45
1754
+ ],
1755
+ reach: true
1756
+ },
1757
+ {
1758
+ t: 0.93,
1759
+ position: [
1760
+ 0.1,
1761
+ -0.15,
1762
+ -0.57
1763
+ ],
1764
+ rotation: [
1765
+ -1.525,
1766
+ 0.77,
1767
+ 1.505
1768
+ ],
1769
+ reach: true
1770
+ },
1771
+ {
1772
+ t: 1.01,
1773
+ position: [
1774
+ 0.1,
1775
+ -0.15,
1776
+ -0.57
1777
+ ],
1778
+ rotation: [
1779
+ -1.552,
1780
+ 0.37,
1781
+ 1.52
1782
+ ],
1783
+ reach: true
1784
+ },
1785
+ {
1786
+ t: 1.1,
1787
+ position: [
1788
+ 0.1,
1789
+ -0.15,
1790
+ -0.57
1791
+ ],
1792
+ rotation: [
1793
+ -1.572,
1794
+ -0.029,
1795
+ 1.524
1796
+ ],
1797
+ action: "turn",
1798
+ reach: true
1799
+ },
1800
+ {
1801
+ t: 1.19,
1802
+ position: [
1803
+ 0.1,
1804
+ -0.15,
1805
+ -0.57
1806
+ ],
1807
+ rotation: [
1808
+ -1.552,
1809
+ 0.37,
1810
+ 1.52
1811
+ ],
1812
+ reach: true
1813
+ },
1814
+ {
1815
+ t: 1.27,
1816
+ position: [
1817
+ 0.1,
1818
+ -0.15,
1819
+ -0.57
1820
+ ],
1821
+ rotation: [
1822
+ -1.525,
1823
+ 0.77,
1824
+ 1.505
1825
+ ],
1826
+ reach: true
1827
+ },
1828
+ {
1829
+ t: 1.34,
1830
+ position: [
1831
+ 0.1,
1832
+ -0.15,
1833
+ -0.57
1834
+ ],
1835
+ rotation: [
1836
+ -1.46,
1837
+ 1.168,
1838
+ 1.45
1839
+ ],
1840
+ reach: true
1841
+ },
1842
+ {
1843
+ t: 1.4,
1844
+ position: [
1845
+ 0.1,
1846
+ -0.15,
1847
+ -0.57
1848
+ ],
1849
+ rotation: [
1850
+ 0,
1851
+ 1.524,
1852
+ 0
1853
+ ],
1854
+ reach: true
1855
+ },
1856
+ {
1857
+ t: 1.55,
1858
+ position: [
1859
+ 0.1,
1860
+ -0.15,
1861
+ -0.55
1862
+ ],
1863
+ rotation: [
1864
+ 0,
1865
+ 1.524,
1866
+ 0
1867
+ ],
1868
+ reach: true
1869
+ },
1870
+ {
1871
+ t: 1.9,
1872
+ position: [
1873
+ 0.22,
1874
+ -0.2,
1875
+ -0.4
1876
+ ],
1877
+ rotation: [
1878
+ 0,
1879
+ 0,
1880
+ 0
1881
+ ]
1882
+ }
1883
+ ]
1884
+ }
1885
+ ];
1886
+
1887
+ // src/hand-use.ts
1888
+ var HAND_USES = hand_uses_default;
1889
+ var handUseOf = (id, defs = HAND_USES) => defs.find((def) => def.id === id);
1890
+ var HAND_USE_REACH = 0.62;
1891
+ var aimHandUse = (def, target) => {
1892
+ const anchor = def.keys.find((key) => key.reach);
1893
+ if (!anchor) return def;
1894
+ const length = Math.hypot(target[0], target[1], target[2]);
1895
+ const k = length > HAND_USE_REACH ? HAND_USE_REACH / length : 1;
1896
+ const shift = [target[0] * k - anchor.position[0], target[1] * k - anchor.position[1], target[2] * k - anchor.position[2]];
1897
+ const moved = (key) => ({ ...key, position: [key.position[0] + shift[0], key.position[1] + shift[1], key.position[2] + shift[2]] });
1898
+ return { ...def, keys: def.keys.map((key) => key.reach ? moved(key) : key) };
1899
+ };
1900
+ var lerp = (a, b, k) => [
1901
+ a[0] + (b[0] - a[0]) * k,
1902
+ a[1] + (b[1] - a[1]) * k,
1903
+ a[2] + (b[2] - a[2]) * k
1904
+ ];
1905
+ var createHandUse = (def) => {
1906
+ const keys = [...def.keys].sort((a, b) => a.t - b.t);
1907
+ const actions = keys.filter((key) => key.action !== void 0);
1908
+ let time = 0;
1909
+ let reached = 0;
1910
+ let done = keys.length === 0 || def.duration <= 0;
1911
+ const pose = () => {
1912
+ const first = keys[0];
1913
+ if (!first) return { position: [0, 0, 0], rotation: [0, 0, 0] };
1914
+ let index = 0;
1915
+ while (index + 1 < keys.length && keys[index + 1].t <= time) index++;
1916
+ const a = keys[index];
1917
+ const b = keys[Math.min(index + 1, keys.length - 1)];
1918
+ const k = b.t > a.t ? Math.min(1, Math.max(0, (time - a.t) / (b.t - a.t))) : 1;
1919
+ return { position: lerp(a.position, b.position, k), rotation: lerp(a.rotation, b.rotation, k) };
1920
+ };
1921
+ return {
1922
+ def,
1923
+ get time() {
1924
+ return time;
1925
+ },
1926
+ get done() {
1927
+ return done;
1928
+ },
1929
+ pose,
1930
+ update(dt) {
1931
+ if (done) return [];
1932
+ time = Math.min(def.duration, time + Math.max(0, dt));
1933
+ const events = [];
1934
+ while (reached < actions.length && actions[reached].t <= time) {
1935
+ reached++;
1936
+ events.push({ action: actions[reached - 1].action, share: reached / actions.length });
1937
+ }
1938
+ done = time >= def.duration;
1939
+ return events;
1940
+ },
1941
+ cancel() {
1942
+ done = true;
1943
+ }
1944
+ };
1945
+ };
874
1946
  export {
875
1947
  ARSENAL_CATEGORIES,
876
1948
  BODY_SLOTS,
877
1949
  DEFAULT_RULES,
878
1950
  DURABILITY_KINDS,
1951
+ HAND_USES,
1952
+ HAND_USE_REACH,
879
1953
  ITEM_CATEGORIES,
880
1954
  RARITIES,
881
1955
  advanceAge,
1956
+ aimHandUse,
882
1957
  bagOption,
883
1958
  blockChance,
884
1959
  canCraft,
@@ -888,12 +1963,14 @@ export {
888
1963
  checkItems,
889
1964
  craft,
890
1965
  createFindsProvider,
1966
+ createHandUse,
891
1967
  createInventory,
892
1968
  createItems,
893
1969
  depletionFactor,
894
1970
  failsToStart,
895
1971
  fitsInside,
896
1972
  freshness,
1973
+ handUseOf,
897
1974
  itemLitres,
898
1975
  itemsFromArsenal,
899
1976
  loadState,