@adatechnology/game-items-three 0.11.7 → 0.12.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/{chunk-64JEKMFT.js → chunk-DBIE2ZMX.js} +14 -4
- package/dist/chunk-DBIE2ZMX.js.map +1 -0
- package/dist/index.d.ts +17 -2
- package/dist/index.global.js +2587 -979
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/{testing-D2tqWTG4.d.ts → testing-Y05TqYH8.d.ts} +2 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +15 -15
- package/dist/chunk-64JEKMFT.js.map +0 -1
|
@@ -478,6 +478,7 @@ function tagForDestruction(root, options = {}) {
|
|
|
478
478
|
return;
|
|
479
479
|
}
|
|
480
480
|
const rule = modelId !== void 0 ? itemDestruction(modelId) : shapeId !== void 0 ? shapeDestruction(shapeId) : void 0;
|
|
481
|
+
const body = options.parts?.length === 1 ? options.parts[0] : void 0;
|
|
481
482
|
if (rule?.tessellate) tessellateShapes(root, rule.tessellate, three);
|
|
482
483
|
const solid = [];
|
|
483
484
|
root.traverse((object) => {
|
|
@@ -491,6 +492,10 @@ function tagForDestruction(root, options = {}) {
|
|
|
491
492
|
mesh.userData.destructionSkin = true;
|
|
492
493
|
return;
|
|
493
494
|
}
|
|
495
|
+
if (body) {
|
|
496
|
+
mesh.userData.destructionMaterial = body.material;
|
|
497
|
+
if (body.thickness !== void 0) mesh.userData.destructionThickness = body.thickness;
|
|
498
|
+
}
|
|
494
499
|
if (rule?.hollow) mesh.userData.hollow = true;
|
|
495
500
|
if (powder) mesh.userData.destructionPowder = { color: powder.color };
|
|
496
501
|
solid.push(mesh);
|
|
@@ -506,6 +511,7 @@ function tagForDestruction(root, options = {}) {
|
|
|
506
511
|
}
|
|
507
512
|
|
|
508
513
|
// src/kit.ts
|
|
514
|
+
import { CARRY_HANDLE_TAG } from "@adatechnology/game-contracts";
|
|
509
515
|
import { shapeGeometries } from "@adatechnology/game-shapes-three";
|
|
510
516
|
var WEAR_TAGS = ["metal", "wood", "cloth", "plastic", "paper", "food", "glass"];
|
|
511
517
|
var channelsOf = (hex2) => [(hex2 >> 16 & 255) / 255, (hex2 >> 8 & 255) / 255, (hex2 & 255) / 255];
|
|
@@ -528,6 +534,10 @@ function createItemKit(three) {
|
|
|
528
534
|
return object;
|
|
529
535
|
};
|
|
530
536
|
return {
|
|
537
|
+
carryHandle: (part) => {
|
|
538
|
+
part.userData[CARRY_HANDLE_TAG] = true;
|
|
539
|
+
return part;
|
|
540
|
+
},
|
|
531
541
|
T,
|
|
532
542
|
materials,
|
|
533
543
|
M,
|
|
@@ -4280,7 +4290,7 @@ var boltCutters = ({ mesh, bx, cyl, G, metal, plastic }) => {
|
|
|
4280
4290
|
};
|
|
4281
4291
|
|
|
4282
4292
|
// src/models/bucket.ts
|
|
4283
|
-
var bucket = ({ mesh, bx, cyl, G, plastic, metal }) => {
|
|
4293
|
+
var bucket = ({ mesh, bx, cyl, G, plastic, metal, carryHandle }) => {
|
|
4284
4294
|
const body = plastic(2908062);
|
|
4285
4295
|
const wire = metal(9080209);
|
|
4286
4296
|
return G(
|
|
@@ -4289,7 +4299,7 @@ var bucket = ({ mesh, bx, cyl, G, plastic, metal }) => {
|
|
|
4289
4299
|
mesh(cyl(11.8, 11.8, 1, 16), plastic(2313602), [0, -13, 0]),
|
|
4290
4300
|
mesh(bx(0.6, 3.7, 0.6), wire, [13, 11.35, 0]),
|
|
4291
4301
|
mesh(bx(0.6, 3.7, 0.6), wire, [-13, 11.35, 0]),
|
|
4292
|
-
mesh(bx(27.2, 0.5, 1.1), wire, [0, 13.25, 0])
|
|
4302
|
+
carryHandle(mesh(bx(27.2, 0.5, 1.1), wire, [0, 13.25, 0]))
|
|
4293
4303
|
);
|
|
4294
4304
|
};
|
|
4295
4305
|
|
|
@@ -7260,7 +7270,7 @@ function buildItem(T, item, options = {}) {
|
|
|
7260
7270
|
const materials = kit.materials.slice(first);
|
|
7261
7271
|
if (options.wear) setWear(materials, options.wear);
|
|
7262
7272
|
root.userData.wear = options.wear ?? 0;
|
|
7263
|
-
if (options.destructible) tagForDestruction(root, { ...kind === "model" && item.model !== void 0 ? { modelId: item.model } : {}, ...shape === void 0 ? {} : { shapeId: shape }, ...item.weight === void 0 ? {} : { weight: item.weight }, size: item.size, ...item.powder ? { powder: item.powder } : {}, three: T });
|
|
7273
|
+
if (options.destructible) tagForDestruction(root, { ...kind === "model" && item.model !== void 0 ? { modelId: item.model } : {}, ...shape === void 0 ? {} : { shapeId: shape }, ...item.weight === void 0 ? {} : { weight: item.weight }, size: item.size, ...item.powder ? { powder: item.powder } : {}, ...item.parts ? { parts: item.parts } : {}, three: T });
|
|
7264
7274
|
markKitOrigin(root, { owner: "game-items-three", kind: "item", id: item.id, ...kind === "shape" ? { standIn: true } : {} });
|
|
7265
7275
|
return { root, kind, ...shape ? { shape } : {}, size: item.size, materials };
|
|
7266
7276
|
}
|
|
@@ -8192,4 +8202,4 @@ export {
|
|
|
8192
8202
|
HUMAN_HEIGHT,
|
|
8193
8203
|
createItemsTestModule
|
|
8194
8204
|
};
|
|
8195
|
-
//# sourceMappingURL=chunk-
|
|
8205
|
+
//# sourceMappingURL=chunk-DBIE2ZMX.js.map
|