@adatechnology/game-items-three 0.12.0 → 0.14.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-DBIE2ZMX.js → chunk-XJG7IGO3.js} +1541 -1218
- package/dist/chunk-XJG7IGO3.js.map +1 -0
- package/dist/index.d.ts +51 -7
- package/dist/index.global.js +1101 -495
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +22 -2
- package/dist/index.js.map +1 -1
- package/dist/{testing-Y05TqYH8.d.ts → testing-C96KjBjB.d.ts} +7 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +13 -13
- package/dist/chunk-DBIE2ZMX.js.map +0 -1
|
@@ -3,7 +3,7 @@ import { discardObject3D } from "@adatechnology/game-shapes-three";
|
|
|
3
3
|
import { markKitOrigin as markKitOrigin2 } from "@adatechnology/game-contracts";
|
|
4
4
|
import { furnitureSpec } from "@adatechnology/game-floorplan-three";
|
|
5
5
|
import { rng } from "@adatechnology/game-interactables";
|
|
6
|
-
import { canCraft, craft, createFindsProvider, freshness, ITEM_CATEGORIES } from "@adatechnology/game-items";
|
|
6
|
+
import { canCraft, craft, createFindsProvider, freshness as freshness2, ITEM_CATEGORIES } from "@adatechnology/game-items";
|
|
7
7
|
|
|
8
8
|
// src/area-layout.ts
|
|
9
9
|
var SHELF_HEIGHT = 0.9;
|
|
@@ -156,7 +156,9 @@ var destruction_default = {
|
|
|
156
156
|
"coconut_water",
|
|
157
157
|
"cooking_oil",
|
|
158
158
|
"alcohol_70",
|
|
159
|
-
"fuel_jerrycan"
|
|
159
|
+
"fuel_jerrycan",
|
|
160
|
+
"shampoo",
|
|
161
|
+
"toothpaste"
|
|
160
162
|
],
|
|
161
163
|
rule: {
|
|
162
164
|
hollow: true,
|
|
@@ -291,6 +293,14 @@ var destruction_default = {
|
|
|
291
293
|
condensed_milk: {
|
|
292
294
|
liquid: "honey",
|
|
293
295
|
fill: 0.9
|
|
296
|
+
},
|
|
297
|
+
shampoo: {
|
|
298
|
+
liquid: "shampoo",
|
|
299
|
+
fill: 0.9
|
|
300
|
+
},
|
|
301
|
+
toothpaste: {
|
|
302
|
+
liquid: "toothpaste",
|
|
303
|
+
fill: 0.85
|
|
294
304
|
}
|
|
295
305
|
},
|
|
296
306
|
shapes: {
|
|
@@ -342,238 +352,507 @@ function tagMakeupParts(root, modelId) {
|
|
|
342
352
|
});
|
|
343
353
|
}
|
|
344
354
|
|
|
345
|
-
// src/
|
|
346
|
-
var
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
const
|
|
377
|
-
|
|
378
|
-
const container = {
|
|
379
|
-
capacity: innerLiters,
|
|
380
|
-
liquid: contents.liquid,
|
|
381
|
-
liters,
|
|
382
|
-
shape: contents.box ? { kind: "box", size: [width * WALL_SHARE, height * WALL_SHARE, depth * WALL_SHARE] } : { kind: "cylinder", radius: radius * WALL_SHARE, height: height * WALL_SHARE },
|
|
383
|
-
opening: OPENING_RADIUS,
|
|
384
|
-
closed: true
|
|
385
|
-
};
|
|
386
|
-
return { container, liquid: contents.liquid, liters };
|
|
387
|
-
}
|
|
388
|
-
function tagOf(mesh) {
|
|
389
|
-
const material = Array.isArray(mesh.material) ? mesh.material[0] : mesh.material;
|
|
390
|
-
const tag = material?.userData?.tag;
|
|
391
|
-
return typeof tag === "string" ? tag : void 0;
|
|
392
|
-
}
|
|
393
|
-
function volumeOf(mesh) {
|
|
394
|
-
if (!mesh.geometry.boundingBox) mesh.geometry.computeBoundingBox();
|
|
395
|
-
const box2 = mesh.geometry.boundingBox;
|
|
396
|
-
if (!box2) return 0;
|
|
397
|
-
return (box2.max.x - box2.min.x) * (box2.max.y - box2.min.y) * (box2.max.z - box2.min.z);
|
|
398
|
-
}
|
|
399
|
-
function ringedCylinder(T, p, radial, maxRows, rings) {
|
|
400
|
-
const half = p.height / 2;
|
|
401
|
-
const column = 2 * Math.PI * Math.max(p.radiusTop, p.radiusBottom, 1e-6) / radial;
|
|
402
|
-
const rows = Math.max(1, Math.min(maxRows, Math.round(p.height / column)));
|
|
403
|
-
const points = [];
|
|
404
|
-
if (!p.openEnded) for (let i = 0; i <= rings; i++) points.push(new T.Vector2(p.radiusBottom * i / rings, -half));
|
|
405
|
-
for (let j = 0; j <= rows; j++) points.push(new T.Vector2(p.radiusBottom + (p.radiusTop - p.radiusBottom) * j / rows, -half + p.height * j / rows));
|
|
406
|
-
if (!p.openEnded) for (let i = rings; i >= 0; i--) points.push(new T.Vector2(p.radiusTop * i / rings, half));
|
|
407
|
-
return lathed(T, points, radial, p.thetaStart, p.thetaLength);
|
|
408
|
-
}
|
|
409
|
-
function lathed(T, points, radial, phiStart, phiLength) {
|
|
410
|
-
const geometry = new T.LatheGeometry([...points], radial, phiStart, phiLength);
|
|
411
|
-
geometry.computeVertexNormals();
|
|
412
|
-
const position = geometry.getAttribute("position");
|
|
413
|
-
const normal = geometry.getAttribute("normal");
|
|
414
|
-
const middle = (Math.min(...points.map((point) => point.y)) + Math.max(...points.map((point) => point.y))) / 2;
|
|
415
|
-
for (let i = 0; i < normal.count; i++) {
|
|
416
|
-
if (Math.hypot(normal.getX(i), normal.getY(i), normal.getZ(i)) > 0.5) continue;
|
|
417
|
-
normal.setXYZ(i, 0, position.getY(i) >= middle ? 1 : -1, 0);
|
|
418
|
-
}
|
|
419
|
-
return geometry;
|
|
420
|
-
}
|
|
421
|
-
function finerProfile(T, points, step) {
|
|
422
|
-
const out = [];
|
|
423
|
-
points.forEach((point, index) => {
|
|
424
|
-
const next = points[index + 1];
|
|
425
|
-
out.push(point.clone());
|
|
426
|
-
if (!next) return;
|
|
427
|
-
const pieces = Math.max(1, Math.round(point.distanceTo(next) / step));
|
|
428
|
-
for (let k = 1; k < pieces; k++) out.push(point.clone().lerp(next, k / pieces));
|
|
429
|
-
});
|
|
430
|
-
return out;
|
|
355
|
+
// src/shapes.ts
|
|
356
|
+
var SHAPES = [
|
|
357
|
+
"can",
|
|
358
|
+
"bag",
|
|
359
|
+
"box",
|
|
360
|
+
"bottle",
|
|
361
|
+
"tool",
|
|
362
|
+
"roll",
|
|
363
|
+
"dish",
|
|
364
|
+
"cloth",
|
|
365
|
+
"shoe",
|
|
366
|
+
"jar",
|
|
367
|
+
"paper",
|
|
368
|
+
"fruit",
|
|
369
|
+
"cup",
|
|
370
|
+
"tube",
|
|
371
|
+
"blade",
|
|
372
|
+
"long_tool",
|
|
373
|
+
"garment",
|
|
374
|
+
"backpack",
|
|
375
|
+
"jerrycan",
|
|
376
|
+
"tank",
|
|
377
|
+
"book",
|
|
378
|
+
"key",
|
|
379
|
+
"battery",
|
|
380
|
+
"plank",
|
|
381
|
+
"device"
|
|
382
|
+
];
|
|
383
|
+
var DEFAULT_COLOR = 9080724;
|
|
384
|
+
var PI = Math.PI;
|
|
385
|
+
function shade(color, factor) {
|
|
386
|
+
const channel = (shift) => Math.max(0, Math.min(255, Math.round((color >> shift & 255) * factor)));
|
|
387
|
+
return channel(16) << 16 | channel(8) << 8 | channel(0);
|
|
431
388
|
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
}
|
|
440
|
-
if (geometry.type === "LatheGeometry" && rule.cylinder && T && rule.cylinder.capRings !== void 0) {
|
|
441
|
-
const { points, segments, phiStart, phiLength } = geometry.parameters;
|
|
442
|
-
if (segments >= rule.cylinder.radialSegments) return void 0;
|
|
443
|
-
const widest = Math.max(...points.map((point) => point.x), 1e-6);
|
|
444
|
-
return lathed(T, finerProfile(T, points, 2 * Math.PI * widest / rule.cylinder.radialSegments), rule.cylinder.radialSegments, phiStart, phiLength);
|
|
445
|
-
}
|
|
446
|
-
if (geometry.type === "BoxGeometry" && rule.box) {
|
|
447
|
-
const { width, height, depth } = geometry.parameters;
|
|
448
|
-
return new Shape(width, height, depth, rule.box.widthSegments, rule.box.heightSegments, rule.box.depthSegments);
|
|
449
|
-
}
|
|
450
|
-
return void 0;
|
|
389
|
+
var PROUD = 2e-3;
|
|
390
|
+
var seg = (c, n) => Math.max(5, Math.round(n * c.detail));
|
|
391
|
+
function canonicalFrame(size) {
|
|
392
|
+
const [w, h, d] = size;
|
|
393
|
+
if (h >= w && h >= d) return { axis: 1, L: h, a: w, b: d };
|
|
394
|
+
if (d >= w && d >= h) return { axis: 2, L: d, a: h, b: w };
|
|
395
|
+
return { axis: 0, L: w, a: h, b: d };
|
|
451
396
|
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
const
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
let fresh = rebuilt.get(mesh.geometry);
|
|
459
|
-
if (!fresh) {
|
|
460
|
-
fresh = tessellated(mesh.geometry, rule, T);
|
|
461
|
-
if (!fresh) return;
|
|
462
|
-
rebuilt.set(mesh.geometry, fresh);
|
|
463
|
-
}
|
|
464
|
-
mesh.geometry = fresh;
|
|
465
|
-
});
|
|
466
|
-
let added = 0;
|
|
467
|
-
rebuilt.forEach((fresh, old) => {
|
|
468
|
-
added += triangleCount(fresh) - triangleCount(old);
|
|
469
|
-
old.dispose();
|
|
470
|
-
});
|
|
471
|
-
root.userData.tessellationTriangles = added;
|
|
397
|
+
function orient(c, group, axis) {
|
|
398
|
+
if (axis === 0) return group;
|
|
399
|
+
const holder = c.k.G(group);
|
|
400
|
+
if (axis === 1) holder.rotation.z = PI / 2;
|
|
401
|
+
else holder.rotation.y = -PI / 2;
|
|
402
|
+
return holder;
|
|
472
403
|
}
|
|
473
|
-
|
|
474
|
-
const {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
404
|
+
var alongLong = (draw) => (c) => {
|
|
405
|
+
const { axis, L, a, b } = canonicalFrame([c.w, c.h, c.d]);
|
|
406
|
+
return orient(c, draw(c, L, a, b), axis);
|
|
407
|
+
};
|
|
408
|
+
var across = (c, group) => {
|
|
409
|
+
group.scale.set(c.w, 1, c.d);
|
|
410
|
+
return c.k.G(group);
|
|
411
|
+
};
|
|
412
|
+
var can = (c) => {
|
|
413
|
+
const { k, h } = c;
|
|
414
|
+
const body = k.metal(9277590);
|
|
415
|
+
const r = 0.5 - PROUD / Math.min(c.w, c.d);
|
|
416
|
+
return across(c, k.G(k.mesh(k.cyl(r, r, h * 0.94, seg(c, 14)), body), k.mesh(k.cyl(0.5, 0.5, h * 0.5, seg(c, 14)), k.food(c.color)), k.mesh(k.cyl(0.5, 0.5, h * 0.03, seg(c, 14)), body, [0, h * 0.485, 0]), k.mesh(k.cyl(0.5, 0.5, h * 0.03, seg(c, 14)), body, [0, -h * 0.485, 0])));
|
|
417
|
+
};
|
|
418
|
+
var bottle = (c) => {
|
|
419
|
+
const { k, h } = c;
|
|
420
|
+
const r = 0.5;
|
|
421
|
+
const profile = [[0, -h / 2], [r, -h / 2], [r, h * 0.12], [r * 0.45, h * 0.3], [r * 0.4, h * 0.4], [0, h * 0.4]];
|
|
422
|
+
return across(c, k.G(k.mesh(k.lathe(profile, seg(c, 14)), k.glass(c.color, 0.6)), k.mesh(k.cyl(r * 0.42, r * 0.42, h * 0.1, seg(c, 10)), k.plastic(shade(c.color, 0.5)), [0, h * 0.45, 0])));
|
|
423
|
+
};
|
|
424
|
+
var jar = (c) => {
|
|
425
|
+
const { k, h } = c;
|
|
426
|
+
return across(c, k.G(k.mesh(k.cyl(0.5, 0.5, h * 0.82, seg(c, 14)), k.glass(c.color, 0.55), [0, -h * 0.09, 0]), k.mesh(k.cyl(0.5, 0.5, h * 0.18, seg(c, 14)), k.metal(12095802), [0, h * 0.41, 0])));
|
|
427
|
+
};
|
|
428
|
+
var bag = (c) => {
|
|
429
|
+
const { k, w, h, d } = c;
|
|
430
|
+
return k.G(k.mesh(k.bx(w, h * 0.88, d - 2 * PROUD), k.paper(c.color), [0, -h * 0.06, 0]), k.mesh(k.bx(w * 1, h * 0.12, d * 0.5), k.paper(shade(c.color, 0.85)), [0, h * 0.44, 0]), k.mesh(k.bx(w * 0.7, h * 0.3, d), k.paper(shade(c.color, 1.2)), [0, 0, 0]));
|
|
431
|
+
};
|
|
432
|
+
var box = (c) => {
|
|
433
|
+
const { k, w, h, d } = c;
|
|
434
|
+
return k.G(k.mesh(k.bx(w - 2 * PROUD, h - PROUD, d - 2 * PROUD), k.paper(c.color), [0, -PROUD / 2, 0]), k.mesh(k.bx(w, h * 0.12, d), k.paper(shade(c.color, 0.8)), [0, h * 0.44, 0]), k.mesh(k.bx(w * 0.62, h * 0.4, d), k.paper(shade(c.color, 1.25)), [0, -h * 0.02, 0]));
|
|
435
|
+
};
|
|
436
|
+
var cloth = (c) => {
|
|
437
|
+
const { k, w, h, d } = c;
|
|
438
|
+
const material = k.cloth(c.color);
|
|
439
|
+
return k.G(k.mesh(k.bx(w, h * 0.55, d), material, [0, -h * 0.225, 0]), k.mesh(k.bx(w * 0.96, h * 0.45, d * 0.96), k.cloth(shade(c.color, 0.9)), [0, h * 0.275, 0]));
|
|
440
|
+
};
|
|
441
|
+
var paper = (c) => {
|
|
442
|
+
const { k, w, h, d } = c;
|
|
443
|
+
const sheet = k.paper(c.color);
|
|
444
|
+
return k.G(k.mesh(k.bx(w, h / 3, d), sheet, [0, -h / 3, 0]), k.mesh(k.bx(w * 0.98, h / 3, d * 0.98), k.paper(shade(c.color, 0.95)), [0, 0, 0]), k.mesh(k.bx(w, h / 3, d), sheet, [0, h / 3, 0]));
|
|
445
|
+
};
|
|
446
|
+
var fruit = (c) => {
|
|
447
|
+
const { k, w, h, d } = c;
|
|
448
|
+
const sphere = new k.T.SphereGeometry(0.5, seg(c, 12), seg(c, 8));
|
|
449
|
+
return k.G(k.mesh(sphere, k.food(c.color), [0, -h * 0.04, 0], [0, 0, 0], [w, h * 0.92, d]), k.mesh(k.cyl(h * 0.02, h * 0.02, h * 0.1, 6), k.wood(5913122), [0, h * 0.45, 0]));
|
|
450
|
+
};
|
|
451
|
+
var dish = (c) => {
|
|
452
|
+
const { k, w, h, d } = c;
|
|
453
|
+
return k.G(k.mesh(k.cyl(0.5, 0.35, h, seg(c, 16)), k.plastic(c.color), [0, 0, 0], [0, 0, 0], [w, 1, d]));
|
|
454
|
+
};
|
|
455
|
+
var CUP_FLOOR_SHARE = 0.06;
|
|
456
|
+
var cup = (c) => {
|
|
457
|
+
const { k, w, h, d } = c;
|
|
458
|
+
const floor = -h / 2 + h * CUP_FLOOR_SHARE;
|
|
459
|
+
const profile = [[0, -h / 2], [0.38, -h / 2], [0.5, h / 2], [0.44, h / 2], [0.33, floor], [0, floor]];
|
|
460
|
+
return k.G(k.mesh(k.lathe(profile, seg(c, 14)), k.plastic(c.color), [0, 0, 0], [0, 0, 0], [w, 1, d]));
|
|
461
|
+
};
|
|
462
|
+
var tube = (c) => {
|
|
463
|
+
const { k, h } = c;
|
|
464
|
+
const material = k.plastic(c.color);
|
|
465
|
+
return across(c, k.G(k.mesh(k.cyl(0.5, 0.42, h * 0.86, seg(c, 12)), material, [0, -h * 0.04, 0]), k.mesh(k.cyl(0.35, 0.35, h * 0.12, seg(c, 12)), k.plastic(shade(c.color, 0.6)), [0, h * 0.44, 0]), k.mesh(k.bx(1, h * 0.06, 0.25), material, [0, -h * 0.47, 0])));
|
|
466
|
+
};
|
|
467
|
+
var roll = (c) => {
|
|
468
|
+
const { k, w, h, d } = c;
|
|
469
|
+
const body = k.G(k.mesh(k.cyl(0.5, 0.5, 1, seg(c, 18)), k.paper(c.color)), k.mesh(k.cyl(0.18, 0.18, 0.98, seg(c, 12)), k.paper(11902328)));
|
|
470
|
+
if (h <= w && h <= d) body.scale.set(w, h, d);
|
|
471
|
+
else if (w <= d) {
|
|
472
|
+
body.rotation.z = PI / 2;
|
|
473
|
+
body.scale.set(h, w, d);
|
|
474
|
+
} else {
|
|
475
|
+
body.rotation.x = PI / 2;
|
|
476
|
+
body.scale.set(w, d, h);
|
|
479
477
|
}
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
const
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
const
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
const
|
|
510
|
-
|
|
478
|
+
return k.G(body);
|
|
479
|
+
};
|
|
480
|
+
var shoe = (c) => {
|
|
481
|
+
const { k, w, h, d } = c;
|
|
482
|
+
const upper = k.cloth(c.color);
|
|
483
|
+
return k.G(k.mesh(k.bx(w, h * 0.22, d), k.plastic(2237727), [0, -h * 0.39, 0]), k.mesh(k.bx(w * 0.42, h * 0.78, d * 0.96), upper, [-w * 0.29, h * 0.11, 0]), k.mesh(k.bx(w * 0.5, h * 0.5, d * 0.96), upper, [w * 0.25, -h * 0.03, 0]));
|
|
484
|
+
};
|
|
485
|
+
var tool = alongLong((c, L, a, b) => {
|
|
486
|
+
const { k } = c;
|
|
487
|
+
const radius = Math.max(4e-3, Math.min(a, b) / 2);
|
|
488
|
+
return k.G(k.mesh(k.cyl(radius, radius, L * 0.74, seg(c, 10)), k.wood(9069628), [-L * 0.13, 0, 0], [0, 0, PI / 2]), k.mesh(k.bx(L * 0.26, a, b), k.metal(shade(c.color, 1)), [L * 0.37, 0, 0]));
|
|
489
|
+
});
|
|
490
|
+
var longTool = alongLong((c, L, a, b) => {
|
|
491
|
+
const { k } = c;
|
|
492
|
+
const radius = Math.max(4e-3, Math.min(a, b) / 2) * 0.55;
|
|
493
|
+
return k.G(k.mesh(k.cyl(radius, radius, L * 0.94, seg(c, 10)), k.wood(10122312), [0, 0, 0], [0, 0, PI / 2]), k.mesh(k.bx(L * 0.12, a, b), k.metal(c.color), [L * 0.44, 0, 0]));
|
|
494
|
+
});
|
|
495
|
+
var blade = alongLong((c, L, a, b) => {
|
|
496
|
+
const { k } = c;
|
|
497
|
+
const edge = Math.min(2e-4, b * 0.05);
|
|
498
|
+
const steel = k.extrude([[0, 0], [L * 0.66, 0], [L * 0.68, a * 0.4], [0, a]], Math.max(5e-4, b * 0.4 - 2 * edge), edge);
|
|
499
|
+
return k.G(k.mesh(steel, k.metal(11120048), [-L * 0.18, -a / 2, -b * 0.2 + edge]), k.mesh(k.bx(L * 0.34, a * 0.6, b), k.wood(3877408), [-L * 0.33, 0, 0]));
|
|
500
|
+
});
|
|
501
|
+
var garment = (c) => {
|
|
502
|
+
const { k, w, h, d } = c;
|
|
503
|
+
const material = k.cloth(c.color);
|
|
504
|
+
return k.G(k.mesh(k.bx(w * 0.56, h, d), material), k.mesh(k.bx(w * 0.22, h * 0.42, d * 0.9), material, [-w * 0.39, h * 0.29, 0]), k.mesh(k.bx(w * 0.22, h * 0.42, d * 0.9), material, [w * 0.39, h * 0.29, 0]));
|
|
505
|
+
};
|
|
506
|
+
var backpack = (c) => {
|
|
507
|
+
const { k, w, h, d } = c;
|
|
508
|
+
const material = k.cloth(c.color);
|
|
509
|
+
const dome = new k.T.SphereGeometry(0.5, seg(c, 12), seg(c, 6), 0, PI * 2, 0, PI / 2);
|
|
510
|
+
const strap = k.cloth(shade(c.color, 0.6));
|
|
511
|
+
return k.G(k.mesh(k.bx(w, h * 0.78, d * 0.68), material, [0, -h * 0.11, -d * 0.14]), k.mesh(dome, material, [0, h * 0.28, -d * 0.14], [0, 0, 0], [w, h * 0.44, d * 0.68]), k.mesh(k.bx(w * 0.7, h * 0.4, d * 0.3), k.cloth(shade(c.color, 0.75)), [0, -h * 0.18, d * 0.35]), k.mesh(k.bx(w * 0.1, h * 0.7, d * 0.04), strap, [-w * 0.25, -h * 0.05, -d * 0.48]), k.mesh(k.bx(w * 0.1, h * 0.7, d * 0.04), strap, [w * 0.25, -h * 0.05, -d * 0.48]));
|
|
512
|
+
};
|
|
513
|
+
var jerrycan = (c) => {
|
|
514
|
+
const { k, w, h, d } = c;
|
|
515
|
+
const material = k.plastic(c.color);
|
|
516
|
+
return k.G(k.mesh(k.bx(w, h * 0.86, d), material, [0, -h * 0.07, 0]), k.mesh(k.bx(w * 0.4, h * 0.1, d * 0.5), material, [-w * 0.2, h * 0.45, 0]), k.mesh(k.cyl(d * 0.14, d * 0.18, h * 0.12, seg(c, 10)), k.plastic(14263361), [w * 0.3, h * 0.44, 0]));
|
|
517
|
+
};
|
|
518
|
+
var tank = (c) => {
|
|
519
|
+
const { k, h } = c;
|
|
520
|
+
const r = 0.5;
|
|
521
|
+
const profile = [[0, -h / 2], [r * 0.9, -h / 2], [r, -h * 0.4], [r, h * 0.22], [r * 0.6, h * 0.36], [r * 0.2, h * 0.4], [0, h * 0.4]];
|
|
522
|
+
const metal = k.metal(c.color);
|
|
523
|
+
return across(c, k.G(k.mesh(k.lathe(profile, seg(c, 14)), metal), k.mesh(k.cyl(r * 0.62, r * 0.62, h * 0.05, seg(c, 14)), metal, [0, h * 0.3, 0]), k.mesh(k.cyl(r * 0.18, r * 0.18, h * 0.12, seg(c, 8)), k.metal(12095802), [0, h * 0.44, 0])));
|
|
524
|
+
};
|
|
525
|
+
var book = (c) => {
|
|
526
|
+
const { k, w, h, d } = c;
|
|
527
|
+
const cover = k.paper(c.color);
|
|
528
|
+
return k.G(k.mesh(k.bx(w - PROUD, h - 2 * PROUD, d * 0.14), cover, [PROUD / 2, 0, d * 0.43 - PROUD]), k.mesh(k.bx(w - PROUD, h - 2 * PROUD, d * 0.14), cover, [PROUD / 2, 0, -d * 0.43 + PROUD]), k.mesh(k.bx(w * 0.94, h * 0.96, d * 0.72), k.paper(15327692), [w * 0.02, 0, 0]), k.mesh(k.bx(w * 0.08, h, d), k.paper(shade(c.color, 0.8)), [-w * 0.46, 0, 0]));
|
|
529
|
+
};
|
|
530
|
+
var key = alongLong((c, L, a, b) => {
|
|
531
|
+
const { k } = c;
|
|
532
|
+
const metal = k.metal(12095802);
|
|
533
|
+
const ring = a * 0.5;
|
|
534
|
+
const tube2 = Math.min(b * 0.4, ring * 0.2);
|
|
535
|
+
return k.G(k.mesh(new c.k.T.TorusGeometry(ring * 0.8, tube2, 5, seg(c, 10)), k.metal(10132896), [-L / 2 + ring * 0.8 + tube2, 0, 0]), k.mesh(k.bx(L * 0.62, a * 0.28, b), metal, [L * 0.12, 0, 0]), k.mesh(k.bx(L * 0.08, a * 0.17, b), metal, [L * 0.36, -a * 0.225, 0]), k.mesh(k.bx(L * 0.06, a * 0.17, b), metal, [L * 0.2, -a * 0.225, 0]));
|
|
536
|
+
});
|
|
537
|
+
var battery = alongLong((c, L, a, b) => {
|
|
538
|
+
const { k } = c;
|
|
539
|
+
const r = Math.min(a, b) / 2;
|
|
540
|
+
return k.G(k.mesh(k.cyl(r, r, L * 0.94, seg(c, 14)), k.metal(c.color), [0, 0, 0], [0, 0, PI / 2]), k.mesh(k.cyl(r * 0.36, r * 0.36, L * 0.06, seg(c, 8)), k.metal(12172736), [L * 0.47, 0, 0], [0, 0, PI / 2]));
|
|
541
|
+
});
|
|
542
|
+
var plank = alongLong((c, L, a, b) => {
|
|
543
|
+
const { k } = c;
|
|
544
|
+
const nail = k.metal(8225158);
|
|
545
|
+
return k.G(k.mesh(k.bx(L, a, b), k.wood(11043929)), k.mesh(k.cyl(Math.min(a, b) * 0.1, Math.min(a, b) * 0.1, b * 0.98, 6), nail, [-L * 0.4, 0, 0], [PI / 2, 0, 0]), k.mesh(k.cyl(Math.min(a, b) * 0.1, Math.min(a, b) * 0.1, b * 0.98, 6), nail, [L * 0.4, 0, 0], [PI / 2, 0, 0]));
|
|
546
|
+
});
|
|
547
|
+
var device = (c) => {
|
|
548
|
+
const { k, w, h, d } = c;
|
|
549
|
+
const screen = k.M(10469258, "glass", { emissive: 3099170, emissiveIntensity: 0.6, roughness: 0.2 });
|
|
550
|
+
return k.G(k.mesh(k.bx(w, h, d * 0.96), k.plastic(c.color), [0, 0, -d * 0.02]), k.mesh(k.bx(w * 0.7, h * 0.32, d * 0.06), screen, [0, h * 0.22, d * 0.47]), k.mesh(k.cyl(Math.min(w, h) * 0.08, Math.min(w, h) * 0.08, d * 0.1, seg(c, 8)), k.metal(12172736), [w * 0.25, -h * 0.18, d * 0.45], [PI / 2, 0, 0]));
|
|
551
|
+
};
|
|
552
|
+
var DRAWERS = {
|
|
553
|
+
can,
|
|
554
|
+
bag,
|
|
555
|
+
box,
|
|
556
|
+
bottle,
|
|
557
|
+
tool,
|
|
558
|
+
roll,
|
|
559
|
+
dish,
|
|
560
|
+
cloth,
|
|
561
|
+
shoe,
|
|
562
|
+
jar,
|
|
563
|
+
paper,
|
|
564
|
+
fruit,
|
|
565
|
+
cup,
|
|
566
|
+
tube,
|
|
567
|
+
blade,
|
|
568
|
+
long_tool: longTool,
|
|
569
|
+
garment,
|
|
570
|
+
backpack,
|
|
571
|
+
jerrycan,
|
|
572
|
+
tank,
|
|
573
|
+
book,
|
|
574
|
+
key,
|
|
575
|
+
battery,
|
|
576
|
+
plank,
|
|
577
|
+
device
|
|
578
|
+
};
|
|
579
|
+
var isShape = (value) => value !== void 0 && value in DRAWERS;
|
|
580
|
+
function shapeOf(subject) {
|
|
581
|
+
const hint = subject.shape;
|
|
582
|
+
if (!isShape(hint)) return "box";
|
|
583
|
+
const [w, h, d] = subject.size;
|
|
584
|
+
const { L, a, b } = canonicalFrame(subject.size);
|
|
585
|
+
const long = L / Math.max(a, b, 1e-6) >= 4;
|
|
586
|
+
const flat = Math.min(w, h, d) / Math.max(w, h, d) <= 0.2;
|
|
587
|
+
switch (hint) {
|
|
588
|
+
case "tool":
|
|
589
|
+
if (subject.category === "keys") return "key";
|
|
590
|
+
if (subject.category === "electronics") return "device";
|
|
591
|
+
if (long) return subject.category === "melee" && Math.min(a, b) / L <= 0.1 && flat ? "blade" : "long_tool";
|
|
592
|
+
return hint;
|
|
593
|
+
case "cloth":
|
|
594
|
+
return subject.category === "clothing" ? "garment" : hint;
|
|
595
|
+
case "bag":
|
|
596
|
+
return subject.category === "bags" ? "backpack" : hint;
|
|
597
|
+
case "box":
|
|
598
|
+
if (subject.category === "electronics") return "device";
|
|
599
|
+
if (subject.category === "books") return "book";
|
|
600
|
+
if (subject.category === "keys") return "key";
|
|
601
|
+
return hint;
|
|
602
|
+
case "paper":
|
|
603
|
+
return subject.category === "books" ? "book" : hint;
|
|
604
|
+
default:
|
|
605
|
+
return hint;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
function drawShape(k, shape, size, options = {}) {
|
|
609
|
+
const [w, h, d] = size;
|
|
610
|
+
return DRAWERS[shape]({ k, w, h, d, color: options.color ?? DEFAULT_COLOR, detail: options.detail ?? 1 });
|
|
511
611
|
}
|
|
512
612
|
|
|
513
|
-
// src/
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
G: (...children) => {
|
|
555
|
-
const group = new T.Group();
|
|
556
|
-
children.forEach((child) => group.add(child));
|
|
557
|
-
return group;
|
|
558
|
-
},
|
|
559
|
-
metal: (color) => M(color, "metal", { metalness: 0.55, roughness: 0.45 }),
|
|
560
|
-
wood: (color) => M(color, "wood"),
|
|
561
|
-
cloth: (color) => M(color, "cloth", { roughness: 0.95 }),
|
|
562
|
-
plastic: (color) => M(color, "plastic", { roughness: 0.6 }),
|
|
563
|
-
paper: (color) => M(color, "paper", { roughness: 0.9 }),
|
|
564
|
-
food: (color) => M(color, "food", { roughness: 0.85 }),
|
|
565
|
-
glass: (color, opacity) => M(color, "glass", { roughness: 0.15, metalness: 0.1, transparent: true, opacity })
|
|
613
|
+
// src/destruction.ts
|
|
614
|
+
var DESTRUCTION_MATERIAL_BY_TAG = {
|
|
615
|
+
metal: "steel",
|
|
616
|
+
wood: "wood_soft",
|
|
617
|
+
glass: "glass",
|
|
618
|
+
paper: "paper",
|
|
619
|
+
plastic: "plastic",
|
|
620
|
+
cloth: "fabric",
|
|
621
|
+
rubber: "rubber",
|
|
622
|
+
food: "flesh_fruit"
|
|
623
|
+
};
|
|
624
|
+
var FAMILIES = destruction_default.families;
|
|
625
|
+
var CONTENTS = destruction_default.contents;
|
|
626
|
+
var SHAPES2 = destruction_default.shapes;
|
|
627
|
+
var shapeDestruction = (shapeId) => SHAPES2[shapeId];
|
|
628
|
+
var FAMILY_OF_MODEL = new Map(Object.entries(FAMILIES).flatMap(([family, entry]) => entry.models.map((model) => [model, family])));
|
|
629
|
+
var itemFamily = (modelId) => FAMILY_OF_MODEL.get(modelId);
|
|
630
|
+
var itemDestruction = (modelId) => {
|
|
631
|
+
const family = FAMILY_OF_MODEL.get(modelId);
|
|
632
|
+
return family === void 0 ? void 0 : FAMILIES[family]?.rule;
|
|
633
|
+
};
|
|
634
|
+
var ITEM_FAMILIES = FAMILIES;
|
|
635
|
+
var SHELL_PART_ID = "shell";
|
|
636
|
+
var WALL_SHARE = 0.9;
|
|
637
|
+
var OPENING_RADIUS = 0.012;
|
|
638
|
+
function itemContents(subject) {
|
|
639
|
+
const contents = subject.model === void 0 ? void 0 : CONTENTS[subject.model];
|
|
640
|
+
if (!contents) return void 0;
|
|
641
|
+
const [width, height, depth] = subject.size;
|
|
642
|
+
const radius = Math.min(width, depth) / 2;
|
|
643
|
+
const innerLiters = (contents.box ? width * depth : Math.PI * radius * radius) * height * WALL_SHARE * 1e3;
|
|
644
|
+
const density = LIQUIDS.find((liquid) => liquid.id === contents.liquid)?.density ?? 1e3;
|
|
645
|
+
const heaviest = subject.weight === void 0 ? Infinity : subject.weight * 1e3 / density;
|
|
646
|
+
const liters = Math.min(innerLiters * contents.fill, heaviest);
|
|
647
|
+
const container = {
|
|
648
|
+
capacity: innerLiters,
|
|
649
|
+
liquid: contents.liquid,
|
|
650
|
+
liters,
|
|
651
|
+
shape: contents.box ? { kind: "box", size: [width * WALL_SHARE, height * WALL_SHARE, depth * WALL_SHARE] } : { kind: "cylinder", radius: radius * WALL_SHARE, height: height * WALL_SHARE },
|
|
652
|
+
opening: OPENING_RADIUS,
|
|
653
|
+
closed: true
|
|
566
654
|
};
|
|
655
|
+
return { container, liquid: contents.liquid, liters };
|
|
567
656
|
}
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
657
|
+
var VESSEL_FLOORS = { cup: CUP_FLOOR_SHARE };
|
|
658
|
+
function itemVessel(subject) {
|
|
659
|
+
const capacity = subject.capacityLiters;
|
|
660
|
+
const floor = subject.shape === void 0 ? void 0 : VESSEL_FLOORS[subject.shape];
|
|
661
|
+
if (capacity === void 0 || !(capacity > 0) || floor === void 0) return void 0;
|
|
662
|
+
const [width, height, depth] = subject.size;
|
|
663
|
+
const radius = Math.min(width, depth) / 2 * WALL_SHARE;
|
|
664
|
+
const container = { capacity, liters: 0, shape: { kind: "cylinder", radius, height: height * WALL_SHARE }, opening: radius, closed: false };
|
|
665
|
+
return { container, offset: [0, height * floor, 0] };
|
|
666
|
+
}
|
|
667
|
+
function tagOf(mesh) {
|
|
668
|
+
const material = Array.isArray(mesh.material) ? mesh.material[0] : mesh.material;
|
|
669
|
+
const tag = material?.userData?.tag;
|
|
670
|
+
return typeof tag === "string" ? tag : void 0;
|
|
671
|
+
}
|
|
672
|
+
function volumeOf(mesh) {
|
|
673
|
+
if (!mesh.geometry.boundingBox) mesh.geometry.computeBoundingBox();
|
|
674
|
+
const box2 = mesh.geometry.boundingBox;
|
|
675
|
+
if (!box2) return 0;
|
|
676
|
+
return (box2.max.x - box2.min.x) * (box2.max.y - box2.min.y) * (box2.max.z - box2.min.z);
|
|
677
|
+
}
|
|
678
|
+
function ringedCylinder(T, p, radial, maxRows, rings) {
|
|
679
|
+
const half = p.height / 2;
|
|
680
|
+
const column = 2 * Math.PI * Math.max(p.radiusTop, p.radiusBottom, 1e-6) / radial;
|
|
681
|
+
const rows = Math.max(1, Math.min(maxRows, Math.round(p.height / column)));
|
|
682
|
+
const points = [];
|
|
683
|
+
if (!p.openEnded) for (let i = 0; i <= rings; i++) points.push(new T.Vector2(p.radiusBottom * i / rings, -half));
|
|
684
|
+
for (let j = 0; j <= rows; j++) points.push(new T.Vector2(p.radiusBottom + (p.radiusTop - p.radiusBottom) * j / rows, -half + p.height * j / rows));
|
|
685
|
+
if (!p.openEnded) for (let i = rings; i >= 0; i--) points.push(new T.Vector2(p.radiusTop * i / rings, half));
|
|
686
|
+
return lathed(T, points, radial, p.thetaStart, p.thetaLength);
|
|
687
|
+
}
|
|
688
|
+
function lathed(T, points, radial, phiStart, phiLength) {
|
|
689
|
+
const geometry = new T.LatheGeometry([...points], radial, phiStart, phiLength);
|
|
690
|
+
geometry.computeVertexNormals();
|
|
691
|
+
const position = geometry.getAttribute("position");
|
|
692
|
+
const normal = geometry.getAttribute("normal");
|
|
693
|
+
const middle = (Math.min(...points.map((point) => point.y)) + Math.max(...points.map((point) => point.y))) / 2;
|
|
694
|
+
for (let i = 0; i < normal.count; i++) {
|
|
695
|
+
if (Math.hypot(normal.getX(i), normal.getY(i), normal.getZ(i)) > 0.5) continue;
|
|
696
|
+
normal.setXYZ(i, 0, position.getY(i) >= middle ? 1 : -1, 0);
|
|
697
|
+
}
|
|
698
|
+
return geometry;
|
|
699
|
+
}
|
|
700
|
+
function finerProfile(T, points, step) {
|
|
701
|
+
const out = [];
|
|
702
|
+
points.forEach((point, index) => {
|
|
703
|
+
const next = points[index + 1];
|
|
704
|
+
out.push(point.clone());
|
|
705
|
+
if (!next) return;
|
|
706
|
+
const pieces = Math.max(1, Math.round(point.distanceTo(next) / step));
|
|
707
|
+
for (let k = 1; k < pieces; k++) out.push(point.clone().lerp(next, k / pieces));
|
|
708
|
+
});
|
|
709
|
+
return out;
|
|
710
|
+
}
|
|
711
|
+
function tessellated(geometry, rule, T) {
|
|
712
|
+
const Shape = geometry.constructor;
|
|
713
|
+
if (geometry.type === "CylinderGeometry" && rule.cylinder) {
|
|
714
|
+
const parameters = geometry.parameters;
|
|
715
|
+
const { radiusTop, radiusBottom, height, openEnded, thetaStart, thetaLength } = parameters;
|
|
716
|
+
if (T && rule.cylinder.capRings !== void 0) return ringedCylinder(T, parameters, rule.cylinder.radialSegments, rule.cylinder.heightSegments, rule.cylinder.capRings);
|
|
717
|
+
return new Shape(radiusTop, radiusBottom, height, rule.cylinder.radialSegments, rule.cylinder.heightSegments, openEnded, thetaStart, thetaLength);
|
|
718
|
+
}
|
|
719
|
+
if (geometry.type === "LatheGeometry" && rule.cylinder && T && rule.cylinder.capRings !== void 0) {
|
|
720
|
+
const { points, segments, phiStart, phiLength } = geometry.parameters;
|
|
721
|
+
if (segments >= rule.cylinder.radialSegments) return void 0;
|
|
722
|
+
const widest = Math.max(...points.map((point) => point.x), 1e-6);
|
|
723
|
+
return lathed(T, finerProfile(T, points, 2 * Math.PI * widest / rule.cylinder.radialSegments), rule.cylinder.radialSegments, phiStart, phiLength);
|
|
724
|
+
}
|
|
725
|
+
if (geometry.type === "BoxGeometry" && rule.box) {
|
|
726
|
+
const { width, height, depth } = geometry.parameters;
|
|
727
|
+
return new Shape(width, height, depth, rule.box.widthSegments, rule.box.heightSegments, rule.box.depthSegments);
|
|
728
|
+
}
|
|
729
|
+
return void 0;
|
|
730
|
+
}
|
|
731
|
+
var triangleCount = (geometry) => (geometry.index ? geometry.index.count : geometry.getAttribute("position").count) / 3;
|
|
732
|
+
function tessellateShapes(root, rule, T) {
|
|
733
|
+
const rebuilt = /* @__PURE__ */ new Map();
|
|
734
|
+
root.traverse((object) => {
|
|
735
|
+
const mesh = object;
|
|
736
|
+
if (!mesh.isMesh) return;
|
|
737
|
+
let fresh = rebuilt.get(mesh.geometry);
|
|
738
|
+
if (!fresh) {
|
|
739
|
+
fresh = tessellated(mesh.geometry, rule, T);
|
|
740
|
+
if (!fresh) return;
|
|
741
|
+
rebuilt.set(mesh.geometry, fresh);
|
|
742
|
+
}
|
|
743
|
+
mesh.geometry = fresh;
|
|
744
|
+
});
|
|
745
|
+
let added = 0;
|
|
746
|
+
rebuilt.forEach((fresh, old) => {
|
|
747
|
+
added += triangleCount(fresh) - triangleCount(old);
|
|
748
|
+
old.dispose();
|
|
749
|
+
});
|
|
750
|
+
root.userData.tessellationTriangles = added;
|
|
751
|
+
}
|
|
752
|
+
function tagForDestruction(root, options = {}) {
|
|
753
|
+
const { modelId, shapeId, weight, size, powder, three } = options;
|
|
754
|
+
if (weight !== void 0 && weight > 0) root.userData.destructionMass = weight;
|
|
755
|
+
if (modelId !== void 0 && itemMakeup(modelId)) {
|
|
756
|
+
tagMakeupParts(root, modelId);
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
759
|
+
const rule = modelId !== void 0 ? itemDestruction(modelId) : shapeId !== void 0 ? shapeDestruction(shapeId) : void 0;
|
|
760
|
+
const body = options.parts?.length === 1 ? options.parts[0] : void 0;
|
|
761
|
+
if (rule?.tessellate) tessellateShapes(root, rule.tessellate, three);
|
|
762
|
+
const solid = [];
|
|
763
|
+
root.traverse((object) => {
|
|
764
|
+
const mesh = object;
|
|
765
|
+
if (!mesh.isMesh) return;
|
|
766
|
+
const tag = tagOf(mesh);
|
|
767
|
+
if (tag === void 0) return;
|
|
768
|
+
const material = rule?.materials?.[tag] ?? DESTRUCTION_MATERIAL_BY_TAG[tag];
|
|
769
|
+
if (material !== void 0) mesh.userData.destructionMaterial = material;
|
|
770
|
+
if (rule?.skinTags?.includes(tag)) {
|
|
771
|
+
mesh.userData.destructionSkin = true;
|
|
772
|
+
return;
|
|
773
|
+
}
|
|
774
|
+
if (body) {
|
|
775
|
+
mesh.userData.destructionMaterial = body.material;
|
|
776
|
+
if (body.thickness !== void 0) mesh.userData.destructionThickness = body.thickness;
|
|
777
|
+
}
|
|
778
|
+
if (rule?.hollow) mesh.userData.hollow = true;
|
|
779
|
+
if (powder) mesh.userData.destructionPowder = { color: powder.color };
|
|
780
|
+
solid.push(mesh);
|
|
781
|
+
});
|
|
782
|
+
if (!rule?.welded || solid.length < 2) return;
|
|
783
|
+
const anchor = solid.reduce((largest, mesh) => volumeOf(mesh) > volumeOf(largest) ? mesh : largest);
|
|
784
|
+
solid.forEach((mesh, index) => {
|
|
785
|
+
mesh.userData.destructionPart = mesh === anchor ? { id: SHELL_PART_ID } : { id: `shell_${index}`, parent: SHELL_PART_ID, kind: "weld" };
|
|
786
|
+
if (rule.wall) mesh.userData.destructionThickness = mesh === anchor ? rule.wall.body : rule.wall.ends;
|
|
787
|
+
});
|
|
788
|
+
const contents = size === void 0 ? void 0 : itemContents({ ...modelId === void 0 ? {} : { model: modelId }, size, ...weight === void 0 ? {} : { weight } });
|
|
789
|
+
if (contents) anchor.userData.destructionContains = { fluid: contents.liquid, liters: contents.liters };
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
// src/kit.ts
|
|
793
|
+
import { CARRY_HANDLE_TAG } from "@adatechnology/game-contracts";
|
|
794
|
+
import { shapeGeometries } from "@adatechnology/game-shapes-three";
|
|
795
|
+
var WEAR_TAGS = ["metal", "wood", "cloth", "plastic", "paper", "food", "glass"];
|
|
796
|
+
var channelsOf = (hex2) => [(hex2 >> 16 & 255) / 255, (hex2 >> 8 & 255) / 255, (hex2 & 255) / 255];
|
|
797
|
+
function createItemKit(three) {
|
|
798
|
+
const T = shapeGeometries(three);
|
|
799
|
+
const materials = [];
|
|
800
|
+
const M = (color, tag, options = {}) => {
|
|
801
|
+
const material = new T.MeshStandardMaterial(Object.assign({ color, roughness: 0.78, metalness: 0 }, options));
|
|
802
|
+
const base = new T.Color(color);
|
|
803
|
+
const data = { base, baseRgb: channelsOf(color), tag, rough: material.roughness };
|
|
804
|
+
material.userData = data;
|
|
805
|
+
materials.push(material);
|
|
806
|
+
return material;
|
|
807
|
+
};
|
|
808
|
+
const mesh = (geometry, material, position = [0, 0, 0], rotation = [0, 0, 0], scale) => {
|
|
809
|
+
const object = new T.Mesh(geometry, material);
|
|
810
|
+
object.position.set(...position);
|
|
811
|
+
object.rotation.set(...rotation);
|
|
812
|
+
if (scale) object.scale.set(...scale);
|
|
813
|
+
return object;
|
|
814
|
+
};
|
|
815
|
+
return {
|
|
816
|
+
carryHandle: (part) => {
|
|
817
|
+
part.userData[CARRY_HANDLE_TAG] = true;
|
|
818
|
+
return part;
|
|
819
|
+
},
|
|
820
|
+
T,
|
|
821
|
+
materials,
|
|
822
|
+
M,
|
|
823
|
+
mesh,
|
|
824
|
+
cyl: (radiusTop, radiusBottom, height, segments = 14) => new T.CylinderGeometry(radiusTop, radiusBottom, height, segments),
|
|
825
|
+
bx: (width, height, depth) => new T.BoxGeometry(width, height, depth),
|
|
826
|
+
lathe: (points, segments = 16) => new T.LatheGeometry(points.map(([x, y]) => new T.Vector2(x, y)), segments),
|
|
827
|
+
torus: (radius, tube2, arc = Math.PI * 2) => new T.TorusGeometry(radius, tube2, 8, 18, arc),
|
|
828
|
+
extrude: (points, depth, bevel = 0.015) => {
|
|
829
|
+
const shape = new T.Shape();
|
|
830
|
+
points.forEach(([x, y], index) => index ? shape.lineTo(x, y) : shape.moveTo(x, y));
|
|
831
|
+
return new T.ExtrudeGeometry(shape, { depth, bevelEnabled: true, bevelThickness: bevel, bevelSize: bevel, bevelSegments: 2 });
|
|
832
|
+
},
|
|
833
|
+
G: (...children) => {
|
|
834
|
+
const group = new T.Group();
|
|
835
|
+
children.forEach((child) => group.add(child));
|
|
836
|
+
return group;
|
|
837
|
+
},
|
|
838
|
+
metal: (color) => M(color, "metal", { metalness: 0.55, roughness: 0.45 }),
|
|
839
|
+
wood: (color) => M(color, "wood"),
|
|
840
|
+
cloth: (color) => M(color, "cloth", { roughness: 0.95 }),
|
|
841
|
+
plastic: (color) => M(color, "plastic", { roughness: 0.6 }),
|
|
842
|
+
paper: (color) => M(color, "paper", { roughness: 0.9 }),
|
|
843
|
+
food: (color) => M(color, "food", { roughness: 0.85 }),
|
|
844
|
+
glass: (color, opacity) => M(color, "glass", { roughness: 0.15, metalness: 0.1, transparent: true, opacity })
|
|
845
|
+
};
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
// src/data/models.json
|
|
849
|
+
var models_default = [
|
|
850
|
+
{
|
|
851
|
+
id: "canned_beans",
|
|
852
|
+
teamId: "feijao_lata",
|
|
853
|
+
teamBox: [
|
|
854
|
+
0.67,
|
|
855
|
+
0.57,
|
|
577
856
|
0.66
|
|
578
857
|
],
|
|
579
858
|
scale: 0.119403
|
|
@@ -3057,6 +3336,56 @@ var models_default = [
|
|
|
3057
3336
|
0.553
|
|
3058
3337
|
],
|
|
3059
3338
|
scale: 0.092308
|
|
3339
|
+
},
|
|
3340
|
+
{
|
|
3341
|
+
id: "soap",
|
|
3342
|
+
teamId: "sabonete",
|
|
3343
|
+
teamBox: [
|
|
3344
|
+
0.9,
|
|
3345
|
+
0.3,
|
|
3346
|
+
0.5
|
|
3347
|
+
],
|
|
3348
|
+
scale: 0.1
|
|
3349
|
+
},
|
|
3350
|
+
{
|
|
3351
|
+
id: "shampoo",
|
|
3352
|
+
teamId: "shampoo",
|
|
3353
|
+
teamBox: [
|
|
3354
|
+
0.6,
|
|
3355
|
+
2,
|
|
3356
|
+
0.4002
|
|
3357
|
+
],
|
|
3358
|
+
scale: 0.1
|
|
3359
|
+
},
|
|
3360
|
+
{
|
|
3361
|
+
id: "toothpaste",
|
|
3362
|
+
teamId: "pasta_dente",
|
|
3363
|
+
teamBox: [
|
|
3364
|
+
0.4,
|
|
3365
|
+
1.8,
|
|
3366
|
+
0.3
|
|
3367
|
+
],
|
|
3368
|
+
scale: 0.1
|
|
3369
|
+
},
|
|
3370
|
+
{
|
|
3371
|
+
id: "toothbrush",
|
|
3372
|
+
teamId: "escova_dente",
|
|
3373
|
+
teamBox: [
|
|
3374
|
+
0.2,
|
|
3375
|
+
1.8,
|
|
3376
|
+
0.2
|
|
3377
|
+
],
|
|
3378
|
+
scale: 0.1
|
|
3379
|
+
},
|
|
3380
|
+
{
|
|
3381
|
+
id: "plunger",
|
|
3382
|
+
teamId: "desentupidor",
|
|
3383
|
+
teamBox: [
|
|
3384
|
+
1.4,
|
|
3385
|
+
5.5,
|
|
3386
|
+
1.4
|
|
3387
|
+
],
|
|
3388
|
+
scale: 0.1
|
|
3060
3389
|
}
|
|
3061
3390
|
];
|
|
3062
3391
|
|
|
@@ -4239,6 +4568,71 @@ var alcohol70 = ({ mesh, cyl, lathe, G, glass, plastic, paper: paper2 }) => {
|
|
|
4239
4568
|
return G(bottle2, label, stripe, cap, nozzle);
|
|
4240
4569
|
};
|
|
4241
4570
|
|
|
4571
|
+
// src/models/shampoo.ts
|
|
4572
|
+
var shampoo = ({ mesh, cyl, lathe, G, plastic, paper: paper2 }) => {
|
|
4573
|
+
const oval = [1, 1, 0.667];
|
|
4574
|
+
const body = mesh(lathe([[0, -1], [0.24, -1], [0.28, -0.94], [0.28, 0.42], [0.25, 0.55], [0.15, 0.62], [0.15, 0.66], [0, 0.66]], 14), plastic(4885200), [0, 0, 0], [0, 0, 0], oval);
|
|
4575
|
+
const label = mesh(cyl(0.3, 0.3, 0.8, 16), paper2(15922680), [0, -0.35, 0], [0, 0, 0], oval);
|
|
4576
|
+
const cap = mesh(cyl(0.17, 0.17, 0.28, 12), plastic(15790320), [0, 0.8, 0], [0, 0, 0], oval);
|
|
4577
|
+
const lid = mesh(cyl(0.12, 0.17, 0.06, 12), plastic(14869218), [0, 0.97, 0], [0, 0, 0], oval);
|
|
4578
|
+
return G(body, label, cap, lid);
|
|
4579
|
+
};
|
|
4580
|
+
|
|
4581
|
+
// src/models/soap.ts
|
|
4582
|
+
var roundedRect = (width, depth, corner, steps = 4) => {
|
|
4583
|
+
const points = [];
|
|
4584
|
+
const centres = [
|
|
4585
|
+
[width / 2 - corner, depth / 2 - corner, 0],
|
|
4586
|
+
[-width / 2 + corner, depth / 2 - corner, Math.PI / 2],
|
|
4587
|
+
[-width / 2 + corner, -depth / 2 + corner, Math.PI],
|
|
4588
|
+
[width / 2 - corner, -depth / 2 + corner, 3 * Math.PI / 2]
|
|
4589
|
+
];
|
|
4590
|
+
for (const [cx, cy, start] of centres) {
|
|
4591
|
+
for (let step = 0; step <= steps; step++) {
|
|
4592
|
+
const angle = start + step / steps * (Math.PI / 2);
|
|
4593
|
+
points.push([cx + Math.cos(angle) * corner, cy + Math.sin(angle) * corner]);
|
|
4594
|
+
}
|
|
4595
|
+
}
|
|
4596
|
+
return points;
|
|
4597
|
+
};
|
|
4598
|
+
var soap = ({ mesh, extrude, M, G }) => {
|
|
4599
|
+
const edge = 0.04;
|
|
4600
|
+
const bar = extrude(roundedRect(0.9 - 2 * edge, 0.5 - 2 * edge, 0.14), 0.3 - 2 * edge, edge);
|
|
4601
|
+
bar.center();
|
|
4602
|
+
return G(mesh(bar, M(15984338, "wax", { roughness: 0.55 }), [0, 0, 0], [Math.PI / 2, 0, 0]));
|
|
4603
|
+
};
|
|
4604
|
+
|
|
4605
|
+
// src/models/toothbrush.ts
|
|
4606
|
+
var toothbrush = ({ mesh, bx, G, plastic, M }) => {
|
|
4607
|
+
const handle = mesh(bx(0.16, 0.8, 0.1), plastic(3840720), [0, 0.75, -0.05]);
|
|
4608
|
+
const grip = mesh(bx(0.2, 0.35, 0.12), plastic(2912160), [0, 0.175, -0.05]);
|
|
4609
|
+
const neck = mesh(bx(0.08, 0.3, 0.08), plastic(3840720), [0, 1.3, -0.05]);
|
|
4610
|
+
const head = mesh(bx(0.14, 0.35, 0.06), plastic(3840720), [0, 1.625, -0.06]);
|
|
4611
|
+
const bristles = mesh(bx(0.12, 0.32, 0.12), M(16054008, "plastic", { roughness: 0.9 }), [0, 1.62, 0.03]);
|
|
4612
|
+
return G(handle, grip, neck, head, bristles);
|
|
4613
|
+
};
|
|
4614
|
+
|
|
4615
|
+
// src/models/toothpaste.ts
|
|
4616
|
+
var toothpaste = ({ mesh, cyl, bx, G, plastic }) => {
|
|
4617
|
+
const flat = [1, 1, 0.75];
|
|
4618
|
+
const cap = mesh(cyl(0.11, 0.12, 0.22, 12), plastic(2056104), [0, 0.11, 0]);
|
|
4619
|
+
const shoulder = mesh(cyl(0.2, 0.11, 0.08, 14), plastic(16053494), [0, 0.26, 0], [0, 0, 0], flat);
|
|
4620
|
+
const body = mesh(cyl(0.2, 0.2, 0.9, 14), plastic(16053494), [0, 0.75, 0], [0, 0, 0], flat);
|
|
4621
|
+
const taper = mesh(cyl(0.2, 0.2, 0.44, 14), plastic(16053494), [0, 1.41, 0], [0, 0, 0], [1, 1, 0.42]);
|
|
4622
|
+
const crimp = mesh(bx(0.4, 0.17, 0.04), plastic(15132394), [0, 1.715, 0]);
|
|
4623
|
+
return G(cap, shoulder, body, taper, crimp);
|
|
4624
|
+
};
|
|
4625
|
+
|
|
4626
|
+
// src/models/plunger.ts
|
|
4627
|
+
var plunger = ({ mesh, cyl, G, M, wood }) => {
|
|
4628
|
+
const rubber = M(11545120, "rubber", { roughness: 0.75 });
|
|
4629
|
+
const cup2 = mesh(cyl(0.3, 0.7, 0.75, 16), rubber, [0, 0.455, 0]);
|
|
4630
|
+
const lip = mesh(cyl(0.7, 0.7, 0.08, 16), M(9314841, "rubber", { roughness: 0.8 }), [0, 0.04, 0]);
|
|
4631
|
+
const neck = mesh(cyl(0.2, 0.3, 0.3, 12), rubber, [0, 0.98, 0]);
|
|
4632
|
+
const handle = mesh(cyl(0.15, 0.15, 4.4, 10), wood(10122312), [0, 3.3, 0]);
|
|
4633
|
+
return G(cup2, lip, neck, handle);
|
|
4634
|
+
};
|
|
4635
|
+
|
|
4242
4636
|
// src/models/can-opener.ts
|
|
4243
4637
|
var canOpener = ({ mesh, bx, cyl, G, metal, plastic }) => {
|
|
4244
4638
|
const steel = metal(11120050);
|
|
@@ -5314,7 +5708,7 @@ var armyCamouflageUniform = ({ mesh, bx, G, cloth: cloth2 }) => {
|
|
|
5314
5708
|
};
|
|
5315
5709
|
|
|
5316
5710
|
// src/models/backpack.ts
|
|
5317
|
-
var
|
|
5711
|
+
var backpack2 = ({ mesh, bx, G, cloth: cloth2, plastic }) => {
|
|
5318
5712
|
const main = cloth2(3099243);
|
|
5319
5713
|
const trim = cloth2(1976890);
|
|
5320
5714
|
return G(
|
|
@@ -6191,1020 +6585,776 @@ var nightVisionGoggles = ({ M, mesh, cyl, bx, G, metal, plastic }) => {
|
|
|
6191
6585
|
const lens = M(2046500, "glass", { emissive: 3111493, emissiveIntensity: 0.5 });
|
|
6192
6586
|
const group = G(
|
|
6193
6587
|
mesh(bx(0.12, 0.045, 0.05), shell, [0, 0.05, -5e-3]),
|
|
6194
|
-
mesh(bx(0.08, 0.014, 0.06), shell, [0, 7e-3, -5e-3]),
|
|
6195
|
-
mesh(bx(0.04, 0.016, 0.05), metal(2763822), [0, 0.092, -5e-3])
|
|
6196
|
-
);
|
|
6197
|
-
for (const x of [-0.039, 0.039]) {
|
|
6198
|
-
group.add(mesh(cyl(0.036, 0.036, 0.046, 12), shell, [x, 0.05, 0.028], [quarter, 0, 0]));
|
|
6199
|
-
group.add(mesh(cyl(0.028, 0.028, 6e-3, 10), lens, [x, 0.05, 0.052], [quarter, 0, 0]));
|
|
6200
|
-
group.add(mesh(cyl(0.03, 0.03, 0.03, 10), plastic(1382170), [x, 0.05, -0.04], [quarter, 0, 0]));
|
|
6201
|
-
}
|
|
6202
|
-
return group;
|
|
6203
|
-
};
|
|
6204
|
-
|
|
6205
|
-
// src/models/note.ts
|
|
6206
|
-
var note = ({ mesh, bx, G, paper: paper2 }) => {
|
|
6207
|
-
const group = G();
|
|
6208
|
-
group.add(mesh(bx(0.15, 8e-4, 0.1), paper2(15327951), [0, 4e-4, 0]));
|
|
6209
|
-
group.add(mesh(bx(0.14, 8e-4, 0.09), paper2(15986397), [0, 16e-4, 2e-3]));
|
|
6210
|
-
return group;
|
|
6211
|
-
};
|
|
6212
|
-
|
|
6213
|
-
// src/models/padded-coat.ts
|
|
6214
|
-
var paddedCoat = ({ mesh, bx, cyl, G, cloth: cloth2, metal }) => {
|
|
6215
|
-
const shell = cloth2(3820094);
|
|
6216
|
-
const rib = cloth2(2831919);
|
|
6217
|
-
const zip = metal(10132896);
|
|
6218
|
-
const parts = [
|
|
6219
|
-
mesh(bx(0.3, 0.12, 0.35), shell, [0, 0.06, 0]),
|
|
6220
|
-
mesh(bx(0.075, 0.1, 0.24), shell, [-0.1875, 0.05, -0.055]),
|
|
6221
|
-
mesh(bx(0.075, 0.1, 0.24), shell, [0.1875, 0.05, -0.055]),
|
|
6222
|
-
mesh(bx(0.071, 0.102, 0.03), rib, [-0.1875, 0.053, 0.075]),
|
|
6223
|
-
mesh(bx(0.071, 0.102, 0.03), rib, [0.1875, 0.053, 0.075]),
|
|
6224
|
-
mesh(cyl(0.07, 0.07, 0.038, 12), shell, [0, 0.129, -0.1]),
|
|
6225
|
-
mesh(bx(0.012, 0.122, 0.336), zip, [0, 0.063, 3e-3])
|
|
6226
|
-
];
|
|
6227
|
-
for (const z of [-0.12, -0.04, 0.04, 0.12]) parts.push(mesh(bx(0.29, 0.03, 0.014), rib, [0, 0.135, z]));
|
|
6228
|
-
return G(...parts);
|
|
6229
|
-
};
|
|
6230
|
-
|
|
6231
|
-
// src/models/padlock-key.ts
|
|
6232
|
-
var padlockKey = ({ mesh, bx, G, metal }) => {
|
|
6233
|
-
const body = metal(9080208);
|
|
6234
|
-
const shackle = metal(12633030);
|
|
6235
|
-
const slot = metal(2039842);
|
|
6236
|
-
const parts = [
|
|
6237
|
-
mesh(bx(0.05, 0.05, 0.02), body, [0, 0.025, 0]),
|
|
6238
|
-
mesh(bx(0.046, 6e-3, 0.016), body, [0, 5e-3, 0]),
|
|
6239
|
-
mesh(bx(6e-3, 0.014, 0.025), slot, [0, 0.022, 0]),
|
|
6240
|
-
mesh(bx(6e-3, 0.026, 8e-3), shackle, [-0.014, 0.063, 0]),
|
|
6241
|
-
mesh(bx(6e-3, 0.026, 8e-3), shackle, [0.014, 0.063, 0])
|
|
6242
|
-
];
|
|
6243
|
-
const segments = 6;
|
|
6244
|
-
for (let index = 0; index < segments; index++) {
|
|
6245
|
-
const angle = Math.PI * (index + 0.5) / segments;
|
|
6246
|
-
parts.push(mesh(bx(0.0105, 6e-3, 8e-3), shackle, [0.014 * Math.cos(angle), 0.063 + 0.014 * Math.sin(angle), 0], [0, 0, angle + Math.PI / 2]));
|
|
6247
|
-
}
|
|
6248
|
-
return G(...parts);
|
|
6249
|
-
};
|
|
6250
|
-
|
|
6251
|
-
// src/models/photo.ts
|
|
6252
|
-
var photo = ({ mesh, bx, G, paper: paper2 }) => {
|
|
6253
|
-
const group = G();
|
|
6254
|
-
group.add(mesh(bx(0.102, 1e-3, 0.152), paper2(15855332), [0, 5e-4, 0]));
|
|
6255
|
-
group.add(mesh(bx(0.088, 1015e-6, 0.115), paper2(8030860), [0, 15275e-7, -0.01]));
|
|
6256
|
-
return group;
|
|
6257
|
-
};
|
|
6258
|
-
|
|
6259
|
-
// src/models/portable-generator.ts
|
|
6260
|
-
var portableGenerator = ({ M, mesh, cyl, bx, G, metal, plastic }) => {
|
|
6261
|
-
const quarter = Math.PI / 2;
|
|
6262
|
-
const frame = metal(3816510);
|
|
6263
|
-
const group = G(
|
|
6264
|
-
mesh(bx(0.5, 0.02, 0.02), frame, [0, 0.01, 0.205]),
|
|
6265
|
-
mesh(bx(0.5, 0.02, 0.02), frame, [0, 0.01, -0.205]),
|
|
6266
|
-
mesh(bx(0.016, 0.016, 0.426), frame, [0.24, 0.01, 0]),
|
|
6267
|
-
mesh(bx(0.016, 0.016, 0.426), frame, [-0.24, 0.01, 0]),
|
|
6268
|
-
mesh(bx(0.5, 0.02, 0.02), frame, [0, 0.41, 0.205]),
|
|
6269
|
-
mesh(bx(0.5, 0.02, 0.02), frame, [0, 0.41, -0.205]),
|
|
6270
|
-
mesh(bx(0.016, 0.016, 0.426), frame, [0.24, 0.41, 0]),
|
|
6271
|
-
mesh(bx(0.016, 0.016, 0.426), frame, [-0.24, 0.41, 0]),
|
|
6272
|
-
mesh(bx(0.2, 0.2, 0.26), metal(7238003), [-0.12, 0.13, 0]),
|
|
6273
|
-
mesh(cyl(0.11, 0.11, 0.18, 14), metal(4151923), [0.14, 0.15, 0], [0, 0, quarter]),
|
|
6274
|
-
mesh(bx(0.34, 0.1, 0.28), plastic(10235683), [0, 0.35, 0]),
|
|
6275
|
-
mesh(cyl(0.025, 0.025, 0.02, 8), plastic(1842204), [-0.1, 0.41, 0]),
|
|
6276
|
-
mesh(bx(0.2, 0.12, 0.01), plastic(2237478), [0.13, 0.2, 0.21]),
|
|
6277
|
-
mesh(bx(0.04, 0.04, 45e-4), M(7830141, "plastic"), [0.09, 0.2, 0.2162]),
|
|
6278
|
-
mesh(bx(0.04, 0.04, 45e-4), M(7830141, "plastic"), [0.17, 0.2, 0.2162]),
|
|
6279
|
-
mesh(cyl(0.035, 0.035, 0.16, 10), metal(5982780), [-0.12, 0.1, -0.17], [0, 0, quarter])
|
|
6280
|
-
);
|
|
6281
|
-
for (const [x, z] of [[-0.24, -0.205], [0.24, -0.205], [-0.24, 0.205], [0.24, 0.205]]) group.add(mesh(bx(0.012, 0.4, 0.012), frame, [x, 0.21, z]));
|
|
6282
|
-
return group;
|
|
6283
|
-
};
|
|
6284
|
-
|
|
6285
|
-
// src/models/power-bank.ts
|
|
6286
|
-
var powerBank = ({ M, mesh, bx, G, plastic }) => {
|
|
6287
|
-
const led = M(9167776, "plastic", { emissive: 3111493, emissiveIntensity: 0.6 });
|
|
6288
|
-
return G(
|
|
6289
|
-
mesh(bx(0.15, 0.07, 0.0143), plastic(2961720), [0, 0.035, -35e-5]),
|
|
6290
|
-
mesh(bx(0.07, 0.024, 3e-3), plastic(4870232), [-0.025, 0.035, 71e-4]),
|
|
6291
|
-
mesh(bx(0.02, 8e-3, 3e-3), plastic(987154), [0.058, 0.058, 71e-4]),
|
|
6292
|
-
mesh(bx(0.012, 4e-3, 3e-3), led, [0.028, 0.02, 71e-4]),
|
|
6293
|
-
mesh(bx(0.012, 4e-3, 3e-3), led, [0.044, 0.02, 71e-4]),
|
|
6294
|
-
mesh(bx(0.012, 4e-3, 3e-3), led, [0.06, 0.02, 71e-4])
|
|
6295
|
-
);
|
|
6296
|
-
};
|
|
6297
|
-
|
|
6298
|
-
// src/models/pumpkin-seeds.ts
|
|
6299
|
-
var pumpkinSeeds = ({ mesh, bx, G, paper: paper2 }) => {
|
|
6300
|
-
const width = 0.09;
|
|
6301
|
-
const height = 0.13;
|
|
6302
|
-
const depth = 0.015;
|
|
6303
|
-
const group = G();
|
|
6304
|
-
group.add(mesh(bx(width, height, depth * 0.5), paper2(15261640)));
|
|
6305
|
-
group.add(mesh(bx(width * 0.9, height * 0.85, depth * 0.667), paper2(15722451), [0, -height * 0.03, 0]));
|
|
6306
|
-
group.add(mesh(bx(width * 0.95, height * 0.08, depth * 0.3), paper2(13616296), [0, height * 0.445, 0]));
|
|
6307
|
-
[1, -1].forEach((side) => group.add(mesh(bx(width * 0.7, height * 0.4, depth * 0.3), paper2(14254635), [0, -height * 0.05, side * depth * 0.35])));
|
|
6308
|
-
return group;
|
|
6309
|
-
};
|
|
6310
|
-
|
|
6311
|
-
// src/models/raincoat.ts
|
|
6312
|
-
var raincoat = ({ mesh, bx, cyl, G, plastic, metal }) => {
|
|
6313
|
-
const sheet = plastic(13805852);
|
|
6314
|
-
const trim = plastic(11044122);
|
|
6315
|
-
return G(
|
|
6316
|
-
mesh(bx(0.2, 0.03, 0.25), sheet, [0, 0.015, 0]),
|
|
6317
|
-
mesh(bx(0.05, 0.026, 0.17), sheet, [-0.125, 0.013, -0.04]),
|
|
6318
|
-
mesh(bx(0.05, 0.026, 0.17), sheet, [0.125, 0.013, -0.04]),
|
|
6319
|
-
mesh(bx(0.05, 0.03, 0.012), trim, [-0.125, 0.015, 0.05]),
|
|
6320
|
-
mesh(bx(0.05, 0.03, 0.012), trim, [0.125, 0.015, 0.05]),
|
|
6321
|
-
mesh(cyl(0.055, 0.055, 0.01, 12), trim, [0, 0.035, -0.07]),
|
|
6322
|
-
mesh(bx(0.014, 0.0113, 0.17), trim, [0, 0.03215, 0.04]),
|
|
6323
|
-
mesh(cyl(6e-3, 6e-3, 0.012, 6), metal(9080208), [0, 0.034, 0]),
|
|
6324
|
-
mesh(cyl(6e-3, 6e-3, 0.012, 6), metal(9080208), [0, 0.034, 0.06])
|
|
6325
|
-
);
|
|
6326
|
-
};
|
|
6327
|
-
|
|
6328
|
-
// src/models/road-map.ts
|
|
6329
|
-
var roadMap = ({ mesh, bx, G, paper: paper2 }) => {
|
|
6330
|
-
const group = G();
|
|
6331
|
-
group.add(mesh(bx(0.11, 3e-3, 0.25), paper2(5208714), [0, 15e-4, 0]));
|
|
6332
|
-
group.add(mesh(bx(0.108, 4e-3, 0.24), paper2(14998722), [0, 5e-3, 0]));
|
|
6333
|
-
group.add(mesh(bx(0.11, 3e-3, 0.18), paper2(5208714), [0, 85e-4, 0.035]));
|
|
6334
|
-
group.add(mesh(bx(0.11, 3e-3, 0.07), paper2(14727216), [0, 85e-4, -0.09]));
|
|
6335
|
-
return group;
|
|
6336
|
-
};
|
|
6337
|
-
|
|
6338
|
-
// src/models/rolling-suitcase.ts
|
|
6339
|
-
var rollingSuitcase = ({ mesh, cyl, bx, G, plastic }) => {
|
|
6340
|
-
const shell = plastic(4016732);
|
|
6341
|
-
const trim = plastic(2040358);
|
|
6342
|
-
const parts = [
|
|
6343
|
-
mesh(bx(0.4, 0.55, 0.236), shell, [0, 0.325, 0]),
|
|
6344
|
-
mesh(bx(0.012, 0.5, 0.25), trim, [-0.1, 0.325, 0]),
|
|
6345
|
-
mesh(bx(0.012, 0.5, 0.25), trim, [0.1, 0.325, 0]),
|
|
6346
|
-
mesh(bx(0.012, 0.04, 0.012), trim, [-0.06, 0.62, 0]),
|
|
6347
|
-
mesh(bx(0.012, 0.04, 0.012), trim, [0.06, 0.62, 0]),
|
|
6348
|
-
mesh(bx(0.15, 0.02, 0.03), trim, [0, 0.64, 0]),
|
|
6349
|
-
mesh(bx(0.12, 0.03, 0.04), trim, [0, 0.55, -0.1])
|
|
6350
|
-
];
|
|
6351
|
-
for (const x of [-0.15, 0.15]) for (const z of [-0.09, 0.09]) parts.push(mesh(cyl(0.025, 0.025, 0.02, 8), trim, [x, 0.025, z], [0, 0, Math.PI / 2]));
|
|
6352
|
-
return G(...parts);
|
|
6353
|
-
};
|
|
6354
|
-
|
|
6355
|
-
// src/models/rubber-boots.ts
|
|
6356
|
-
var rubberBoots = ({ mesh, bx, cyl, G, plastic }) => {
|
|
6357
|
-
const rubber = plastic(4020794);
|
|
6358
|
-
const sole = plastic(1907997);
|
|
6359
|
-
const rim = plastic(3099182);
|
|
6360
|
-
const boot = (z) => [
|
|
6361
|
-
mesh(bx(0.3, 0.025, 0.105), sole, [0, 0.0125, z]),
|
|
6362
|
-
mesh(bx(0.07, 0.03, 0.105), sole, [-0.115, 0.04, z]),
|
|
6363
|
-
mesh(bx(0.2, 0.06, 0.1), rubber, [0.04, 0.055, z]),
|
|
6364
|
-
mesh(cyl(0.046, 0.046, 0.06, 8), rubber, [0.1, 0.06, z]),
|
|
6365
|
-
mesh(cyl(0.048, 0.0495, 0.3175, 10), rubber, [-0.085, 0.18625, z]),
|
|
6366
|
-
mesh(cyl(0.054, 0.054, 0.015, 10), rim, [-0.085, 0.3425, z])
|
|
6367
|
-
];
|
|
6368
|
-
return G(...boot(-0.0575), ...boot(0.0575));
|
|
6369
|
-
};
|
|
6370
|
-
|
|
6371
|
-
// src/models/safe-key.ts
|
|
6372
|
-
var safeKey = ({ mesh, bx, G, metal }) => {
|
|
6373
|
-
const brass = metal(11569710);
|
|
6374
|
-
const parts = [
|
|
6375
|
-
mesh(bx(0.046, 0.01, 5e-3), brass, [0.012, 0.0125, 0]),
|
|
6376
|
-
mesh(bx(4e-3, 0.016, 5e-3), brass, [-0.01, 0.0125, 0]),
|
|
6377
|
-
mesh(bx(6e-3, 4e-3, 5e-3), brass, [0, 55e-4, 0]),
|
|
6378
|
-
mesh(bx(6e-3, 4e-3, 5e-3), brass, [0.01, 55e-4, 0]),
|
|
6379
|
-
mesh(bx(6e-3, 4e-3, 5e-3), brass, [0.02, 55e-4, 0]),
|
|
6380
|
-
mesh(bx(6e-3, 4e-3, 5e-3), brass, [0.0315, 55e-4, 0]),
|
|
6381
|
-
mesh(bx(6e-3, 4e-3, 5e-3), brass, [0, 0.0195, 0]),
|
|
6382
|
-
mesh(bx(6e-3, 4e-3, 5e-3), brass, [0.015, 0.0195, 0])
|
|
6383
|
-
];
|
|
6384
|
-
const segments = 8;
|
|
6385
|
-
for (let index = 0; index < segments; index++) {
|
|
6386
|
-
const angle = 2 * Math.PI * index / segments;
|
|
6387
|
-
parts.push(mesh(bx(66e-4, 45e-4, 5e-3), brass, [-0.0225 + 0.0102 * Math.cos(angle), 0.0125 + 0.0102 * Math.sin(angle), 0], [0, 0, angle + Math.PI / 2]));
|
|
6388
|
-
}
|
|
6389
|
-
return G(...parts);
|
|
6390
|
-
};
|
|
6391
|
-
|
|
6392
|
-
// src/models/safety-goggles.ts
|
|
6393
|
-
var safetyGoggles = ({ mesh, bx, cyl, G, plastic, glass, cloth: cloth2 }) => {
|
|
6394
|
-
const frame = plastic(3100527);
|
|
6395
|
-
const lens = glass(13625072, 0.45);
|
|
6396
|
-
const band = cloth2(2040614);
|
|
6397
|
-
const cup2 = (x) => [
|
|
6398
|
-
mesh(cyl(0.03, 0.03, 0.02, 10), frame, [x, 0.03, 0.027], [Math.PI / 2, 0, 0]),
|
|
6399
|
-
mesh(cyl(0.024, 0.024, 6e-3, 10), lens, [x, 0.03, 0.037], [Math.PI / 2, 0, 0])
|
|
6400
|
-
];
|
|
6401
|
-
return G(
|
|
6402
|
-
...cup2(-0.04),
|
|
6403
|
-
...cup2(0.04),
|
|
6404
|
-
mesh(bx(0.03, 0.012, 0.02), frame, [0, 0.036, 0.027]),
|
|
6405
|
-
mesh(bx(6e-3, 0.03, 0.05), band, [-0.077, 0.03, 0]),
|
|
6406
|
-
mesh(bx(6e-3, 0.03, 0.05), band, [0.077, 0.03, 0]),
|
|
6407
|
-
mesh(bx(0.16, 0.03, 6e-3), band, [0, 0.03, -0.037])
|
|
6408
|
-
);
|
|
6409
|
-
};
|
|
6410
|
-
|
|
6411
|
-
// src/models/sheet-metal-forearm-guard.ts
|
|
6412
|
-
var sheetMetalForearmGuard = ({ mesh, bx, G, metal, cloth: cloth2 }) => {
|
|
6413
|
-
const sheet = metal(8225158);
|
|
6414
|
-
const strap = cloth2(4864554);
|
|
6415
|
-
const rivet = metal(11909307);
|
|
6416
|
-
const parts = [];
|
|
6417
|
-
const count = 7;
|
|
6418
|
-
const radiusZ = 0.0524;
|
|
6419
|
-
const radiusY = 0.0955;
|
|
6420
|
-
const phiMax = 1.3;
|
|
6421
|
-
for (let index = 0; index < count; index++) {
|
|
6422
|
-
const phi = -phiMax + 2 * phiMax * index / (count - 1);
|
|
6423
|
-
const y = 0.0455 + radiusY * (Math.cos(phi) - Math.cos(phiMax));
|
|
6424
|
-
const z = radiusZ * Math.sin(phi);
|
|
6425
|
-
const speed = Math.hypot(radiusY * Math.sin(phi), radiusZ * Math.cos(phi));
|
|
6426
|
-
const angle = Math.atan2(radiusY * Math.sin(phi), radiusZ * Math.cos(phi));
|
|
6427
|
-
const length = speed * (2 * phiMax) / (count - 1) * 1.1;
|
|
6428
|
-
parts.push(mesh(bx(0.3, 6e-3, length), sheet, [0, y, z], [angle, 0, 0]));
|
|
6429
|
-
for (const x of [-0.09, 0.09]) parts.push(mesh(bx(0.03, 6e-3, length), strap, [x, y + 3e-3 * Math.cos(angle), z + 3e-3 * Math.sin(angle)], [angle, 0, 0]));
|
|
6430
|
-
}
|
|
6431
|
-
parts.push(mesh(bx(0.012, 0.012, 0.012), rivet, [0.09, 0.0985, 0]), mesh(bx(0.012, 0.012, 0.012), rivet, [-0.09, 0.0985, 0]));
|
|
6432
|
-
return G(...parts);
|
|
6433
|
-
};
|
|
6434
|
-
|
|
6435
|
-
// src/models/shopping-bag.ts
|
|
6436
|
-
var shoppingBag = ({ mesh, bx, G, cloth: cloth2 }) => {
|
|
6437
|
-
const body = cloth2(4942426);
|
|
6438
|
-
const trim = cloth2(3099196);
|
|
6439
|
-
return G(
|
|
6440
|
-
mesh(bx(0.3, 8e-3, 0.2), body, [0, 4e-3, 0]),
|
|
6441
|
-
mesh(bx(0.2, 8e-3, 0.12), trim, [0, 0.012, 0]),
|
|
6442
|
-
mesh(bx(0.1, 4e-3, 0.012), trim, [0, 0.018, -0.05]),
|
|
6443
|
-
mesh(bx(0.1, 4e-3, 0.012), trim, [0, 0.018, 0.05])
|
|
6444
|
-
);
|
|
6445
|
-
};
|
|
6446
|
-
|
|
6447
|
-
// src/models/shopping-cart.ts
|
|
6448
|
-
var shoppingCart = ({ mesh, cyl, bx, G, metal, plastic }) => {
|
|
6449
|
-
const wire = metal(11843514);
|
|
6450
|
-
const grip = plastic(2763822);
|
|
6451
|
-
const group = G();
|
|
6452
|
-
const add = (...parts) => parts.forEach((part) => group.add(part));
|
|
6453
|
-
add(mesh(bx(0.5, 0.012, 0.8), wire, [0, 0.38, 0]), mesh(bx(0.55, 0.03, 0.03), grip, [0, 0.965, -0.46]));
|
|
6454
|
-
for (const side of [-1, 1]) {
|
|
6455
|
-
add(mesh(bx(0.012, 0.012, 0.8), wire, [side * 0.25, 0.75, 0]), mesh(bx(0.012, 0.012, 0.8), wire, [side * 0.25, 0.56, 0]));
|
|
6456
|
-
add(mesh(bx(0.012, 0.012, 0.95), wire, [side * 0.22, 0.14, 0]), mesh(bx(0.02, 0.6, 0.02), wire, [side * 0.26, 0.66, -0.46]));
|
|
6457
|
-
for (const z of [-0.4, 0.4]) add(mesh(bx(0.012, 0.37, 0.012), wire, [side * 0.25, 0.565, z]));
|
|
6458
|
-
add(mesh(bx(8e-3, 0.25, 8e-3), wire, [side * 0.22, 0.265, -0.3]), mesh(bx(8e-3, 0.25, 8e-3), wire, [side * 0.22, 0.265, 0.3]));
|
|
6459
|
-
for (const z of [-0.3, 0.4]) add(mesh(cyl(0.06, 0.06, 0.03, 8), grip, [side * 0.25, 0.06, z], [0, 0, Math.PI / 2]));
|
|
6460
|
-
}
|
|
6461
|
-
add(mesh(bx(0.5, 0.012, 0.012), wire, [0, 0.75, 0.4]), mesh(bx(0.5, 0.012, 0.012), wire, [0, 0.56, 0.4]));
|
|
6462
|
-
add(mesh(bx(0.5, 0.012, 0.012), wire, [0, 0.75, -0.4]), mesh(bx(0.5, 0.012, 0.012), wire, [0, 0.56, -0.4]));
|
|
6463
|
-
for (const x of [-0.125, 0.125]) add(mesh(bx(0.012, 0.016, 0.8), wire, [x, 0.38, 0]));
|
|
6464
|
-
add(mesh(bx(0.44, 0.012, 0.012), wire, [0, 0.14, -0.3]), mesh(bx(0.44, 0.012, 0.012), wire, [0, 0.14, 0.3]));
|
|
6465
|
-
return group;
|
|
6466
|
-
};
|
|
6467
|
-
|
|
6468
|
-
// src/models/skill-book.ts
|
|
6469
|
-
var skillBook = ({ mesh, bx, G, paper: paper2, cloth: cloth2 }) => {
|
|
6470
|
-
const cover = cloth2(7028518);
|
|
6471
|
-
const trim = paper2(13214810);
|
|
6472
|
-
return G(
|
|
6473
|
-
mesh(bx(0.154, 0.224, 0.033), paper2(14998726), [5e-4, 0.115, 0]),
|
|
6474
|
-
mesh(bx(0.154, 0.23, 34e-4), cover, [3e-3, 0.115, 0.0158]),
|
|
6475
|
-
mesh(bx(0.154, 0.23, 34e-4), cover, [3e-3, 0.115, -0.0158]),
|
|
6476
|
-
mesh(bx(6e-3, 0.23, 0.04), cover, [-0.077, 0.115, 0]),
|
|
6477
|
-
mesh(bx(6e-3, 0.01, 0.036), trim, [-0.0785, 0.2, 0]),
|
|
6478
|
-
mesh(bx(6e-3, 0.01, 0.036), trim, [-0.0785, 0.03, 0]),
|
|
6479
|
-
mesh(bx(0.09, 0.05, 32e-4), trim, [5e-3, 0.17, 0.0181]),
|
|
6480
|
-
mesh(bx(0.06, 6e-3, 32e-4), trim, [5e-3, 0.06, 0.0181])
|
|
6481
|
-
);
|
|
6482
|
-
};
|
|
6483
|
-
|
|
6484
|
-
// src/models/snare-trap.ts
|
|
6485
|
-
var snareTrap = ({ mesh, torus, bx, G, metal, wood }) => {
|
|
6486
|
-
const group = G();
|
|
6487
|
-
group.add(mesh(torus(0.067, 8e-3), metal(9277590), [0, 0.015, 0], [Math.PI / 2, 0, 0]));
|
|
6488
|
-
group.add(mesh(bx(0.02, 0.03, 0.02), wood(8018490), [0.065, 0.015, 0]));
|
|
6489
|
-
group.add(mesh(bx(0.02, 0.02, 0.02), metal(7106421), [0, 0.015, 0.065]));
|
|
6490
|
-
group.add(mesh(bx(6e-3, 6e-3, 0.03), wood(10519904), [0, 0.01, -0.06]));
|
|
6491
|
-
return group;
|
|
6492
|
-
};
|
|
6493
|
-
|
|
6494
|
-
// src/models/sneakers.ts
|
|
6495
|
-
var sneakers = ({ mesh, bx, cyl, G, cloth: cloth2, plastic }) => {
|
|
6496
|
-
const upper = cloth2(5922920);
|
|
6497
|
-
const sole = plastic(15263972);
|
|
6498
|
-
const accent = cloth2(3043192);
|
|
6499
|
-
const lace = cloth2(15790314);
|
|
6500
|
-
return G(
|
|
6501
|
-
mesh(bx(0.25, 0.022, 0.12), sole, [-0.025, 0.011, 0]),
|
|
6502
|
-
mesh(cyl(0.06, 0.06, 0.018, 10), sole, [0.09, 0.011, 0]),
|
|
6503
|
-
mesh(bx(0.11, 0.09, 0.11), upper, [-0.095, 0.067, 0]),
|
|
6504
|
-
mesh(bx(0.12, 0.052, 0.106), upper, [0, 0.046, 0]),
|
|
6505
|
-
mesh(cyl(0.055, 0.055, 0.046, 10), upper, [0.095, 0.041, 0]),
|
|
6506
|
-
mesh(bx(0.03, 0.05, 0.08), accent, [-0.03, 0.095, 0]),
|
|
6507
|
-
mesh(bx(0.1, 0.03, 6e-3), accent, [-0.05, 0.05, 0.056]),
|
|
6508
|
-
mesh(bx(0.1, 0.03, 6e-3), accent, [-0.05, 0.05, -0.056]),
|
|
6509
|
-
mesh(bx(8e-3, 4e-3, 0.09), lace, [0, 0.074, 0]),
|
|
6510
|
-
mesh(bx(8e-3, 4e-3, 0.09), lace, [0.03, 0.074, 0]),
|
|
6511
|
-
mesh(bx(8e-3, 4e-3, 0.08), lace, [0.06, 0.066, 0])
|
|
6512
|
-
);
|
|
6513
|
-
};
|
|
6514
|
-
|
|
6515
|
-
// src/models/tactical-vest.ts
|
|
6516
|
-
var tacticalVest = ({ mesh, bx, G, cloth: cloth2, plastic }) => {
|
|
6517
|
-
const shell = cloth2(4870710);
|
|
6518
|
-
const pouch = cloth2(3883561);
|
|
6519
|
-
const buckle = plastic(1974304);
|
|
6520
|
-
return G(
|
|
6521
|
-
mesh(bx(0.35, 0.03, 0.28), shell, [0, 0.015, 0.06]),
|
|
6522
|
-
mesh(bx(0.09, 0.03, 0.12), shell, [-0.13, 0.015, -0.14]),
|
|
6523
|
-
mesh(bx(0.09, 0.03, 0.12), shell, [0.13, 0.015, -0.14]),
|
|
6524
|
-
mesh(bx(0.09, 0.07, 0.05), pouch, [-0.11, 0.065, 0.165]),
|
|
6525
|
-
mesh(bx(0.09, 0.07, 0.05), pouch, [0, 0.065, 0.165]),
|
|
6526
|
-
mesh(bx(0.09, 0.07, 0.05), pouch, [0.11, 0.065, 0.165]),
|
|
6527
|
-
mesh(bx(0.07, 0.05, 0.07), pouch, [-0.13, 0.055, 0.07]),
|
|
6528
|
-
mesh(bx(0.07, 0.05, 0.07), pouch, [0.13, 0.055, 0.07]),
|
|
6529
|
-
mesh(bx(0.03, 0.02, 0.02), buckle, [0, 0.04, 0])
|
|
6530
|
-
);
|
|
6531
|
-
};
|
|
6532
|
-
|
|
6533
|
-
// src/models/technical-manual.ts
|
|
6534
|
-
var technicalManual = ({ mesh, bx, G, paper: paper2, plastic }) => {
|
|
6535
|
-
const binder = plastic(3096402);
|
|
6536
|
-
const label = paper2(14998726);
|
|
6537
|
-
return G(
|
|
6538
|
-
mesh(bx(0.196, 0.292, 0.029), paper2(14998726), [2e-3, 0.15, 0]),
|
|
6539
|
-
mesh(bx(0.198, 0.3, 3e-3), binder, [6e-3, 0.15, 0.016]),
|
|
6540
|
-
mesh(bx(0.198, 0.3, 3e-3), binder, [6e-3, 0.15, -0.016]),
|
|
6541
|
-
mesh(bx(0.012, 0.3, 0.0385), binder, [-0.099, 0.15, -75e-5]),
|
|
6542
|
-
mesh(bx(6e-3, 0.18, 3e-3), label, [-0.0995, 0.15, 0.019]),
|
|
6543
|
-
mesh(bx(0.12, 0.05, 4e-3), label, [0.01, 0.23, 0.0185]),
|
|
6544
|
-
mesh(bx(0.12, 4e-3, 4e-3), plastic(11843514), [0.01, 0.17, 0.0185])
|
|
6545
|
-
);
|
|
6546
|
-
};
|
|
6547
|
-
|
|
6548
|
-
// src/models/tool-belt.ts
|
|
6549
|
-
var toolBelt = ({ mesh, bx, G, cloth: cloth2, metal }) => {
|
|
6550
|
-
const leather = cloth2(7031343);
|
|
6551
|
-
const pouch = cloth2(5191714);
|
|
6552
|
-
return G(
|
|
6553
|
-
mesh(bx(0.35, 0.04, 0.02), leather, [0, 0.05, 0.105]),
|
|
6554
|
-
mesh(bx(0.35, 0.04, 0.02), leather, [0, 0.05, -0.115]),
|
|
6555
|
-
mesh(bx(0.016, 0.036, 0.218), leather, [-0.165, 0.05, -6e-3]),
|
|
6556
|
-
mesh(bx(0.016, 0.036, 0.218), leather, [0.165, 0.05, -6e-3]),
|
|
6557
|
-
mesh(bx(0.08, 0.1, 0.04), pouch, [-0.1, 0.05, 0.105]),
|
|
6558
|
-
mesh(bx(0.08, 0.08, 0.04), pouch, [0.1, 0.04, 0.105]),
|
|
6559
|
-
mesh(bx(0.04, 0.09, 0.08), pouch, [-0.155, 0.045, -0.02]),
|
|
6560
|
-
mesh(bx(0.02, 0.08, 0.02), pouch, [0.145, 0.04, -0.09]),
|
|
6561
|
-
mesh(bx(0.04, 0.035, 0.012), metal(11580085), [0, 0.05, 0.119])
|
|
6562
|
-
);
|
|
6563
|
-
};
|
|
6564
|
-
|
|
6565
|
-
// src/models/trash-bag.ts
|
|
6566
|
-
var trashBag = ({ mesh, bx, G, plastic }) => {
|
|
6567
|
-
const film = plastic(1842463);
|
|
6568
|
-
return G(
|
|
6569
|
-
mesh(bx(0.2, 0.02, 0.2), film, [-0.025, 0.01, 0]),
|
|
6570
|
-
mesh(bx(0.2, 5e-3, 0.02), film, [-0.025, 0.0225, 0]),
|
|
6571
|
-
mesh(bx(0.05, 0.012, 0.08), film, [0.1, 6e-3, 0]),
|
|
6572
|
-
mesh(bx(0.028, 0.023, 0.04), film, [0.109, 0.0135, 0])
|
|
6573
|
-
);
|
|
6574
|
-
};
|
|
6575
|
-
|
|
6576
|
-
// src/models/trekking-backpack-70l.ts
|
|
6577
|
-
var trekkingBackpack70L = ({ mesh, bx, G, cloth: cloth2, plastic }) => {
|
|
6578
|
-
const main = cloth2(6116928);
|
|
6579
|
-
const dark = cloth2(3091234);
|
|
6580
|
-
return G(
|
|
6581
|
-
mesh(bx(0.34, 0.2, 0.2), dark, [0, 0.1, -0.03]),
|
|
6582
|
-
mesh(bx(0.36, 0.49, 0.2), main, [0, 0.445, -0.03]),
|
|
6583
|
-
mesh(bx(0.38, 0.06, 0.26), dark, [0, 0.72, -0.02]),
|
|
6584
|
-
mesh(bx(0.28, 0.3, 0.0765), main, [0, 0.35, 0.10825]),
|
|
6585
|
-
mesh(bx(0.06, 0.45, 0.02), dark, [-0.1, 0.45, -0.14]),
|
|
6586
|
-
mesh(bx(0.06, 0.45, 0.02), dark, [0.1, 0.45, -0.14]),
|
|
6587
|
-
mesh(bx(0.38, 0.03, 0.0185), dark, [0, 0.3, 0.13925]),
|
|
6588
|
-
mesh(bx(0.05, 0.026, 0.0155), plastic(1842463), [0, 0.3, 0.14275])
|
|
6589
|
-
);
|
|
6590
|
-
};
|
|
6591
|
-
|
|
6592
|
-
// src/models/tshirt.ts
|
|
6593
|
-
var tshirt = ({ mesh, bx, G, cloth: cloth2 }) => {
|
|
6594
|
-
const fabric = cloth2(9080724);
|
|
6595
|
-
const rib = cloth2(7304056);
|
|
6596
|
-
const inside = cloth2(2829616);
|
|
6597
|
-
return G(
|
|
6598
|
-
mesh(bx(0.21, 0.0352, 0.22), fabric, [0, 0.0176, 0]),
|
|
6599
|
-
mesh(bx(0.045, 0.03, 0.08), fabric, [-0.1275, 0.015, -0.07]),
|
|
6600
|
-
mesh(bx(0.045, 0.03, 0.08), fabric, [0.1275, 0.015, -0.07]),
|
|
6601
|
-
mesh(bx(0.045, 0.034, 0.012), rib, [-0.1275, 0.017, -0.024]),
|
|
6602
|
-
mesh(bx(0.045, 0.034, 0.012), rib, [0.1275, 0.017, -0.024]),
|
|
6603
|
-
mesh(bx(0.07, 0.0356, 0.022), inside, [0, 0.0198, -0.097]),
|
|
6604
|
-
mesh(bx(0.09, 0.0358, 0.012), rib, [0, 0.0219, -0.1])
|
|
6605
|
-
);
|
|
6606
|
-
};
|
|
6607
|
-
|
|
6608
|
-
// src/models/watering-can.ts
|
|
6609
|
-
var wateringCan = ({ mesh, cyl, bx, G, metal }) => {
|
|
6610
|
-
const zinc = metal(8358799);
|
|
6611
|
-
const group = G();
|
|
6612
|
-
group.add(mesh(cyl(0.09, 0.09, 0.2, 16), zinc, [-0.06, 0.1, 0]));
|
|
6613
|
-
group.add(mesh(cyl(0.07, 0.07, 4e-3, 16), metal(4936278), [-0.06, 0.2, 0]));
|
|
6614
|
-
group.add(mesh(cyl(0.012, 0.02, 0.22, 8), zinc, [0.1194, 0.115, 0], [0, 0, -0.85]));
|
|
6615
|
-
group.add(mesh(cyl(0.035, 0.022, 0.02, 12), zinc, [0.2094, 0.225, 0], [0, 0, -0.85]));
|
|
6616
|
-
group.add(mesh(bx(0.01, 0.16, 0.02), zinc, [-0.155, 0.12, 0]));
|
|
6617
|
-
group.add(mesh(bx(0.05, 0.01, 0.02), zinc, [-0.135, 0.2, 0]));
|
|
6618
|
-
group.add(mesh(bx(0.05, 0.01, 0.02), zinc, [-0.135, 0.04, 0]));
|
|
6619
|
-
return group;
|
|
6620
|
-
};
|
|
6621
|
-
|
|
6622
|
-
// src/models/wheelbarrow.ts
|
|
6623
|
-
var wheelbarrow = ({ mesh, cyl, bx, G, metal, plastic }) => {
|
|
6624
|
-
const tub = metal(3104058);
|
|
6625
|
-
const frame = metal(3816768);
|
|
6626
|
-
const tire = plastic(1908256);
|
|
6627
|
-
const tilt = 0.42;
|
|
6628
|
-
return G(
|
|
6629
|
-
mesh(bx(0.4, 0.02, 0.5), tub, [0, 0.38, 0.2]),
|
|
6630
|
-
mesh(bx(0.02, 0.29, 0.62), tub, [-0.255, 0.515, 0.2], [0, 0, tilt]),
|
|
6631
|
-
mesh(bx(0.02, 0.29, 0.62), tub, [0.255, 0.515, 0.2], [0, 0, -tilt]),
|
|
6632
|
-
mesh(bx(0.5, 0.29, 0.02), tub, [0, 0.515, 0.5], [0.5, 0, 0]),
|
|
6633
|
-
mesh(bx(0.5, 0.29, 0.02), tub, [0, 0.515, -0.1], [-0.5, 0, 0]),
|
|
6634
|
-
mesh(bx(0.03, 0.03, 1.28), frame, [-0.2, 0.33, -0.09]),
|
|
6635
|
-
mesh(bx(0.03, 0.03, 1.28), frame, [0.2, 0.33, -0.09]),
|
|
6636
|
-
mesh(cyl(0.02, 0.02, 0.3, 6), plastic(7031343), [-0.2, 0.33, -0.6], [Math.PI / 2, 0, 0]),
|
|
6637
|
-
mesh(cyl(0.02, 0.02, 0.3, 6), plastic(7031343), [0.2, 0.33, -0.6], [Math.PI / 2, 0, 0]),
|
|
6638
|
-
mesh(bx(0.03, 0.31, 0.03), frame, [-0.2, 0.155, -0.35]),
|
|
6639
|
-
mesh(bx(0.03, 0.31, 0.03), frame, [0.2, 0.155, -0.35]),
|
|
6640
|
-
mesh(bx(0.02, 0.15, 0.02), frame, [-0.05, 0.27, 0.55]),
|
|
6641
|
-
mesh(bx(0.02, 0.15, 0.02), frame, [0.05, 0.27, 0.55]),
|
|
6642
|
-
mesh(cyl(0.2, 0.2, 0.06, 12), tire, [0, 0.2, 0.55], [0, 0, Math.PI / 2])
|
|
6643
|
-
);
|
|
6644
|
-
};
|
|
6645
|
-
|
|
6646
|
-
// src/models/windup-alarm-clock.ts
|
|
6647
|
-
var windupAlarmClock = ({ M, mesh, cyl, bx, G, metal, plastic }) => {
|
|
6648
|
-
const steel = metal(10987947);
|
|
6649
|
-
const bell = metal(8290435);
|
|
6650
|
-
const quarter = Math.PI / 2;
|
|
6651
|
-
return G(
|
|
6652
|
-
mesh(cyl(0.0475, 0.0475, 0.048, 18), steel, [0, 0.0575, 0], [quarter, 0, 0]),
|
|
6653
|
-
mesh(cyl(0.04, 0.04, 2e-3, 18), plastic(15262415), [0, 0.0575, 0.025], [quarter, 0, 0]),
|
|
6654
|
-
mesh(bx(3e-3, 0.026, 15e-4), plastic(1842204), [0, 0.07, 0.0255]),
|
|
6655
|
-
mesh(bx(3e-3, 0.018, 15e-4), plastic(1842204), [8e-3, 0.0575, 0.0255], [0, 0, -quarter]),
|
|
6656
|
-
mesh(cyl(5e-3, 8e-3, 0.014, 6), steel, [-0.03, 7e-3, 0]),
|
|
6657
|
-
mesh(cyl(5e-3, 8e-3, 0.014, 6), steel, [0.03, 7e-3, 0]),
|
|
6658
|
-
mesh(cyl(8e-3, 0.0215, 0.016, 10), bell, [-0.034, 0.105, 0]),
|
|
6659
|
-
mesh(cyl(8e-3, 0.0215, 0.016, 10), bell, [0.034, 0.105, 0]),
|
|
6660
|
-
mesh(cyl(2e-3, 2e-3, 0.01, 6), steel, [-0.026, 0.118, 0]),
|
|
6661
|
-
mesh(cyl(2e-3, 2e-3, 0.01, 6), steel, [0.026, 0.118, 0]),
|
|
6662
|
-
mesh(bx(0.052, 4e-3, 4e-3), steel, [0, 0.123, 0]),
|
|
6663
|
-
mesh(cyl(3e-3, 3e-3, 7e-3, 6), steel, [0, 0.0575, -0.0255], [quarter, 0, 0]),
|
|
6664
|
-
mesh(bx(0.022, 8e-3, 3e-3), M(10987947, "metal", { metalness: 0.55, roughness: 0.45 }), [0, 0.0575, -0.0275])
|
|
6665
|
-
);
|
|
6666
|
-
};
|
|
6667
|
-
|
|
6668
|
-
// src/models/shipped.ts
|
|
6669
|
-
var BUILDERS = {
|
|
6670
|
-
canned_beans: cannedBeans,
|
|
6671
|
-
water_bottle: waterBottle,
|
|
6672
|
-
rice,
|
|
6673
|
-
military_ration: militaryRation,
|
|
6674
|
-
cachaca,
|
|
6675
|
-
first_aid_kit: firstAidKit,
|
|
6676
|
-
bandage,
|
|
6677
|
-
amoxicillin,
|
|
6678
|
-
crowbar,
|
|
6679
|
-
hammer,
|
|
6680
|
-
machete,
|
|
6681
|
-
axe,
|
|
6682
|
-
nail_bat: nailBat,
|
|
6683
|
-
hiking_backpack_40l: hikingBackpack40L,
|
|
6684
|
-
flashlight,
|
|
6685
|
-
portable_radio: portableRadio,
|
|
6686
|
-
house_key: houseKey,
|
|
6687
|
-
survivor_diary: survivorDiary,
|
|
6688
|
-
motorcycle_helmet: motorcycleHelmet,
|
|
6689
|
-
lpg_cylinder_13kg: lpgCylinder13Kg,
|
|
6690
|
-
fuel_jerrycan: fuelJerrycan,
|
|
6691
|
-
walkie_talkies: walkieTalkies,
|
|
6692
|
-
batteries,
|
|
6693
|
-
wooden_plank: woodenPlank,
|
|
6694
|
-
sugar,
|
|
6695
|
-
chocolate_bar: chocolateBar,
|
|
6696
|
-
potatoes,
|
|
6697
|
-
biscuits,
|
|
6698
|
-
coffee,
|
|
6699
|
-
raw_beef: rawBeef,
|
|
6700
|
-
game_meat: gameMeat,
|
|
6701
|
-
jerked_beef: jerkedBeef,
|
|
6702
|
-
home_preserves: homePreserves,
|
|
6703
|
-
eggs,
|
|
6704
|
-
cassava_flour: cassavaFlour,
|
|
6705
|
-
beans,
|
|
6706
|
-
frozen_chicken: frozenChicken,
|
|
6707
|
-
orange,
|
|
6708
|
-
condensed_milk: condensedMilk,
|
|
6709
|
-
pasta,
|
|
6710
|
-
instant_noodles: instantNoodles,
|
|
6711
|
-
cassava_root: cassavaRoot,
|
|
6712
|
-
canned_corn_and_peas: cannedCornAndPeas,
|
|
6713
|
-
mortadella,
|
|
6714
|
-
fresh_fish: freshFish,
|
|
6715
|
-
salted_fish: saltedFish,
|
|
6716
|
-
banana_bunch: bananaBunch,
|
|
6717
|
-
honey_jar: honeyJar,
|
|
6718
|
-
bread,
|
|
6719
|
-
cheese,
|
|
6720
|
-
rapadura,
|
|
6721
|
-
dog_food: dogFood,
|
|
6722
|
-
salt,
|
|
6723
|
-
snack_chips: snackChips,
|
|
6724
|
-
canned_sausages: cannedSausages,
|
|
6725
|
-
canned_sardines: cannedSardines,
|
|
6726
|
-
cooking_oil: cookingOil,
|
|
6727
|
-
beer_can: beerCan,
|
|
6728
|
-
energy_drink: energyDrink,
|
|
6729
|
-
water_jug_5l: waterJug5l,
|
|
6730
|
-
sports_drink: sportsDrink,
|
|
6731
|
-
milk_carton: milkCarton,
|
|
6732
|
-
soda_can: sodaCan,
|
|
6733
|
-
juice_box: juiceBox,
|
|
6734
|
-
communion_wine: communionWine,
|
|
6735
|
-
coconut_water: coconutWater,
|
|
6736
|
-
dirty_water: dirtyWater,
|
|
6737
|
-
painkillers,
|
|
6738
|
-
tramadol,
|
|
6739
|
-
ibuprofen,
|
|
6740
|
-
antihistamine,
|
|
6741
|
-
ceftriaxone,
|
|
6742
|
-
clonazepam,
|
|
6743
|
-
activated_charcoal: activatedCharcoal,
|
|
6744
|
-
adhesive_bandages: adhesiveBandages,
|
|
6745
|
-
medical_tape: medicalTape,
|
|
6746
|
-
sterile_gauze: sterileGauze,
|
|
6747
|
-
povidone_iodine: povidoneIodine,
|
|
6748
|
-
suture_kit: sutureKit,
|
|
6749
|
-
exam_gloves: examGloves,
|
|
6750
|
-
n95_mask: n95Mask,
|
|
6751
|
-
multivitamin,
|
|
6752
|
-
maintenance_medication: maintenanceMedication,
|
|
6753
|
-
rehydration_salts: rehydrationSalts,
|
|
6754
|
-
syringe,
|
|
6755
|
-
antivenom,
|
|
6756
|
-
saline_iv_bag: salineIvBag,
|
|
6757
|
-
splint,
|
|
6758
|
-
thermometer,
|
|
6759
|
-
alcohol_70: alcohol70,
|
|
6760
|
-
can_opener: canOpener,
|
|
6761
|
-
pliers,
|
|
6762
|
-
bolt_cutters: boltCutters,
|
|
6763
|
-
bucket,
|
|
6764
|
-
binoculars,
|
|
6765
|
-
matches,
|
|
6766
|
-
pocket_knife: pocketKnife,
|
|
6767
|
-
screwdriver,
|
|
6768
|
-
adjustable_wrench: adjustableWrench,
|
|
6769
|
-
hoe,
|
|
6770
|
-
fire_extinguisher: fireExtinguisher,
|
|
6771
|
-
duct_tape: ductTape,
|
|
6772
|
-
camp_stove: campStove,
|
|
6773
|
-
lighter,
|
|
6774
|
-
lockpick_kit: lockpickKit,
|
|
6775
|
-
sewing_kit: sewingKit,
|
|
6776
|
-
car_jack: carJack,
|
|
6777
|
-
mechanic_toolbox: mechanicToolbox,
|
|
6778
|
-
gas_torch: gasTorch,
|
|
6779
|
-
inverter_welder: inverterWelder,
|
|
6780
|
-
pot,
|
|
6781
|
-
cordless_drill: cordlessDrill,
|
|
6782
|
-
flint_striker: flintStriker,
|
|
6783
|
-
sharpening_stone: sharpeningStone,
|
|
6784
|
-
shovel,
|
|
6785
|
-
hacksaw,
|
|
6786
|
-
handsaw,
|
|
6787
|
-
scissors,
|
|
6788
|
-
recurve_bow: recurveBow,
|
|
6789
|
-
crossbow,
|
|
6790
|
-
iron_pipe: ironPipe,
|
|
6791
|
-
meat_cleaver: meatCleaver,
|
|
6792
|
-
slingshot,
|
|
6793
|
-
knife,
|
|
6794
|
-
tactical_knife: tacticalKnife,
|
|
6795
|
-
kabar,
|
|
6796
|
-
katana,
|
|
6797
|
-
brass_knuckles: brassKnuckles,
|
|
6798
|
-
arrows_and_bolts: arrowsAndBolts,
|
|
6799
|
-
sickle,
|
|
6800
|
-
cast_iron_skillet: castIronSkillet,
|
|
6801
|
-
improvised_spear: improvisedSpear,
|
|
6802
|
-
hatchet,
|
|
6803
|
-
sledgehammer,
|
|
6804
|
-
chainsaw,
|
|
6805
|
-
pickaxe,
|
|
6806
|
-
baseball_bat: baseballBat,
|
|
6807
|
-
police_baton: policeBaton,
|
|
6808
|
-
wire_roll: wireRoll,
|
|
6809
|
-
barbed_wire: barbedWire,
|
|
6810
|
-
glass_shards: glassShards,
|
|
6811
|
-
sheet_metal: sheetMetal,
|
|
6812
|
-
cement_bag: cementBag,
|
|
6813
|
-
epoxy_glue: epoxyGlue,
|
|
6814
|
-
electronic_components: electronicComponents,
|
|
6815
|
-
rope,
|
|
6816
|
-
copper_wire: copperWire,
|
|
6817
|
-
pet_bottle: petBottle,
|
|
6818
|
-
glass_bottle: glassBottle,
|
|
6819
|
-
empty_can: emptyCan,
|
|
6820
|
-
firewood,
|
|
6821
|
-
tarp,
|
|
6822
|
-
screws,
|
|
6823
|
-
nails,
|
|
6824
|
-
raffia_sack: raffiaSack,
|
|
6825
|
-
scrap_metal: scrapMetal,
|
|
6826
|
-
bricks,
|
|
6827
|
-
rag,
|
|
6828
|
-
rebar,
|
|
6829
|
-
lubricant_spray: lubricantSpray,
|
|
6830
|
-
army_camouflage_uniform: armyCamouflageUniform,
|
|
6831
|
-
backpack,
|
|
6832
|
-
ballistic_vest: ballisticVest,
|
|
6833
|
-
battery_9v: battery9V,
|
|
6834
|
-
bean_seeds: beanSeeds,
|
|
6835
|
-
beekeeper_suit: beekeeperSuit,
|
|
6836
|
-
candles,
|
|
6837
|
-
car_alarm_remote: carAlarmRemote,
|
|
6838
|
-
car_battery_12v: carBattery12V,
|
|
6839
|
-
car_key: carKey,
|
|
6840
|
-
cash,
|
|
6841
|
-
cassava_cuttings: cassavaCuttings,
|
|
6842
|
-
cb_radio: cbRadio,
|
|
6843
|
-
cell_key: cellKey,
|
|
6844
|
-
charcoal_bag: charcoalBag,
|
|
6845
|
-
cigarettes,
|
|
6846
|
-
city_map: cityMap,
|
|
6847
|
-
combat_boots: combatBoots,
|
|
6848
|
-
cooler_box: coolerBox,
|
|
6849
|
-
corn_seeds: cornSeeds,
|
|
6850
|
-
crossbody_bag: crossbodyBag,
|
|
6851
|
-
delivery_bag: deliveryBag,
|
|
6852
|
-
denim_jacket: denimJacket,
|
|
6853
|
-
diesel,
|
|
6854
|
-
diy_magazine: diyMagazine,
|
|
6855
|
-
dog_tag: dogTag,
|
|
6856
|
-
electric_fence_energizer: electricFenceEnergizer,
|
|
6857
|
-
extension_cord: extensionCord,
|
|
6858
|
-
fanny_pack: fannyPack,
|
|
6859
|
-
farmers_almanac: farmersAlmanac,
|
|
6860
|
-
fertilizer_bag: fertilizerBag,
|
|
6861
|
-
firefighter_suit: firefighterSuit,
|
|
6862
|
-
fishing_net: fishingNet,
|
|
6863
|
-
fishing_rod: fishingRod,
|
|
6864
|
-
fishing_tackle_box: fishingTackleBox,
|
|
6865
|
-
flip_flops: flipFlops,
|
|
6866
|
-
folding_solar_panel: foldingSolarPanel,
|
|
6867
|
-
gas_cartridge: gasCartridge,
|
|
6868
|
-
gasoline,
|
|
6869
|
-
generator_key: generatorKey,
|
|
6870
|
-
hard_hat: hardHat,
|
|
6871
|
-
headlamp,
|
|
6872
|
-
hoodie,
|
|
6873
|
-
janitor_keys: janitorKeys,
|
|
6874
|
-
jeans,
|
|
6875
|
-
kale_and_lettuce_seeds: kaleAndLettuceSeeds,
|
|
6876
|
-
kerosene,
|
|
6877
|
-
laptop,
|
|
6878
|
-
leather_motorcycle_jacket: leatherMotorcycleJacket,
|
|
6879
|
-
leather_motorcycle_pants: leatherMotorcyclePants,
|
|
6880
|
-
leather_work_gloves: leatherWorkGloves,
|
|
6881
|
-
led_camp_lantern: ledCampLantern,
|
|
6882
|
-
magazine_arm_guard: magazineArmGuard,
|
|
6883
|
-
magazines_and_comics: magazinesAndComics,
|
|
6884
|
-
master_key: masterKey,
|
|
6885
|
-
mechanic_coveralls: mechanicCoveralls,
|
|
6886
|
-
military_backpack: militaryBackpack,
|
|
6887
|
-
military_radio: militaryRadio,
|
|
6888
|
-
mobile_phone: mobilePhone,
|
|
6889
|
-
motor_oil: motorOil,
|
|
6890
|
-
night_vision_goggles: nightVisionGoggles,
|
|
6891
|
-
note,
|
|
6892
|
-
padded_coat: paddedCoat,
|
|
6893
|
-
padlock_key: padlockKey,
|
|
6894
|
-
photo,
|
|
6895
|
-
portable_generator: portableGenerator,
|
|
6896
|
-
power_bank: powerBank,
|
|
6897
|
-
pumpkin_seeds: pumpkinSeeds,
|
|
6898
|
-
raincoat,
|
|
6899
|
-
road_map: roadMap,
|
|
6900
|
-
rolling_suitcase: rollingSuitcase,
|
|
6901
|
-
rubber_boots: rubberBoots,
|
|
6902
|
-
safe_key: safeKey,
|
|
6903
|
-
safety_goggles: safetyGoggles,
|
|
6904
|
-
sheet_metal_forearm_guard: sheetMetalForearmGuard,
|
|
6905
|
-
shopping_bag: shoppingBag,
|
|
6906
|
-
shopping_cart: shoppingCart,
|
|
6907
|
-
skill_book: skillBook,
|
|
6908
|
-
snare_trap: snareTrap,
|
|
6909
|
-
sneakers,
|
|
6910
|
-
tactical_vest: tacticalVest,
|
|
6911
|
-
technical_manual: technicalManual,
|
|
6912
|
-
tool_belt: toolBelt,
|
|
6913
|
-
trash_bag: trashBag,
|
|
6914
|
-
trekking_backpack_70l: trekkingBackpack70L,
|
|
6915
|
-
tshirt,
|
|
6916
|
-
watering_can: wateringCan,
|
|
6917
|
-
wheelbarrow,
|
|
6918
|
-
windup_alarm_clock: windupAlarmClock
|
|
6588
|
+
mesh(bx(0.08, 0.014, 0.06), shell, [0, 7e-3, -5e-3]),
|
|
6589
|
+
mesh(bx(0.04, 0.016, 0.05), metal(2763822), [0, 0.092, -5e-3])
|
|
6590
|
+
);
|
|
6591
|
+
for (const x of [-0.039, 0.039]) {
|
|
6592
|
+
group.add(mesh(cyl(0.036, 0.036, 0.046, 12), shell, [x, 0.05, 0.028], [quarter, 0, 0]));
|
|
6593
|
+
group.add(mesh(cyl(0.028, 0.028, 6e-3, 10), lens, [x, 0.05, 0.052], [quarter, 0, 0]));
|
|
6594
|
+
group.add(mesh(cyl(0.03, 0.03, 0.03, 10), plastic(1382170), [x, 0.05, -0.04], [quarter, 0, 0]));
|
|
6595
|
+
}
|
|
6596
|
+
return group;
|
|
6919
6597
|
};
|
|
6920
|
-
var SHIPPED_MODELS = models_default.map((entry) => {
|
|
6921
|
-
const builder = BUILDERS[entry.id];
|
|
6922
|
-
if (!builder) throw new Error(`game-items-three: no builder for the model "${entry.id}"`);
|
|
6923
|
-
return { entry, builder };
|
|
6924
|
-
});
|
|
6925
6598
|
|
|
6926
|
-
// src/models/
|
|
6927
|
-
var
|
|
6928
|
-
|
|
6929
|
-
|
|
6930
|
-
|
|
6931
|
-
|
|
6932
|
-
|
|
6933
|
-
|
|
6934
|
-
|
|
6935
|
-
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
|
|
6599
|
+
// src/models/note.ts
|
|
6600
|
+
var note = ({ mesh, bx, G, paper: paper2 }) => {
|
|
6601
|
+
const group = G();
|
|
6602
|
+
group.add(mesh(bx(0.15, 8e-4, 0.1), paper2(15327951), [0, 4e-4, 0]));
|
|
6603
|
+
group.add(mesh(bx(0.14, 8e-4, 0.09), paper2(15986397), [0, 16e-4, 2e-3]));
|
|
6604
|
+
return group;
|
|
6605
|
+
};
|
|
6606
|
+
|
|
6607
|
+
// src/models/padded-coat.ts
|
|
6608
|
+
var paddedCoat = ({ mesh, bx, cyl, G, cloth: cloth2, metal }) => {
|
|
6609
|
+
const shell = cloth2(3820094);
|
|
6610
|
+
const rib = cloth2(2831919);
|
|
6611
|
+
const zip = metal(10132896);
|
|
6612
|
+
const parts = [
|
|
6613
|
+
mesh(bx(0.3, 0.12, 0.35), shell, [0, 0.06, 0]),
|
|
6614
|
+
mesh(bx(0.075, 0.1, 0.24), shell, [-0.1875, 0.05, -0.055]),
|
|
6615
|
+
mesh(bx(0.075, 0.1, 0.24), shell, [0.1875, 0.05, -0.055]),
|
|
6616
|
+
mesh(bx(0.071, 0.102, 0.03), rib, [-0.1875, 0.053, 0.075]),
|
|
6617
|
+
mesh(bx(0.071, 0.102, 0.03), rib, [0.1875, 0.053, 0.075]),
|
|
6618
|
+
mesh(cyl(0.07, 0.07, 0.038, 12), shell, [0, 0.129, -0.1]),
|
|
6619
|
+
mesh(bx(0.012, 0.122, 0.336), zip, [0, 0.063, 3e-3])
|
|
6620
|
+
];
|
|
6621
|
+
for (const z of [-0.12, -0.04, 0.04, 0.12]) parts.push(mesh(bx(0.29, 0.03, 0.014), rib, [0, 0.135, z]));
|
|
6622
|
+
return G(...parts);
|
|
6623
|
+
};
|
|
6624
|
+
|
|
6625
|
+
// src/models/padlock-key.ts
|
|
6626
|
+
var padlockKey = ({ mesh, bx, G, metal }) => {
|
|
6627
|
+
const body = metal(9080208);
|
|
6628
|
+
const shackle = metal(12633030);
|
|
6629
|
+
const slot = metal(2039842);
|
|
6630
|
+
const parts = [
|
|
6631
|
+
mesh(bx(0.05, 0.05, 0.02), body, [0, 0.025, 0]),
|
|
6632
|
+
mesh(bx(0.046, 6e-3, 0.016), body, [0, 5e-3, 0]),
|
|
6633
|
+
mesh(bx(6e-3, 0.014, 0.025), slot, [0, 0.022, 0]),
|
|
6634
|
+
mesh(bx(6e-3, 0.026, 8e-3), shackle, [-0.014, 0.063, 0]),
|
|
6635
|
+
mesh(bx(6e-3, 0.026, 8e-3), shackle, [0.014, 0.063, 0])
|
|
6636
|
+
];
|
|
6637
|
+
const segments = 6;
|
|
6638
|
+
for (let index = 0; index < segments; index++) {
|
|
6639
|
+
const angle = Math.PI * (index + 0.5) / segments;
|
|
6640
|
+
parts.push(mesh(bx(0.0105, 6e-3, 8e-3), shackle, [0.014 * Math.cos(angle), 0.063 + 0.014 * Math.sin(angle), 0], [0, 0, angle + Math.PI / 2]));
|
|
6939
6641
|
}
|
|
6940
|
-
|
|
6941
|
-
|
|
6942
|
-
var defaultItemModels = () => defaultRegistry ?? (defaultRegistry = registryOver(new Map(SHIPPED_MODELS.map(({ entry }) => [entry.id, entry])), new Map(SHIPPED_MODELS.map(({ entry, builder }) => [entry.id, builder]))));
|
|
6943
|
-
var registerItemModel = (entry, builder) => defaultItemModels().register(entry, builder);
|
|
6944
|
-
var unregisterItemModel = (id) => defaultItemModels().unregister(id);
|
|
6945
|
-
var itemModelEntry = (id) => defaultItemModels().entry(id);
|
|
6946
|
-
var itemModelBuilder = (id) => defaultItemModels().builder(id);
|
|
6947
|
-
var hasItemModel = (id) => defaultItemModels().has(id);
|
|
6948
|
-
var listItemModels = () => defaultItemModels().list();
|
|
6642
|
+
return G(...parts);
|
|
6643
|
+
};
|
|
6949
6644
|
|
|
6950
|
-
// src/
|
|
6951
|
-
var
|
|
6952
|
-
|
|
6953
|
-
|
|
6954
|
-
|
|
6955
|
-
|
|
6956
|
-
"tool",
|
|
6957
|
-
"roll",
|
|
6958
|
-
"dish",
|
|
6959
|
-
"cloth",
|
|
6960
|
-
"shoe",
|
|
6961
|
-
"jar",
|
|
6962
|
-
"paper",
|
|
6963
|
-
"fruit",
|
|
6964
|
-
"cup",
|
|
6965
|
-
"tube",
|
|
6966
|
-
"blade",
|
|
6967
|
-
"long_tool",
|
|
6968
|
-
"garment",
|
|
6969
|
-
"backpack",
|
|
6970
|
-
"jerrycan",
|
|
6971
|
-
"tank",
|
|
6972
|
-
"book",
|
|
6973
|
-
"key",
|
|
6974
|
-
"battery",
|
|
6975
|
-
"plank",
|
|
6976
|
-
"device"
|
|
6977
|
-
];
|
|
6978
|
-
var DEFAULT_COLOR = 9080724;
|
|
6979
|
-
var PI = Math.PI;
|
|
6980
|
-
function shade(color, factor) {
|
|
6981
|
-
const channel = (shift) => Math.max(0, Math.min(255, Math.round((color >> shift & 255) * factor)));
|
|
6982
|
-
return channel(16) << 16 | channel(8) << 8 | channel(0);
|
|
6983
|
-
}
|
|
6984
|
-
var PROUD = 2e-3;
|
|
6985
|
-
var seg = (c, n) => Math.max(5, Math.round(n * c.detail));
|
|
6986
|
-
function canonicalFrame(size) {
|
|
6987
|
-
const [w, h, d] = size;
|
|
6988
|
-
if (h >= w && h >= d) return { axis: 1, L: h, a: w, b: d };
|
|
6989
|
-
if (d >= w && d >= h) return { axis: 2, L: d, a: h, b: w };
|
|
6990
|
-
return { axis: 0, L: w, a: h, b: d };
|
|
6991
|
-
}
|
|
6992
|
-
function orient(c, group, axis) {
|
|
6993
|
-
if (axis === 0) return group;
|
|
6994
|
-
const holder = c.k.G(group);
|
|
6995
|
-
if (axis === 1) holder.rotation.z = PI / 2;
|
|
6996
|
-
else holder.rotation.y = -PI / 2;
|
|
6997
|
-
return holder;
|
|
6998
|
-
}
|
|
6999
|
-
var alongLong = (draw) => (c) => {
|
|
7000
|
-
const { axis, L, a, b } = canonicalFrame([c.w, c.h, c.d]);
|
|
7001
|
-
return orient(c, draw(c, L, a, b), axis);
|
|
6645
|
+
// src/models/photo.ts
|
|
6646
|
+
var photo = ({ mesh, bx, G, paper: paper2 }) => {
|
|
6647
|
+
const group = G();
|
|
6648
|
+
group.add(mesh(bx(0.102, 1e-3, 0.152), paper2(15855332), [0, 5e-4, 0]));
|
|
6649
|
+
group.add(mesh(bx(0.088, 1015e-6, 0.115), paper2(8030860), [0, 15275e-7, -0.01]));
|
|
6650
|
+
return group;
|
|
7002
6651
|
};
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
6652
|
+
|
|
6653
|
+
// src/models/portable-generator.ts
|
|
6654
|
+
var portableGenerator = ({ M, mesh, cyl, bx, G, metal, plastic }) => {
|
|
6655
|
+
const quarter = Math.PI / 2;
|
|
6656
|
+
const frame = metal(3816510);
|
|
6657
|
+
const group = G(
|
|
6658
|
+
mesh(bx(0.5, 0.02, 0.02), frame, [0, 0.01, 0.205]),
|
|
6659
|
+
mesh(bx(0.5, 0.02, 0.02), frame, [0, 0.01, -0.205]),
|
|
6660
|
+
mesh(bx(0.016, 0.016, 0.426), frame, [0.24, 0.01, 0]),
|
|
6661
|
+
mesh(bx(0.016, 0.016, 0.426), frame, [-0.24, 0.01, 0]),
|
|
6662
|
+
mesh(bx(0.5, 0.02, 0.02), frame, [0, 0.41, 0.205]),
|
|
6663
|
+
mesh(bx(0.5, 0.02, 0.02), frame, [0, 0.41, -0.205]),
|
|
6664
|
+
mesh(bx(0.016, 0.016, 0.426), frame, [0.24, 0.41, 0]),
|
|
6665
|
+
mesh(bx(0.016, 0.016, 0.426), frame, [-0.24, 0.41, 0]),
|
|
6666
|
+
mesh(bx(0.2, 0.2, 0.26), metal(7238003), [-0.12, 0.13, 0]),
|
|
6667
|
+
mesh(cyl(0.11, 0.11, 0.18, 14), metal(4151923), [0.14, 0.15, 0], [0, 0, quarter]),
|
|
6668
|
+
mesh(bx(0.34, 0.1, 0.28), plastic(10235683), [0, 0.35, 0]),
|
|
6669
|
+
mesh(cyl(0.025, 0.025, 0.02, 8), plastic(1842204), [-0.1, 0.41, 0]),
|
|
6670
|
+
mesh(bx(0.2, 0.12, 0.01), plastic(2237478), [0.13, 0.2, 0.21]),
|
|
6671
|
+
mesh(bx(0.04, 0.04, 45e-4), M(7830141, "plastic"), [0.09, 0.2, 0.2162]),
|
|
6672
|
+
mesh(bx(0.04, 0.04, 45e-4), M(7830141, "plastic"), [0.17, 0.2, 0.2162]),
|
|
6673
|
+
mesh(cyl(0.035, 0.035, 0.16, 10), metal(5982780), [-0.12, 0.1, -0.17], [0, 0, quarter])
|
|
6674
|
+
);
|
|
6675
|
+
for (const [x, z] of [[-0.24, -0.205], [0.24, -0.205], [-0.24, 0.205], [0.24, 0.205]]) group.add(mesh(bx(0.012, 0.4, 0.012), frame, [x, 0.21, z]));
|
|
6676
|
+
return group;
|
|
7006
6677
|
};
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
const
|
|
7011
|
-
return
|
|
6678
|
+
|
|
6679
|
+
// src/models/power-bank.ts
|
|
6680
|
+
var powerBank = ({ M, mesh, bx, G, plastic }) => {
|
|
6681
|
+
const led = M(9167776, "plastic", { emissive: 3111493, emissiveIntensity: 0.6 });
|
|
6682
|
+
return G(
|
|
6683
|
+
mesh(bx(0.15, 0.07, 0.0143), plastic(2961720), [0, 0.035, -35e-5]),
|
|
6684
|
+
mesh(bx(0.07, 0.024, 3e-3), plastic(4870232), [-0.025, 0.035, 71e-4]),
|
|
6685
|
+
mesh(bx(0.02, 8e-3, 3e-3), plastic(987154), [0.058, 0.058, 71e-4]),
|
|
6686
|
+
mesh(bx(0.012, 4e-3, 3e-3), led, [0.028, 0.02, 71e-4]),
|
|
6687
|
+
mesh(bx(0.012, 4e-3, 3e-3), led, [0.044, 0.02, 71e-4]),
|
|
6688
|
+
mesh(bx(0.012, 4e-3, 3e-3), led, [0.06, 0.02, 71e-4])
|
|
6689
|
+
);
|
|
7012
6690
|
};
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
const
|
|
7017
|
-
|
|
6691
|
+
|
|
6692
|
+
// src/models/pumpkin-seeds.ts
|
|
6693
|
+
var pumpkinSeeds = ({ mesh, bx, G, paper: paper2 }) => {
|
|
6694
|
+
const width = 0.09;
|
|
6695
|
+
const height = 0.13;
|
|
6696
|
+
const depth = 0.015;
|
|
6697
|
+
const group = G();
|
|
6698
|
+
group.add(mesh(bx(width, height, depth * 0.5), paper2(15261640)));
|
|
6699
|
+
group.add(mesh(bx(width * 0.9, height * 0.85, depth * 0.667), paper2(15722451), [0, -height * 0.03, 0]));
|
|
6700
|
+
group.add(mesh(bx(width * 0.95, height * 0.08, depth * 0.3), paper2(13616296), [0, height * 0.445, 0]));
|
|
6701
|
+
[1, -1].forEach((side) => group.add(mesh(bx(width * 0.7, height * 0.4, depth * 0.3), paper2(14254635), [0, -height * 0.05, side * depth * 0.35])));
|
|
6702
|
+
return group;
|
|
6703
|
+
};
|
|
6704
|
+
|
|
6705
|
+
// src/models/raincoat.ts
|
|
6706
|
+
var raincoat = ({ mesh, bx, cyl, G, plastic, metal }) => {
|
|
6707
|
+
const sheet = plastic(13805852);
|
|
6708
|
+
const trim = plastic(11044122);
|
|
6709
|
+
return G(
|
|
6710
|
+
mesh(bx(0.2, 0.03, 0.25), sheet, [0, 0.015, 0]),
|
|
6711
|
+
mesh(bx(0.05, 0.026, 0.17), sheet, [-0.125, 0.013, -0.04]),
|
|
6712
|
+
mesh(bx(0.05, 0.026, 0.17), sheet, [0.125, 0.013, -0.04]),
|
|
6713
|
+
mesh(bx(0.05, 0.03, 0.012), trim, [-0.125, 0.015, 0.05]),
|
|
6714
|
+
mesh(bx(0.05, 0.03, 0.012), trim, [0.125, 0.015, 0.05]),
|
|
6715
|
+
mesh(cyl(0.055, 0.055, 0.01, 12), trim, [0, 0.035, -0.07]),
|
|
6716
|
+
mesh(bx(0.014, 0.0113, 0.17), trim, [0, 0.03215, 0.04]),
|
|
6717
|
+
mesh(cyl(6e-3, 6e-3, 0.012, 6), metal(9080208), [0, 0.034, 0]),
|
|
6718
|
+
mesh(cyl(6e-3, 6e-3, 0.012, 6), metal(9080208), [0, 0.034, 0.06])
|
|
6719
|
+
);
|
|
6720
|
+
};
|
|
6721
|
+
|
|
6722
|
+
// src/models/road-map.ts
|
|
6723
|
+
var roadMap = ({ mesh, bx, G, paper: paper2 }) => {
|
|
6724
|
+
const group = G();
|
|
6725
|
+
group.add(mesh(bx(0.11, 3e-3, 0.25), paper2(5208714), [0, 15e-4, 0]));
|
|
6726
|
+
group.add(mesh(bx(0.108, 4e-3, 0.24), paper2(14998722), [0, 5e-3, 0]));
|
|
6727
|
+
group.add(mesh(bx(0.11, 3e-3, 0.18), paper2(5208714), [0, 85e-4, 0.035]));
|
|
6728
|
+
group.add(mesh(bx(0.11, 3e-3, 0.07), paper2(14727216), [0, 85e-4, -0.09]));
|
|
6729
|
+
return group;
|
|
6730
|
+
};
|
|
6731
|
+
|
|
6732
|
+
// src/models/rolling-suitcase.ts
|
|
6733
|
+
var rollingSuitcase = ({ mesh, cyl, bx, G, plastic }) => {
|
|
6734
|
+
const shell = plastic(4016732);
|
|
6735
|
+
const trim = plastic(2040358);
|
|
6736
|
+
const parts = [
|
|
6737
|
+
mesh(bx(0.4, 0.55, 0.236), shell, [0, 0.325, 0]),
|
|
6738
|
+
mesh(bx(0.012, 0.5, 0.25), trim, [-0.1, 0.325, 0]),
|
|
6739
|
+
mesh(bx(0.012, 0.5, 0.25), trim, [0.1, 0.325, 0]),
|
|
6740
|
+
mesh(bx(0.012, 0.04, 0.012), trim, [-0.06, 0.62, 0]),
|
|
6741
|
+
mesh(bx(0.012, 0.04, 0.012), trim, [0.06, 0.62, 0]),
|
|
6742
|
+
mesh(bx(0.15, 0.02, 0.03), trim, [0, 0.64, 0]),
|
|
6743
|
+
mesh(bx(0.12, 0.03, 0.04), trim, [0, 0.55, -0.1])
|
|
6744
|
+
];
|
|
6745
|
+
for (const x of [-0.15, 0.15]) for (const z of [-0.09, 0.09]) parts.push(mesh(cyl(0.025, 0.025, 0.02, 8), trim, [x, 0.025, z], [0, 0, Math.PI / 2]));
|
|
6746
|
+
return G(...parts);
|
|
6747
|
+
};
|
|
6748
|
+
|
|
6749
|
+
// src/models/rubber-boots.ts
|
|
6750
|
+
var rubberBoots = ({ mesh, bx, cyl, G, plastic }) => {
|
|
6751
|
+
const rubber = plastic(4020794);
|
|
6752
|
+
const sole = plastic(1907997);
|
|
6753
|
+
const rim = plastic(3099182);
|
|
6754
|
+
const boot = (z) => [
|
|
6755
|
+
mesh(bx(0.3, 0.025, 0.105), sole, [0, 0.0125, z]),
|
|
6756
|
+
mesh(bx(0.07, 0.03, 0.105), sole, [-0.115, 0.04, z]),
|
|
6757
|
+
mesh(bx(0.2, 0.06, 0.1), rubber, [0.04, 0.055, z]),
|
|
6758
|
+
mesh(cyl(0.046, 0.046, 0.06, 8), rubber, [0.1, 0.06, z]),
|
|
6759
|
+
mesh(cyl(0.048, 0.0495, 0.3175, 10), rubber, [-0.085, 0.18625, z]),
|
|
6760
|
+
mesh(cyl(0.054, 0.054, 0.015, 10), rim, [-0.085, 0.3425, z])
|
|
6761
|
+
];
|
|
6762
|
+
return G(...boot(-0.0575), ...boot(0.0575));
|
|
7018
6763
|
};
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
6764
|
+
|
|
6765
|
+
// src/models/safe-key.ts
|
|
6766
|
+
var safeKey = ({ mesh, bx, G, metal }) => {
|
|
6767
|
+
const brass = metal(11569710);
|
|
6768
|
+
const parts = [
|
|
6769
|
+
mesh(bx(0.046, 0.01, 5e-3), brass, [0.012, 0.0125, 0]),
|
|
6770
|
+
mesh(bx(4e-3, 0.016, 5e-3), brass, [-0.01, 0.0125, 0]),
|
|
6771
|
+
mesh(bx(6e-3, 4e-3, 5e-3), brass, [0, 55e-4, 0]),
|
|
6772
|
+
mesh(bx(6e-3, 4e-3, 5e-3), brass, [0.01, 55e-4, 0]),
|
|
6773
|
+
mesh(bx(6e-3, 4e-3, 5e-3), brass, [0.02, 55e-4, 0]),
|
|
6774
|
+
mesh(bx(6e-3, 4e-3, 5e-3), brass, [0.0315, 55e-4, 0]),
|
|
6775
|
+
mesh(bx(6e-3, 4e-3, 5e-3), brass, [0, 0.0195, 0]),
|
|
6776
|
+
mesh(bx(6e-3, 4e-3, 5e-3), brass, [0.015, 0.0195, 0])
|
|
6777
|
+
];
|
|
6778
|
+
const segments = 8;
|
|
6779
|
+
for (let index = 0; index < segments; index++) {
|
|
6780
|
+
const angle = 2 * Math.PI * index / segments;
|
|
6781
|
+
parts.push(mesh(bx(66e-4, 45e-4, 5e-3), brass, [-0.0225 + 0.0102 * Math.cos(angle), 0.0125 + 0.0102 * Math.sin(angle), 0], [0, 0, angle + Math.PI / 2]));
|
|
6782
|
+
}
|
|
6783
|
+
return G(...parts);
|
|
7022
6784
|
};
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
|
|
6785
|
+
|
|
6786
|
+
// src/models/safety-goggles.ts
|
|
6787
|
+
var safetyGoggles = ({ mesh, bx, cyl, G, plastic, glass, cloth: cloth2 }) => {
|
|
6788
|
+
const frame = plastic(3100527);
|
|
6789
|
+
const lens = glass(13625072, 0.45);
|
|
6790
|
+
const band = cloth2(2040614);
|
|
6791
|
+
const cup2 = (x) => [
|
|
6792
|
+
mesh(cyl(0.03, 0.03, 0.02, 10), frame, [x, 0.03, 0.027], [Math.PI / 2, 0, 0]),
|
|
6793
|
+
mesh(cyl(0.024, 0.024, 6e-3, 10), lens, [x, 0.03, 0.037], [Math.PI / 2, 0, 0])
|
|
6794
|
+
];
|
|
6795
|
+
return G(
|
|
6796
|
+
...cup2(-0.04),
|
|
6797
|
+
...cup2(0.04),
|
|
6798
|
+
mesh(bx(0.03, 0.012, 0.02), frame, [0, 0.036, 0.027]),
|
|
6799
|
+
mesh(bx(6e-3, 0.03, 0.05), band, [-0.077, 0.03, 0]),
|
|
6800
|
+
mesh(bx(6e-3, 0.03, 0.05), band, [0.077, 0.03, 0]),
|
|
6801
|
+
mesh(bx(0.16, 0.03, 6e-3), band, [0, 0.03, -0.037])
|
|
6802
|
+
);
|
|
7026
6803
|
};
|
|
7027
|
-
|
|
7028
|
-
|
|
7029
|
-
|
|
6804
|
+
|
|
6805
|
+
// src/models/sheet-metal-forearm-guard.ts
|
|
6806
|
+
var sheetMetalForearmGuard = ({ mesh, bx, G, metal, cloth: cloth2 }) => {
|
|
6807
|
+
const sheet = metal(8225158);
|
|
6808
|
+
const strap = cloth2(4864554);
|
|
6809
|
+
const rivet = metal(11909307);
|
|
6810
|
+
const parts = [];
|
|
6811
|
+
const count = 7;
|
|
6812
|
+
const radiusZ = 0.0524;
|
|
6813
|
+
const radiusY = 0.0955;
|
|
6814
|
+
const phiMax = 1.3;
|
|
6815
|
+
for (let index = 0; index < count; index++) {
|
|
6816
|
+
const phi = -phiMax + 2 * phiMax * index / (count - 1);
|
|
6817
|
+
const y = 0.0455 + radiusY * (Math.cos(phi) - Math.cos(phiMax));
|
|
6818
|
+
const z = radiusZ * Math.sin(phi);
|
|
6819
|
+
const speed = Math.hypot(radiusY * Math.sin(phi), radiusZ * Math.cos(phi));
|
|
6820
|
+
const angle = Math.atan2(radiusY * Math.sin(phi), radiusZ * Math.cos(phi));
|
|
6821
|
+
const length = speed * (2 * phiMax) / (count - 1) * 1.1;
|
|
6822
|
+
parts.push(mesh(bx(0.3, 6e-3, length), sheet, [0, y, z], [angle, 0, 0]));
|
|
6823
|
+
for (const x of [-0.09, 0.09]) parts.push(mesh(bx(0.03, 6e-3, length), strap, [x, y + 3e-3 * Math.cos(angle), z + 3e-3 * Math.sin(angle)], [angle, 0, 0]));
|
|
6824
|
+
}
|
|
6825
|
+
parts.push(mesh(bx(0.012, 0.012, 0.012), rivet, [0.09, 0.0985, 0]), mesh(bx(0.012, 0.012, 0.012), rivet, [-0.09, 0.0985, 0]));
|
|
6826
|
+
return G(...parts);
|
|
7030
6827
|
};
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
|
|
6828
|
+
|
|
6829
|
+
// src/models/shopping-bag.ts
|
|
6830
|
+
var shoppingBag = ({ mesh, bx, G, cloth: cloth2 }) => {
|
|
6831
|
+
const body = cloth2(4942426);
|
|
6832
|
+
const trim = cloth2(3099196);
|
|
6833
|
+
return G(
|
|
6834
|
+
mesh(bx(0.3, 8e-3, 0.2), body, [0, 4e-3, 0]),
|
|
6835
|
+
mesh(bx(0.2, 8e-3, 0.12), trim, [0, 0.012, 0]),
|
|
6836
|
+
mesh(bx(0.1, 4e-3, 0.012), trim, [0, 0.018, -0.05]),
|
|
6837
|
+
mesh(bx(0.1, 4e-3, 0.012), trim, [0, 0.018, 0.05])
|
|
6838
|
+
);
|
|
7035
6839
|
};
|
|
7036
|
-
|
|
7037
|
-
|
|
7038
|
-
|
|
7039
|
-
|
|
6840
|
+
|
|
6841
|
+
// src/models/shopping-cart.ts
|
|
6842
|
+
var shoppingCart = ({ mesh, cyl, bx, G, metal, plastic }) => {
|
|
6843
|
+
const wire = metal(11843514);
|
|
6844
|
+
const grip = plastic(2763822);
|
|
6845
|
+
const group = G();
|
|
6846
|
+
const add = (...parts) => parts.forEach((part) => group.add(part));
|
|
6847
|
+
add(mesh(bx(0.5, 0.012, 0.8), wire, [0, 0.38, 0]), mesh(bx(0.55, 0.03, 0.03), grip, [0, 0.965, -0.46]));
|
|
6848
|
+
for (const side of [-1, 1]) {
|
|
6849
|
+
add(mesh(bx(0.012, 0.012, 0.8), wire, [side * 0.25, 0.75, 0]), mesh(bx(0.012, 0.012, 0.8), wire, [side * 0.25, 0.56, 0]));
|
|
6850
|
+
add(mesh(bx(0.012, 0.012, 0.95), wire, [side * 0.22, 0.14, 0]), mesh(bx(0.02, 0.6, 0.02), wire, [side * 0.26, 0.66, -0.46]));
|
|
6851
|
+
for (const z of [-0.4, 0.4]) add(mesh(bx(0.012, 0.37, 0.012), wire, [side * 0.25, 0.565, z]));
|
|
6852
|
+
add(mesh(bx(8e-3, 0.25, 8e-3), wire, [side * 0.22, 0.265, -0.3]), mesh(bx(8e-3, 0.25, 8e-3), wire, [side * 0.22, 0.265, 0.3]));
|
|
6853
|
+
for (const z of [-0.3, 0.4]) add(mesh(cyl(0.06, 0.06, 0.03, 8), grip, [side * 0.25, 0.06, z], [0, 0, Math.PI / 2]));
|
|
6854
|
+
}
|
|
6855
|
+
add(mesh(bx(0.5, 0.012, 0.012), wire, [0, 0.75, 0.4]), mesh(bx(0.5, 0.012, 0.012), wire, [0, 0.56, 0.4]));
|
|
6856
|
+
add(mesh(bx(0.5, 0.012, 0.012), wire, [0, 0.75, -0.4]), mesh(bx(0.5, 0.012, 0.012), wire, [0, 0.56, -0.4]));
|
|
6857
|
+
for (const x of [-0.125, 0.125]) add(mesh(bx(0.012, 0.016, 0.8), wire, [x, 0.38, 0]));
|
|
6858
|
+
add(mesh(bx(0.44, 0.012, 0.012), wire, [0, 0.14, -0.3]), mesh(bx(0.44, 0.012, 0.012), wire, [0, 0.14, 0.3]));
|
|
6859
|
+
return group;
|
|
7040
6860
|
};
|
|
7041
|
-
|
|
7042
|
-
|
|
7043
|
-
|
|
7044
|
-
|
|
6861
|
+
|
|
6862
|
+
// src/models/skill-book.ts
|
|
6863
|
+
var skillBook = ({ mesh, bx, G, paper: paper2, cloth: cloth2 }) => {
|
|
6864
|
+
const cover = cloth2(7028518);
|
|
6865
|
+
const trim = paper2(13214810);
|
|
6866
|
+
return G(
|
|
6867
|
+
mesh(bx(0.154, 0.224, 0.033), paper2(14998726), [5e-4, 0.115, 0]),
|
|
6868
|
+
mesh(bx(0.154, 0.23, 34e-4), cover, [3e-3, 0.115, 0.0158]),
|
|
6869
|
+
mesh(bx(0.154, 0.23, 34e-4), cover, [3e-3, 0.115, -0.0158]),
|
|
6870
|
+
mesh(bx(6e-3, 0.23, 0.04), cover, [-0.077, 0.115, 0]),
|
|
6871
|
+
mesh(bx(6e-3, 0.01, 0.036), trim, [-0.0785, 0.2, 0]),
|
|
6872
|
+
mesh(bx(6e-3, 0.01, 0.036), trim, [-0.0785, 0.03, 0]),
|
|
6873
|
+
mesh(bx(0.09, 0.05, 32e-4), trim, [5e-3, 0.17, 0.0181]),
|
|
6874
|
+
mesh(bx(0.06, 6e-3, 32e-4), trim, [5e-3, 0.06, 0.0181])
|
|
6875
|
+
);
|
|
7045
6876
|
};
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
|
|
6877
|
+
|
|
6878
|
+
// src/models/snare-trap.ts
|
|
6879
|
+
var snareTrap = ({ mesh, torus, bx, G, metal, wood }) => {
|
|
6880
|
+
const group = G();
|
|
6881
|
+
group.add(mesh(torus(0.067, 8e-3), metal(9277590), [0, 0.015, 0], [Math.PI / 2, 0, 0]));
|
|
6882
|
+
group.add(mesh(bx(0.02, 0.03, 0.02), wood(8018490), [0.065, 0.015, 0]));
|
|
6883
|
+
group.add(mesh(bx(0.02, 0.02, 0.02), metal(7106421), [0, 0.015, 0.065]));
|
|
6884
|
+
group.add(mesh(bx(6e-3, 6e-3, 0.03), wood(10519904), [0, 0.01, -0.06]));
|
|
6885
|
+
return group;
|
|
7049
6886
|
};
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
|
-
|
|
7053
|
-
|
|
6887
|
+
|
|
6888
|
+
// src/models/sneakers.ts
|
|
6889
|
+
var sneakers = ({ mesh, bx, cyl, G, cloth: cloth2, plastic }) => {
|
|
6890
|
+
const upper = cloth2(5922920);
|
|
6891
|
+
const sole = plastic(15263972);
|
|
6892
|
+
const accent = cloth2(3043192);
|
|
6893
|
+
const lace = cloth2(15790314);
|
|
6894
|
+
return G(
|
|
6895
|
+
mesh(bx(0.25, 0.022, 0.12), sole, [-0.025, 0.011, 0]),
|
|
6896
|
+
mesh(cyl(0.06, 0.06, 0.018, 10), sole, [0.09, 0.011, 0]),
|
|
6897
|
+
mesh(bx(0.11, 0.09, 0.11), upper, [-0.095, 0.067, 0]),
|
|
6898
|
+
mesh(bx(0.12, 0.052, 0.106), upper, [0, 0.046, 0]),
|
|
6899
|
+
mesh(cyl(0.055, 0.055, 0.046, 10), upper, [0.095, 0.041, 0]),
|
|
6900
|
+
mesh(bx(0.03, 0.05, 0.08), accent, [-0.03, 0.095, 0]),
|
|
6901
|
+
mesh(bx(0.1, 0.03, 6e-3), accent, [-0.05, 0.05, 0.056]),
|
|
6902
|
+
mesh(bx(0.1, 0.03, 6e-3), accent, [-0.05, 0.05, -0.056]),
|
|
6903
|
+
mesh(bx(8e-3, 4e-3, 0.09), lace, [0, 0.074, 0]),
|
|
6904
|
+
mesh(bx(8e-3, 4e-3, 0.09), lace, [0.03, 0.074, 0]),
|
|
6905
|
+
mesh(bx(8e-3, 4e-3, 0.08), lace, [0.06, 0.066, 0])
|
|
6906
|
+
);
|
|
7054
6907
|
};
|
|
7055
|
-
|
|
7056
|
-
|
|
7057
|
-
|
|
7058
|
-
|
|
6908
|
+
|
|
6909
|
+
// src/models/tactical-vest.ts
|
|
6910
|
+
var tacticalVest = ({ mesh, bx, G, cloth: cloth2, plastic }) => {
|
|
6911
|
+
const shell = cloth2(4870710);
|
|
6912
|
+
const pouch = cloth2(3883561);
|
|
6913
|
+
const buckle = plastic(1974304);
|
|
6914
|
+
return G(
|
|
6915
|
+
mesh(bx(0.35, 0.03, 0.28), shell, [0, 0.015, 0.06]),
|
|
6916
|
+
mesh(bx(0.09, 0.03, 0.12), shell, [-0.13, 0.015, -0.14]),
|
|
6917
|
+
mesh(bx(0.09, 0.03, 0.12), shell, [0.13, 0.015, -0.14]),
|
|
6918
|
+
mesh(bx(0.09, 0.07, 0.05), pouch, [-0.11, 0.065, 0.165]),
|
|
6919
|
+
mesh(bx(0.09, 0.07, 0.05), pouch, [0, 0.065, 0.165]),
|
|
6920
|
+
mesh(bx(0.09, 0.07, 0.05), pouch, [0.11, 0.065, 0.165]),
|
|
6921
|
+
mesh(bx(0.07, 0.05, 0.07), pouch, [-0.13, 0.055, 0.07]),
|
|
6922
|
+
mesh(bx(0.07, 0.05, 0.07), pouch, [0.13, 0.055, 0.07]),
|
|
6923
|
+
mesh(bx(0.03, 0.02, 0.02), buckle, [0, 0.04, 0])
|
|
6924
|
+
);
|
|
7059
6925
|
};
|
|
7060
|
-
|
|
7061
|
-
|
|
7062
|
-
|
|
7063
|
-
|
|
7064
|
-
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
|
|
6926
|
+
|
|
6927
|
+
// src/models/technical-manual.ts
|
|
6928
|
+
var technicalManual = ({ mesh, bx, G, paper: paper2, plastic }) => {
|
|
6929
|
+
const binder = plastic(3096402);
|
|
6930
|
+
const label = paper2(14998726);
|
|
6931
|
+
return G(
|
|
6932
|
+
mesh(bx(0.196, 0.292, 0.029), paper2(14998726), [2e-3, 0.15, 0]),
|
|
6933
|
+
mesh(bx(0.198, 0.3, 3e-3), binder, [6e-3, 0.15, 0.016]),
|
|
6934
|
+
mesh(bx(0.198, 0.3, 3e-3), binder, [6e-3, 0.15, -0.016]),
|
|
6935
|
+
mesh(bx(0.012, 0.3, 0.0385), binder, [-0.099, 0.15, -75e-5]),
|
|
6936
|
+
mesh(bx(6e-3, 0.18, 3e-3), label, [-0.0995, 0.15, 0.019]),
|
|
6937
|
+
mesh(bx(0.12, 0.05, 4e-3), label, [0.01, 0.23, 0.0185]),
|
|
6938
|
+
mesh(bx(0.12, 4e-3, 4e-3), plastic(11843514), [0.01, 0.17, 0.0185])
|
|
6939
|
+
);
|
|
7072
6940
|
};
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7076
|
-
|
|
6941
|
+
|
|
6942
|
+
// src/models/tool-belt.ts
|
|
6943
|
+
var toolBelt = ({ mesh, bx, G, cloth: cloth2, metal }) => {
|
|
6944
|
+
const leather = cloth2(7031343);
|
|
6945
|
+
const pouch = cloth2(5191714);
|
|
6946
|
+
return G(
|
|
6947
|
+
mesh(bx(0.35, 0.04, 0.02), leather, [0, 0.05, 0.105]),
|
|
6948
|
+
mesh(bx(0.35, 0.04, 0.02), leather, [0, 0.05, -0.115]),
|
|
6949
|
+
mesh(bx(0.016, 0.036, 0.218), leather, [-0.165, 0.05, -6e-3]),
|
|
6950
|
+
mesh(bx(0.016, 0.036, 0.218), leather, [0.165, 0.05, -6e-3]),
|
|
6951
|
+
mesh(bx(0.08, 0.1, 0.04), pouch, [-0.1, 0.05, 0.105]),
|
|
6952
|
+
mesh(bx(0.08, 0.08, 0.04), pouch, [0.1, 0.04, 0.105]),
|
|
6953
|
+
mesh(bx(0.04, 0.09, 0.08), pouch, [-0.155, 0.045, -0.02]),
|
|
6954
|
+
mesh(bx(0.02, 0.08, 0.02), pouch, [0.145, 0.04, -0.09]),
|
|
6955
|
+
mesh(bx(0.04, 0.035, 0.012), metal(11580085), [0, 0.05, 0.119])
|
|
6956
|
+
);
|
|
7077
6957
|
};
|
|
7078
|
-
|
|
7079
|
-
|
|
7080
|
-
|
|
7081
|
-
|
|
7082
|
-
|
|
7083
|
-
|
|
7084
|
-
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
var blade = alongLong((c, L, a, b) => {
|
|
7089
|
-
const { k } = c;
|
|
7090
|
-
const edge = Math.min(2e-4, b * 0.05);
|
|
7091
|
-
const steel = k.extrude([[0, 0], [L * 0.66, 0], [L * 0.68, a * 0.4], [0, a]], Math.max(5e-4, b * 0.4 - 2 * edge), edge);
|
|
7092
|
-
return k.G(k.mesh(steel, k.metal(11120048), [-L * 0.18, -a / 2, -b * 0.2 + edge]), k.mesh(k.bx(L * 0.34, a * 0.6, b), k.wood(3877408), [-L * 0.33, 0, 0]));
|
|
7093
|
-
});
|
|
7094
|
-
var garment = (c) => {
|
|
7095
|
-
const { k, w, h, d } = c;
|
|
7096
|
-
const material = k.cloth(c.color);
|
|
7097
|
-
return k.G(k.mesh(k.bx(w * 0.56, h, d), material), k.mesh(k.bx(w * 0.22, h * 0.42, d * 0.9), material, [-w * 0.39, h * 0.29, 0]), k.mesh(k.bx(w * 0.22, h * 0.42, d * 0.9), material, [w * 0.39, h * 0.29, 0]));
|
|
6958
|
+
|
|
6959
|
+
// src/models/trash-bag.ts
|
|
6960
|
+
var trashBag = ({ mesh, bx, G, plastic }) => {
|
|
6961
|
+
const film = plastic(1842463);
|
|
6962
|
+
return G(
|
|
6963
|
+
mesh(bx(0.2, 0.02, 0.2), film, [-0.025, 0.01, 0]),
|
|
6964
|
+
mesh(bx(0.2, 5e-3, 0.02), film, [-0.025, 0.0225, 0]),
|
|
6965
|
+
mesh(bx(0.05, 0.012, 0.08), film, [0.1, 6e-3, 0]),
|
|
6966
|
+
mesh(bx(0.028, 0.023, 0.04), film, [0.109, 0.0135, 0])
|
|
6967
|
+
);
|
|
7098
6968
|
};
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
const
|
|
7103
|
-
const
|
|
7104
|
-
return
|
|
6969
|
+
|
|
6970
|
+
// src/models/trekking-backpack-70l.ts
|
|
6971
|
+
var trekkingBackpack70L = ({ mesh, bx, G, cloth: cloth2, plastic }) => {
|
|
6972
|
+
const main = cloth2(6116928);
|
|
6973
|
+
const dark = cloth2(3091234);
|
|
6974
|
+
return G(
|
|
6975
|
+
mesh(bx(0.34, 0.2, 0.2), dark, [0, 0.1, -0.03]),
|
|
6976
|
+
mesh(bx(0.36, 0.49, 0.2), main, [0, 0.445, -0.03]),
|
|
6977
|
+
mesh(bx(0.38, 0.06, 0.26), dark, [0, 0.72, -0.02]),
|
|
6978
|
+
mesh(bx(0.28, 0.3, 0.0765), main, [0, 0.35, 0.10825]),
|
|
6979
|
+
mesh(bx(0.06, 0.45, 0.02), dark, [-0.1, 0.45, -0.14]),
|
|
6980
|
+
mesh(bx(0.06, 0.45, 0.02), dark, [0.1, 0.45, -0.14]),
|
|
6981
|
+
mesh(bx(0.38, 0.03, 0.0185), dark, [0, 0.3, 0.13925]),
|
|
6982
|
+
mesh(bx(0.05, 0.026, 0.0155), plastic(1842463), [0, 0.3, 0.14275])
|
|
6983
|
+
);
|
|
7105
6984
|
};
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
6985
|
+
|
|
6986
|
+
// src/models/tshirt.ts
|
|
6987
|
+
var tshirt = ({ mesh, bx, G, cloth: cloth2 }) => {
|
|
6988
|
+
const fabric = cloth2(9080724);
|
|
6989
|
+
const rib = cloth2(7304056);
|
|
6990
|
+
const inside = cloth2(2829616);
|
|
6991
|
+
return G(
|
|
6992
|
+
mesh(bx(0.21, 0.0352, 0.22), fabric, [0, 0.0176, 0]),
|
|
6993
|
+
mesh(bx(0.045, 0.03, 0.08), fabric, [-0.1275, 0.015, -0.07]),
|
|
6994
|
+
mesh(bx(0.045, 0.03, 0.08), fabric, [0.1275, 0.015, -0.07]),
|
|
6995
|
+
mesh(bx(0.045, 0.034, 0.012), rib, [-0.1275, 0.017, -0.024]),
|
|
6996
|
+
mesh(bx(0.045, 0.034, 0.012), rib, [0.1275, 0.017, -0.024]),
|
|
6997
|
+
mesh(bx(0.07, 0.0356, 0.022), inside, [0, 0.0198, -0.097]),
|
|
6998
|
+
mesh(bx(0.09, 0.0358, 0.012), rib, [0, 0.0219, -0.1])
|
|
6999
|
+
);
|
|
7110
7000
|
};
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
const
|
|
7115
|
-
const
|
|
7116
|
-
|
|
7001
|
+
|
|
7002
|
+
// src/models/watering-can.ts
|
|
7003
|
+
var wateringCan = ({ mesh, cyl, bx, G, metal }) => {
|
|
7004
|
+
const zinc = metal(8358799);
|
|
7005
|
+
const group = G();
|
|
7006
|
+
group.add(mesh(cyl(0.09, 0.09, 0.2, 16), zinc, [-0.06, 0.1, 0]));
|
|
7007
|
+
group.add(mesh(cyl(0.07, 0.07, 4e-3, 16), metal(4936278), [-0.06, 0.2, 0]));
|
|
7008
|
+
group.add(mesh(cyl(0.012, 0.02, 0.22, 8), zinc, [0.1194, 0.115, 0], [0, 0, -0.85]));
|
|
7009
|
+
group.add(mesh(cyl(0.035, 0.022, 0.02, 12), zinc, [0.2094, 0.225, 0], [0, 0, -0.85]));
|
|
7010
|
+
group.add(mesh(bx(0.01, 0.16, 0.02), zinc, [-0.155, 0.12, 0]));
|
|
7011
|
+
group.add(mesh(bx(0.05, 0.01, 0.02), zinc, [-0.135, 0.2, 0]));
|
|
7012
|
+
group.add(mesh(bx(0.05, 0.01, 0.02), zinc, [-0.135, 0.04, 0]));
|
|
7013
|
+
return group;
|
|
7117
7014
|
};
|
|
7118
|
-
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7015
|
+
|
|
7016
|
+
// src/models/wheelbarrow.ts
|
|
7017
|
+
var wheelbarrow = ({ mesh, cyl, bx, G, metal, plastic }) => {
|
|
7018
|
+
const tub = metal(3104058);
|
|
7019
|
+
const frame = metal(3816768);
|
|
7020
|
+
const tire = plastic(1908256);
|
|
7021
|
+
const tilt = 0.42;
|
|
7022
|
+
return G(
|
|
7023
|
+
mesh(bx(0.4, 0.02, 0.5), tub, [0, 0.38, 0.2]),
|
|
7024
|
+
mesh(bx(0.02, 0.29, 0.62), tub, [-0.255, 0.515, 0.2], [0, 0, tilt]),
|
|
7025
|
+
mesh(bx(0.02, 0.29, 0.62), tub, [0.255, 0.515, 0.2], [0, 0, -tilt]),
|
|
7026
|
+
mesh(bx(0.5, 0.29, 0.02), tub, [0, 0.515, 0.5], [0.5, 0, 0]),
|
|
7027
|
+
mesh(bx(0.5, 0.29, 0.02), tub, [0, 0.515, -0.1], [-0.5, 0, 0]),
|
|
7028
|
+
mesh(bx(0.03, 0.03, 1.28), frame, [-0.2, 0.33, -0.09]),
|
|
7029
|
+
mesh(bx(0.03, 0.03, 1.28), frame, [0.2, 0.33, -0.09]),
|
|
7030
|
+
mesh(cyl(0.02, 0.02, 0.3, 6), plastic(7031343), [-0.2, 0.33, -0.6], [Math.PI / 2, 0, 0]),
|
|
7031
|
+
mesh(cyl(0.02, 0.02, 0.3, 6), plastic(7031343), [0.2, 0.33, -0.6], [Math.PI / 2, 0, 0]),
|
|
7032
|
+
mesh(bx(0.03, 0.31, 0.03), frame, [-0.2, 0.155, -0.35]),
|
|
7033
|
+
mesh(bx(0.03, 0.31, 0.03), frame, [0.2, 0.155, -0.35]),
|
|
7034
|
+
mesh(bx(0.02, 0.15, 0.02), frame, [-0.05, 0.27, 0.55]),
|
|
7035
|
+
mesh(bx(0.02, 0.15, 0.02), frame, [0.05, 0.27, 0.55]),
|
|
7036
|
+
mesh(cyl(0.2, 0.2, 0.06, 12), tire, [0, 0.2, 0.55], [0, 0, Math.PI / 2])
|
|
7037
|
+
);
|
|
7122
7038
|
};
|
|
7123
|
-
|
|
7124
|
-
|
|
7125
|
-
|
|
7126
|
-
const
|
|
7127
|
-
const
|
|
7128
|
-
|
|
7129
|
-
|
|
7130
|
-
|
|
7131
|
-
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
|
|
7137
|
-
|
|
7138
|
-
|
|
7139
|
-
|
|
7140
|
-
|
|
7141
|
-
|
|
7142
|
-
|
|
7143
|
-
|
|
7039
|
+
|
|
7040
|
+
// src/models/windup-alarm-clock.ts
|
|
7041
|
+
var windupAlarmClock = ({ M, mesh, cyl, bx, G, metal, plastic }) => {
|
|
7042
|
+
const steel = metal(10987947);
|
|
7043
|
+
const bell = metal(8290435);
|
|
7044
|
+
const quarter = Math.PI / 2;
|
|
7045
|
+
return G(
|
|
7046
|
+
mesh(cyl(0.0475, 0.0475, 0.048, 18), steel, [0, 0.0575, 0], [quarter, 0, 0]),
|
|
7047
|
+
mesh(cyl(0.04, 0.04, 2e-3, 18), plastic(15262415), [0, 0.0575, 0.025], [quarter, 0, 0]),
|
|
7048
|
+
mesh(bx(3e-3, 0.026, 15e-4), plastic(1842204), [0, 0.07, 0.0255]),
|
|
7049
|
+
mesh(bx(3e-3, 0.018, 15e-4), plastic(1842204), [8e-3, 0.0575, 0.0255], [0, 0, -quarter]),
|
|
7050
|
+
mesh(cyl(5e-3, 8e-3, 0.014, 6), steel, [-0.03, 7e-3, 0]),
|
|
7051
|
+
mesh(cyl(5e-3, 8e-3, 0.014, 6), steel, [0.03, 7e-3, 0]),
|
|
7052
|
+
mesh(cyl(8e-3, 0.0215, 0.016, 10), bell, [-0.034, 0.105, 0]),
|
|
7053
|
+
mesh(cyl(8e-3, 0.0215, 0.016, 10), bell, [0.034, 0.105, 0]),
|
|
7054
|
+
mesh(cyl(2e-3, 2e-3, 0.01, 6), steel, [-0.026, 0.118, 0]),
|
|
7055
|
+
mesh(cyl(2e-3, 2e-3, 0.01, 6), steel, [0.026, 0.118, 0]),
|
|
7056
|
+
mesh(bx(0.052, 4e-3, 4e-3), steel, [0, 0.123, 0]),
|
|
7057
|
+
mesh(cyl(3e-3, 3e-3, 7e-3, 6), steel, [0, 0.0575, -0.0255], [quarter, 0, 0]),
|
|
7058
|
+
mesh(bx(0.022, 8e-3, 3e-3), M(10987947, "metal", { metalness: 0.55, roughness: 0.45 }), [0, 0.0575, -0.0275])
|
|
7059
|
+
);
|
|
7144
7060
|
};
|
|
7145
|
-
|
|
7146
|
-
|
|
7147
|
-
|
|
7148
|
-
|
|
7149
|
-
|
|
7150
|
-
|
|
7151
|
-
|
|
7152
|
-
|
|
7153
|
-
|
|
7154
|
-
|
|
7155
|
-
|
|
7156
|
-
|
|
7157
|
-
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
|
|
7161
|
-
|
|
7162
|
-
|
|
7061
|
+
|
|
7062
|
+
// src/models/shipped.ts
|
|
7063
|
+
var BUILDERS = {
|
|
7064
|
+
canned_beans: cannedBeans,
|
|
7065
|
+
water_bottle: waterBottle,
|
|
7066
|
+
rice,
|
|
7067
|
+
military_ration: militaryRation,
|
|
7068
|
+
cachaca,
|
|
7069
|
+
first_aid_kit: firstAidKit,
|
|
7070
|
+
bandage,
|
|
7071
|
+
amoxicillin,
|
|
7072
|
+
crowbar,
|
|
7073
|
+
hammer,
|
|
7074
|
+
machete,
|
|
7075
|
+
axe,
|
|
7076
|
+
nail_bat: nailBat,
|
|
7077
|
+
hiking_backpack_40l: hikingBackpack40L,
|
|
7078
|
+
flashlight,
|
|
7079
|
+
portable_radio: portableRadio,
|
|
7080
|
+
house_key: houseKey,
|
|
7081
|
+
survivor_diary: survivorDiary,
|
|
7082
|
+
motorcycle_helmet: motorcycleHelmet,
|
|
7083
|
+
lpg_cylinder_13kg: lpgCylinder13Kg,
|
|
7084
|
+
fuel_jerrycan: fuelJerrycan,
|
|
7085
|
+
walkie_talkies: walkieTalkies,
|
|
7086
|
+
batteries,
|
|
7087
|
+
wooden_plank: woodenPlank,
|
|
7088
|
+
sugar,
|
|
7089
|
+
chocolate_bar: chocolateBar,
|
|
7090
|
+
potatoes,
|
|
7091
|
+
biscuits,
|
|
7092
|
+
coffee,
|
|
7093
|
+
raw_beef: rawBeef,
|
|
7094
|
+
game_meat: gameMeat,
|
|
7095
|
+
jerked_beef: jerkedBeef,
|
|
7096
|
+
home_preserves: homePreserves,
|
|
7097
|
+
eggs,
|
|
7098
|
+
cassava_flour: cassavaFlour,
|
|
7099
|
+
beans,
|
|
7100
|
+
frozen_chicken: frozenChicken,
|
|
7101
|
+
orange,
|
|
7102
|
+
condensed_milk: condensedMilk,
|
|
7103
|
+
pasta,
|
|
7104
|
+
instant_noodles: instantNoodles,
|
|
7105
|
+
cassava_root: cassavaRoot,
|
|
7106
|
+
canned_corn_and_peas: cannedCornAndPeas,
|
|
7107
|
+
mortadella,
|
|
7108
|
+
fresh_fish: freshFish,
|
|
7109
|
+
salted_fish: saltedFish,
|
|
7110
|
+
banana_bunch: bananaBunch,
|
|
7111
|
+
honey_jar: honeyJar,
|
|
7112
|
+
bread,
|
|
7113
|
+
cheese,
|
|
7114
|
+
rapadura,
|
|
7115
|
+
dog_food: dogFood,
|
|
7116
|
+
salt,
|
|
7117
|
+
snack_chips: snackChips,
|
|
7118
|
+
canned_sausages: cannedSausages,
|
|
7119
|
+
canned_sardines: cannedSardines,
|
|
7120
|
+
cooking_oil: cookingOil,
|
|
7121
|
+
beer_can: beerCan,
|
|
7122
|
+
energy_drink: energyDrink,
|
|
7123
|
+
water_jug_5l: waterJug5l,
|
|
7124
|
+
sports_drink: sportsDrink,
|
|
7125
|
+
milk_carton: milkCarton,
|
|
7126
|
+
soda_can: sodaCan,
|
|
7127
|
+
juice_box: juiceBox,
|
|
7128
|
+
communion_wine: communionWine,
|
|
7129
|
+
coconut_water: coconutWater,
|
|
7130
|
+
dirty_water: dirtyWater,
|
|
7131
|
+
painkillers,
|
|
7132
|
+
tramadol,
|
|
7133
|
+
ibuprofen,
|
|
7134
|
+
antihistamine,
|
|
7135
|
+
ceftriaxone,
|
|
7136
|
+
clonazepam,
|
|
7137
|
+
activated_charcoal: activatedCharcoal,
|
|
7138
|
+
adhesive_bandages: adhesiveBandages,
|
|
7139
|
+
medical_tape: medicalTape,
|
|
7140
|
+
sterile_gauze: sterileGauze,
|
|
7141
|
+
povidone_iodine: povidoneIodine,
|
|
7142
|
+
suture_kit: sutureKit,
|
|
7143
|
+
exam_gloves: examGloves,
|
|
7144
|
+
n95_mask: n95Mask,
|
|
7145
|
+
multivitamin,
|
|
7146
|
+
maintenance_medication: maintenanceMedication,
|
|
7147
|
+
rehydration_salts: rehydrationSalts,
|
|
7148
|
+
syringe,
|
|
7149
|
+
antivenom,
|
|
7150
|
+
saline_iv_bag: salineIvBag,
|
|
7151
|
+
splint,
|
|
7152
|
+
thermometer,
|
|
7153
|
+
alcohol_70: alcohol70,
|
|
7154
|
+
can_opener: canOpener,
|
|
7155
|
+
pliers,
|
|
7156
|
+
bolt_cutters: boltCutters,
|
|
7157
|
+
bucket,
|
|
7158
|
+
binoculars,
|
|
7159
|
+
matches,
|
|
7160
|
+
pocket_knife: pocketKnife,
|
|
7161
|
+
screwdriver,
|
|
7162
|
+
adjustable_wrench: adjustableWrench,
|
|
7163
|
+
hoe,
|
|
7164
|
+
fire_extinguisher: fireExtinguisher,
|
|
7165
|
+
duct_tape: ductTape,
|
|
7166
|
+
camp_stove: campStove,
|
|
7167
|
+
lighter,
|
|
7168
|
+
lockpick_kit: lockpickKit,
|
|
7169
|
+
sewing_kit: sewingKit,
|
|
7170
|
+
car_jack: carJack,
|
|
7171
|
+
mechanic_toolbox: mechanicToolbox,
|
|
7172
|
+
gas_torch: gasTorch,
|
|
7173
|
+
inverter_welder: inverterWelder,
|
|
7174
|
+
pot,
|
|
7175
|
+
cordless_drill: cordlessDrill,
|
|
7176
|
+
flint_striker: flintStriker,
|
|
7177
|
+
sharpening_stone: sharpeningStone,
|
|
7178
|
+
shovel,
|
|
7179
|
+
hacksaw,
|
|
7180
|
+
handsaw,
|
|
7181
|
+
scissors,
|
|
7182
|
+
recurve_bow: recurveBow,
|
|
7183
|
+
crossbow,
|
|
7184
|
+
iron_pipe: ironPipe,
|
|
7185
|
+
meat_cleaver: meatCleaver,
|
|
7186
|
+
slingshot,
|
|
7187
|
+
knife,
|
|
7188
|
+
tactical_knife: tacticalKnife,
|
|
7189
|
+
kabar,
|
|
7190
|
+
katana,
|
|
7191
|
+
brass_knuckles: brassKnuckles,
|
|
7192
|
+
arrows_and_bolts: arrowsAndBolts,
|
|
7193
|
+
sickle,
|
|
7194
|
+
cast_iron_skillet: castIronSkillet,
|
|
7195
|
+
improvised_spear: improvisedSpear,
|
|
7196
|
+
hatchet,
|
|
7197
|
+
sledgehammer,
|
|
7198
|
+
chainsaw,
|
|
7199
|
+
pickaxe,
|
|
7200
|
+
baseball_bat: baseballBat,
|
|
7201
|
+
police_baton: policeBaton,
|
|
7202
|
+
wire_roll: wireRoll,
|
|
7203
|
+
barbed_wire: barbedWire,
|
|
7204
|
+
glass_shards: glassShards,
|
|
7205
|
+
sheet_metal: sheetMetal,
|
|
7206
|
+
cement_bag: cementBag,
|
|
7207
|
+
epoxy_glue: epoxyGlue,
|
|
7208
|
+
electronic_components: electronicComponents,
|
|
7209
|
+
rope,
|
|
7210
|
+
copper_wire: copperWire,
|
|
7211
|
+
pet_bottle: petBottle,
|
|
7212
|
+
glass_bottle: glassBottle,
|
|
7213
|
+
empty_can: emptyCan,
|
|
7214
|
+
firewood,
|
|
7215
|
+
tarp,
|
|
7216
|
+
screws,
|
|
7217
|
+
nails,
|
|
7218
|
+
raffia_sack: raffiaSack,
|
|
7219
|
+
scrap_metal: scrapMetal,
|
|
7220
|
+
bricks,
|
|
7221
|
+
rag,
|
|
7222
|
+
rebar,
|
|
7223
|
+
lubricant_spray: lubricantSpray,
|
|
7224
|
+
army_camouflage_uniform: armyCamouflageUniform,
|
|
7163
7225
|
backpack: backpack2,
|
|
7164
|
-
|
|
7165
|
-
|
|
7166
|
-
|
|
7167
|
-
|
|
7168
|
-
|
|
7169
|
-
|
|
7170
|
-
|
|
7226
|
+
ballistic_vest: ballisticVest,
|
|
7227
|
+
battery_9v: battery9V,
|
|
7228
|
+
bean_seeds: beanSeeds,
|
|
7229
|
+
beekeeper_suit: beekeeperSuit,
|
|
7230
|
+
candles,
|
|
7231
|
+
car_alarm_remote: carAlarmRemote,
|
|
7232
|
+
car_battery_12v: carBattery12V,
|
|
7233
|
+
car_key: carKey,
|
|
7234
|
+
cash,
|
|
7235
|
+
cassava_cuttings: cassavaCuttings,
|
|
7236
|
+
cb_radio: cbRadio,
|
|
7237
|
+
cell_key: cellKey,
|
|
7238
|
+
charcoal_bag: charcoalBag,
|
|
7239
|
+
cigarettes,
|
|
7240
|
+
city_map: cityMap,
|
|
7241
|
+
combat_boots: combatBoots,
|
|
7242
|
+
cooler_box: coolerBox,
|
|
7243
|
+
corn_seeds: cornSeeds,
|
|
7244
|
+
crossbody_bag: crossbodyBag,
|
|
7245
|
+
delivery_bag: deliveryBag,
|
|
7246
|
+
denim_jacket: denimJacket,
|
|
7247
|
+
diesel,
|
|
7248
|
+
diy_magazine: diyMagazine,
|
|
7249
|
+
dog_tag: dogTag,
|
|
7250
|
+
electric_fence_energizer: electricFenceEnergizer,
|
|
7251
|
+
extension_cord: extensionCord,
|
|
7252
|
+
fanny_pack: fannyPack,
|
|
7253
|
+
farmers_almanac: farmersAlmanac,
|
|
7254
|
+
fertilizer_bag: fertilizerBag,
|
|
7255
|
+
firefighter_suit: firefighterSuit,
|
|
7256
|
+
fishing_net: fishingNet,
|
|
7257
|
+
fishing_rod: fishingRod,
|
|
7258
|
+
fishing_tackle_box: fishingTackleBox,
|
|
7259
|
+
flip_flops: flipFlops,
|
|
7260
|
+
folding_solar_panel: foldingSolarPanel,
|
|
7261
|
+
gas_cartridge: gasCartridge,
|
|
7262
|
+
gasoline,
|
|
7263
|
+
generator_key: generatorKey,
|
|
7264
|
+
hard_hat: hardHat,
|
|
7265
|
+
headlamp,
|
|
7266
|
+
hoodie,
|
|
7267
|
+
janitor_keys: janitorKeys,
|
|
7268
|
+
jeans,
|
|
7269
|
+
kale_and_lettuce_seeds: kaleAndLettuceSeeds,
|
|
7270
|
+
kerosene,
|
|
7271
|
+
laptop,
|
|
7272
|
+
leather_motorcycle_jacket: leatherMotorcycleJacket,
|
|
7273
|
+
leather_motorcycle_pants: leatherMotorcyclePants,
|
|
7274
|
+
leather_work_gloves: leatherWorkGloves,
|
|
7275
|
+
led_camp_lantern: ledCampLantern,
|
|
7276
|
+
magazine_arm_guard: magazineArmGuard,
|
|
7277
|
+
magazines_and_comics: magazinesAndComics,
|
|
7278
|
+
master_key: masterKey,
|
|
7279
|
+
mechanic_coveralls: mechanicCoveralls,
|
|
7280
|
+
military_backpack: militaryBackpack,
|
|
7281
|
+
military_radio: militaryRadio,
|
|
7282
|
+
mobile_phone: mobilePhone,
|
|
7283
|
+
motor_oil: motorOil,
|
|
7284
|
+
night_vision_goggles: nightVisionGoggles,
|
|
7285
|
+
note,
|
|
7286
|
+
padded_coat: paddedCoat,
|
|
7287
|
+
padlock_key: padlockKey,
|
|
7288
|
+
photo,
|
|
7289
|
+
portable_generator: portableGenerator,
|
|
7290
|
+
power_bank: powerBank,
|
|
7291
|
+
pumpkin_seeds: pumpkinSeeds,
|
|
7292
|
+
raincoat,
|
|
7293
|
+
road_map: roadMap,
|
|
7294
|
+
rolling_suitcase: rollingSuitcase,
|
|
7295
|
+
rubber_boots: rubberBoots,
|
|
7296
|
+
safe_key: safeKey,
|
|
7297
|
+
safety_goggles: safetyGoggles,
|
|
7298
|
+
sheet_metal_forearm_guard: sheetMetalForearmGuard,
|
|
7299
|
+
shopping_bag: shoppingBag,
|
|
7300
|
+
shopping_cart: shoppingCart,
|
|
7301
|
+
skill_book: skillBook,
|
|
7302
|
+
snare_trap: snareTrap,
|
|
7303
|
+
sneakers,
|
|
7304
|
+
tactical_vest: tacticalVest,
|
|
7305
|
+
technical_manual: technicalManual,
|
|
7306
|
+
tool_belt: toolBelt,
|
|
7307
|
+
trash_bag: trashBag,
|
|
7308
|
+
trekking_backpack_70l: trekkingBackpack70L,
|
|
7309
|
+
tshirt,
|
|
7310
|
+
watering_can: wateringCan,
|
|
7311
|
+
wheelbarrow,
|
|
7312
|
+
windup_alarm_clock: windupAlarmClock,
|
|
7313
|
+
soap,
|
|
7314
|
+
shampoo,
|
|
7315
|
+
toothpaste,
|
|
7316
|
+
toothbrush,
|
|
7317
|
+
plunger
|
|
7171
7318
|
};
|
|
7172
|
-
var
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
|
|
7177
|
-
|
|
7178
|
-
|
|
7179
|
-
|
|
7180
|
-
|
|
7181
|
-
|
|
7182
|
-
|
|
7183
|
-
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
if (subject.category === "electronics") return "device";
|
|
7192
|
-
if (subject.category === "books") return "book";
|
|
7193
|
-
if (subject.category === "keys") return "key";
|
|
7194
|
-
return hint;
|
|
7195
|
-
case "paper":
|
|
7196
|
-
return subject.category === "books" ? "book" : hint;
|
|
7197
|
-
default:
|
|
7198
|
-
return hint;
|
|
7319
|
+
var SHIPPED_MODELS = models_default.map((entry) => {
|
|
7320
|
+
const builder = BUILDERS[entry.id];
|
|
7321
|
+
if (!builder) throw new Error(`game-items-three: no builder for the model "${entry.id}"`);
|
|
7322
|
+
return { entry, builder };
|
|
7323
|
+
});
|
|
7324
|
+
|
|
7325
|
+
// src/models/registry.ts
|
|
7326
|
+
var registryOver = (entries, builders) => ({
|
|
7327
|
+
has: (id) => builders.has(id),
|
|
7328
|
+
entry: (id) => entries.get(id),
|
|
7329
|
+
builder: (id) => builders.get(id),
|
|
7330
|
+
list: () => [...entries.keys()],
|
|
7331
|
+
register(entry, builder) {
|
|
7332
|
+
entries.set(entry.id, entry);
|
|
7333
|
+
builders.set(entry.id, builder);
|
|
7334
|
+
},
|
|
7335
|
+
unregister(id) {
|
|
7336
|
+
entries.delete(id);
|
|
7337
|
+
builders.delete(id);
|
|
7199
7338
|
}
|
|
7200
|
-
}
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7339
|
+
});
|
|
7340
|
+
var defaultRegistry;
|
|
7341
|
+
var defaultItemModels = () => defaultRegistry ?? (defaultRegistry = registryOver(new Map(SHIPPED_MODELS.map(({ entry }) => [entry.id, entry])), new Map(SHIPPED_MODELS.map(({ entry, builder }) => [entry.id, builder]))));
|
|
7342
|
+
var registerItemModel = (entry, builder) => defaultItemModels().register(entry, builder);
|
|
7343
|
+
var unregisterItemModel = (id) => defaultItemModels().unregister(id);
|
|
7344
|
+
var itemModelEntry = (id) => defaultItemModels().entry(id);
|
|
7345
|
+
var itemModelBuilder = (id) => defaultItemModels().builder(id);
|
|
7346
|
+
var hasItemModel = (id) => defaultItemModels().has(id);
|
|
7347
|
+
var listItemModels = () => defaultItemModels().list();
|
|
7205
7348
|
|
|
7206
7349
|
// src/wear.ts
|
|
7207
|
-
|
|
7350
|
+
import { freshness } from "@adatechnology/game-items";
|
|
7351
|
+
var wearOfFreshness = (state) => state === "fresh" ? 0 : state === "stale" ? 1 : 2;
|
|
7352
|
+
var AGED_IN = "ambient";
|
|
7353
|
+
function wearOfAge(item, ageDays, rules) {
|
|
7354
|
+
if (item.shelfLife === void 0 || ageDays <= 0) return 0;
|
|
7355
|
+
return wearOfFreshness(freshness(item, { ageDays, since: 0, storage: AGED_IN, storedAt: 0 }, 0, rules ? { rules } : {}));
|
|
7356
|
+
}
|
|
7357
|
+
var WEAR_TARGET = { food: 6122286, metal: 8011293, wood: 4141862, cloth: 4866099, plastic: 7038294, paper: 9075282, glass: 5591098, rubber: 4860452 };
|
|
7208
7358
|
var WEAR_AMOUNT = [0, 0.3, 0.62];
|
|
7209
7359
|
var hexToRgb = (hex2) => [(hex2 >> 16 & 255) / 255, (hex2 >> 8 & 255) / 255, (hex2 & 255) / 255];
|
|
7210
7360
|
var dataOf = (material) => {
|
|
@@ -7405,6 +7555,153 @@ function renderItemThumbnail(T, renderer, item, options = {}) {
|
|
|
7405
7555
|
return renderer.domElement.toDataURL("image/png");
|
|
7406
7556
|
}
|
|
7407
7557
|
|
|
7558
|
+
// src/wash.ts
|
|
7559
|
+
var WASH_NAME = "item_wash";
|
|
7560
|
+
var STAIN_LIFT = 15e-4;
|
|
7561
|
+
var SPOTS = [
|
|
7562
|
+
[0, 0],
|
|
7563
|
+
[0.5, 0],
|
|
7564
|
+
[0.155, 0.476],
|
|
7565
|
+
[-0.405, 0.294],
|
|
7566
|
+
[-0.405, -0.294],
|
|
7567
|
+
[0.155, -0.476]
|
|
7568
|
+
];
|
|
7569
|
+
var STAIN_RADIUS = 0.12;
|
|
7570
|
+
var BUBBLE_RADIUS = 0.1;
|
|
7571
|
+
var BUBBLE_CLUSTER = [
|
|
7572
|
+
[0, 0, 1],
|
|
7573
|
+
[1.1, 0.3, 0.7],
|
|
7574
|
+
[-0.6, 0.9, 0.6]
|
|
7575
|
+
];
|
|
7576
|
+
var STAIN_COLORS = [8014370, 10903070, 6175260, 12088362, 9067050, 10243866];
|
|
7577
|
+
var FOAM_COLOR = 16054008;
|
|
7578
|
+
var overlays = /* @__PURE__ */ new WeakMap();
|
|
7579
|
+
var isOwnMesh = (mesh) => !mesh.userData.destructionDebris && mesh.parent?.name !== WASH_NAME;
|
|
7580
|
+
function localBox2(T, root) {
|
|
7581
|
+
root.updateMatrixWorld(true);
|
|
7582
|
+
const toRoot = new T.Matrix4().copy(root.matrixWorld).invert();
|
|
7583
|
+
const box2 = new T.Box3();
|
|
7584
|
+
const part = new T.Box3();
|
|
7585
|
+
const m = new T.Matrix4();
|
|
7586
|
+
root.traverse((o) => {
|
|
7587
|
+
const mesh = o;
|
|
7588
|
+
if (!mesh.isMesh || !isOwnMesh(mesh)) return;
|
|
7589
|
+
if (!mesh.geometry.boundingBox) mesh.geometry.computeBoundingBox();
|
|
7590
|
+
const bounds = mesh.geometry.boundingBox;
|
|
7591
|
+
if (!bounds) return;
|
|
7592
|
+
part.copy(bounds).applyMatrix4(m.multiplyMatrices(toRoot, mesh.matrixWorld));
|
|
7593
|
+
box2.union(part);
|
|
7594
|
+
});
|
|
7595
|
+
return box2;
|
|
7596
|
+
}
|
|
7597
|
+
function spotsOn(T, root, box2) {
|
|
7598
|
+
const meshes = [];
|
|
7599
|
+
root.traverse((o) => {
|
|
7600
|
+
const mesh = o;
|
|
7601
|
+
if (mesh.isMesh && isOwnMesh(mesh)) meshes.push(mesh);
|
|
7602
|
+
});
|
|
7603
|
+
const toRoot = new T.Matrix4().copy(root.matrixWorld).invert();
|
|
7604
|
+
const down = new T.Vector3(0, -1, 0).transformDirection(root.matrixWorld);
|
|
7605
|
+
const ray = new T.Raycaster();
|
|
7606
|
+
const centre = box2.getCenter(new T.Vector3());
|
|
7607
|
+
const half = box2.getSize(new T.Vector3()).multiplyScalar(0.5);
|
|
7608
|
+
const above = box2.max.y + half.y + 0.01;
|
|
7609
|
+
const spots = [];
|
|
7610
|
+
for (const [x, z] of SPOTS) {
|
|
7611
|
+
const origin = new T.Vector3(centre.x + x * half.x, above, centre.z + z * half.z).applyMatrix4(root.matrixWorld);
|
|
7612
|
+
ray.set(origin, down);
|
|
7613
|
+
const hit = ray.intersectObjects(meshes, false)[0];
|
|
7614
|
+
if (!hit?.face) continue;
|
|
7615
|
+
const normal = hit.face.normal.clone().transformDirection(hit.object.matrixWorld);
|
|
7616
|
+
if (normal.dot(down) > 0) normal.negate();
|
|
7617
|
+
const point = hit.point.clone().addScaledVector(normal, STAIN_LIFT).applyMatrix4(toRoot);
|
|
7618
|
+
spots.push({ point, normal: normal.transformDirection(toRoot) });
|
|
7619
|
+
}
|
|
7620
|
+
return spots;
|
|
7621
|
+
}
|
|
7622
|
+
function layerOf(T, geometry, material, bases, name) {
|
|
7623
|
+
const mesh = new T.InstancedMesh(geometry, material, bases.length);
|
|
7624
|
+
mesh.name = name;
|
|
7625
|
+
bases.forEach((base, i) => mesh.setMatrixAt(i, base));
|
|
7626
|
+
mesh.computeBoundingSphere();
|
|
7627
|
+
mesh.visible = false;
|
|
7628
|
+
mesh.userData.destructionDebris = true;
|
|
7629
|
+
mesh.raycast = () => {
|
|
7630
|
+
};
|
|
7631
|
+
return { mesh, bases, value: 0 };
|
|
7632
|
+
}
|
|
7633
|
+
function blotGeometry(T) {
|
|
7634
|
+
const geometry = new T.CircleGeometry(1, 9);
|
|
7635
|
+
const position = geometry.getAttribute("position");
|
|
7636
|
+
for (let i = 1; i < position.count; i++) {
|
|
7637
|
+
const wobble = 0.75 + 0.25 * Math.abs(Math.sin(i * 2.3));
|
|
7638
|
+
position.setXY(i, position.getX(i) * wobble, position.getY(i) * wobble);
|
|
7639
|
+
}
|
|
7640
|
+
return geometry.rotateX(-Math.PI / 2);
|
|
7641
|
+
}
|
|
7642
|
+
function createOverlay(T, root) {
|
|
7643
|
+
const scratch = { matrix: new T.Matrix4(), scale: new T.Matrix4() };
|
|
7644
|
+
const box2 = localBox2(T, root);
|
|
7645
|
+
const spots = box2.isEmpty() ? [] : spotsOn(T, root, box2);
|
|
7646
|
+
if (spots.length === 0) return { dirt: void 0, foam: void 0, scratch };
|
|
7647
|
+
const size = box2.getSize(new T.Vector3());
|
|
7648
|
+
const small = Math.min(size.x, size.z) / 2;
|
|
7649
|
+
const up = new T.Vector3(0, 1, 0);
|
|
7650
|
+
const turn = (normal, spin) => new T.Quaternion().setFromUnitVectors(up, normal).multiply(new T.Quaternion().setFromAxisAngle(up, spin));
|
|
7651
|
+
const stains = spots.map((spot, i) => {
|
|
7652
|
+
const r = small * STAIN_RADIUS;
|
|
7653
|
+
return new T.Matrix4().compose(spot.point, turn(spot.normal, i * 1.7), new T.Vector3(r, 1, r * (0.65 + 0.35 * (i * 0.37 % 1))));
|
|
7654
|
+
});
|
|
7655
|
+
const bubbleRadius = small * BUBBLE_RADIUS;
|
|
7656
|
+
const bubbles = spots.flatMap((spot, i) => {
|
|
7657
|
+
const q = turn(spot.normal, i * 1.1);
|
|
7658
|
+
return BUBBLE_CLUSTER.map(([along, across2, share]) => {
|
|
7659
|
+
const r = bubbleRadius * share;
|
|
7660
|
+
const at = new T.Vector3(along * bubbleRadius, r * 0.4 - STAIN_LIFT, across2 * bubbleRadius).applyQuaternion(q).add(spot.point);
|
|
7661
|
+
return new T.Matrix4().compose(at, q, new T.Vector3(r, r, r));
|
|
7662
|
+
});
|
|
7663
|
+
});
|
|
7664
|
+
const group = new T.Group();
|
|
7665
|
+
group.name = WASH_NAME;
|
|
7666
|
+
group.userData.destructionIgnore = true;
|
|
7667
|
+
const dirt = layerOf(T, blotGeometry(T), new T.MeshStandardMaterial({ roughness: 0.95, metalness: 0 }), stains, "item_dirt");
|
|
7668
|
+
stains.forEach((_, i) => dirt.mesh.setColorAt(i, new T.Color(STAIN_COLORS[i % STAIN_COLORS.length])));
|
|
7669
|
+
const foam = layerOf(T, new T.SphereGeometry(1, 8, 6), new T.MeshStandardMaterial({ color: FOAM_COLOR, roughness: 0.55, metalness: 0 }), bubbles, "item_foam");
|
|
7670
|
+
group.add(dirt.mesh, foam.mesh);
|
|
7671
|
+
root.add(group);
|
|
7672
|
+
return { dirt, foam, scratch };
|
|
7673
|
+
}
|
|
7674
|
+
function overlayOf(T, root) {
|
|
7675
|
+
const found = overlays.get(root);
|
|
7676
|
+
if (found) return found;
|
|
7677
|
+
const created = createOverlay(T, root);
|
|
7678
|
+
overlays.set(root, created);
|
|
7679
|
+
return created;
|
|
7680
|
+
}
|
|
7681
|
+
function showLayer(layer, value, scratch) {
|
|
7682
|
+
if (!layer) return;
|
|
7683
|
+
const share = Math.max(0, Math.min(1, value));
|
|
7684
|
+
if (share === layer.value) return;
|
|
7685
|
+
layer.value = share;
|
|
7686
|
+
layer.mesh.visible = share > 0;
|
|
7687
|
+
if (share === 0) return;
|
|
7688
|
+
const grow = 0.45 + 0.55 * share;
|
|
7689
|
+
scratch.scale.makeScale(grow, grow, grow);
|
|
7690
|
+
layer.bases.forEach((base, i) => {
|
|
7691
|
+
scratch.matrix.copy(base).multiply(scratch.scale);
|
|
7692
|
+
layer.mesh.setMatrixAt(i, scratch.matrix);
|
|
7693
|
+
});
|
|
7694
|
+
layer.mesh.instanceMatrix.needsUpdate = true;
|
|
7695
|
+
}
|
|
7696
|
+
function setItemDirt(T, root, dirt) {
|
|
7697
|
+
const overlay = overlayOf(T, root);
|
|
7698
|
+
showLayer(overlay.dirt, dirt, overlay.scratch);
|
|
7699
|
+
}
|
|
7700
|
+
function setItemFoam(T, root, amount) {
|
|
7701
|
+
const overlay = overlayOf(T, root);
|
|
7702
|
+
showLayer(overlay.foam, amount, overlay.scratch);
|
|
7703
|
+
}
|
|
7704
|
+
|
|
7408
7705
|
// src/test-area/area.ts
|
|
7409
7706
|
var SHOWCASE_STAND_ID = "stand_models";
|
|
7410
7707
|
var RULER_ID = "ruler_155";
|
|
@@ -7534,9 +7831,8 @@ var fill = (template, vars) => template.replace(/\{(\w+)\}/g, (_, key2) => Strin
|
|
|
7534
7831
|
var humanize = (id) => id.replace(/_/g, " ").replace(/^./, (c) => c.toUpperCase());
|
|
7535
7832
|
var stageOf = (catalog, item, base, ageDays, storage, powered) => {
|
|
7536
7833
|
if (item.shelfLife === void 0 || ageDays <= 0) return base;
|
|
7537
|
-
const state =
|
|
7538
|
-
|
|
7539
|
-
return Math.max(base, aged);
|
|
7834
|
+
const state = freshness2(item, { ageDays: 0, since: 0, storage, storedAt: 0 }, ageDays, { powered, rules: catalog.rules });
|
|
7835
|
+
return Math.max(base, wearOfFreshness(state));
|
|
7540
7836
|
};
|
|
7541
7837
|
var sizeOfModel = (modelSet, id) => {
|
|
7542
7838
|
const entry = modelSet.entry(id);
|
|
@@ -7615,6 +7911,20 @@ function createItemsTestModule(options) {
|
|
|
7615
7911
|
const contents = itemContents(subject);
|
|
7616
7912
|
return contents ? { fluid: { container: contents.container, part: SHELL_PART_ID } } : {};
|
|
7617
7913
|
};
|
|
7914
|
+
const vesselOf = (def) => {
|
|
7915
|
+
const shape = def.model !== void 0 && modelSet.builder(def.model) ? void 0 : shapeOf(def);
|
|
7916
|
+
const vessel = itemVessel({ size: def.size, ...def.container?.capacityLiters === void 0 ? {} : { capacityLiters: def.container.capacityLiters }, ...shape === void 0 ? {} : { shape } });
|
|
7917
|
+
return vessel ? { fluid: { container: vessel.container, uses: ["drink", "sip", "pour", "pour_out"], offset: vessel.offset } } : {};
|
|
7918
|
+
};
|
|
7919
|
+
const washable = options.washable ?? ((def) => def.category !== "food" && (def.tags?.includes("kitchen") ?? false));
|
|
7920
|
+
const washOf = (def) => {
|
|
7921
|
+
if (!washable(def)) return {};
|
|
7922
|
+
const wash = {
|
|
7923
|
+
dirt: (root, dirt) => void (latestTHREE && setItemDirt(latestTHREE, root, dirt)),
|
|
7924
|
+
foam: (root, amount) => void (latestTHREE && setItemFoam(latestTHREE, root, amount))
|
|
7925
|
+
};
|
|
7926
|
+
return { wash };
|
|
7927
|
+
};
|
|
7618
7928
|
const sealOf = (def, fluid) => {
|
|
7619
7929
|
const model = def.model;
|
|
7620
7930
|
if (!def.seal || model === void 0 || !itemOpening(model)) return fluid;
|
|
@@ -7636,7 +7946,8 @@ function createItemsTestModule(options) {
|
|
|
7636
7946
|
};
|
|
7637
7947
|
const usesOf = (def) => {
|
|
7638
7948
|
const use = options.itemUse?.(def);
|
|
7639
|
-
const
|
|
7949
|
+
const contents = fluidOf({ ...def.model === void 0 ? {} : { model: def.model }, size: def.size, weight: def.weight });
|
|
7950
|
+
const liquid = sealOf(def, contents.fluid ? contents : vesselOf(def));
|
|
7640
7951
|
if (!use) return liquid;
|
|
7641
7952
|
const edible = def.category === "food" || def.category === "drink";
|
|
7642
7953
|
return { ...liquid, ...liquid.fluid && !edible ? { fluid: { ...liquid.fluid, uses: ["pour", "pour_out"] } } : {}, use };
|
|
@@ -7647,10 +7958,15 @@ function createItemsTestModule(options) {
|
|
|
7647
7958
|
movable: true,
|
|
7648
7959
|
thumbnail: itemThumbnailSvg(drawable(def)),
|
|
7649
7960
|
...usesOf(def),
|
|
7961
|
+
...washOf(def),
|
|
7962
|
+
catalogId: def.id,
|
|
7963
|
+
// what the item spends at each use (detergent, soap): the room takes its doses and shows what is left
|
|
7964
|
+
...def.consumable ? { consumable: def.consumable } : {},
|
|
7650
7965
|
// an item with a make-up (a shovel: ash handle riveted to a steel blade) is that spec, not the parts guessed from its meshes
|
|
7651
7966
|
...makeupSpecOf(def.model),
|
|
7652
7967
|
// an item that is also a tool of the arsenal (a shovel) is picked up as that tool
|
|
7653
7968
|
...def.weapon ? { weapon: def.weapon } : {},
|
|
7969
|
+
...def.tools ? { tools: def.tools } : {},
|
|
7654
7970
|
physical: { weightKg: def.weight, size: def.size, ...def.volume === void 0 ? {} : { litres: def.volume } },
|
|
7655
7971
|
build: (THREE) => {
|
|
7656
7972
|
const T = THREE;
|
|
@@ -8112,7 +8428,7 @@ function scenariosOf(module, catalog, text, provider, modelSet) {
|
|
|
8112
8428
|
run: ({ expect }) => {
|
|
8113
8429
|
const food = catalog.list().find((item) => item.shelfLife !== void 0 && item.shelfLife > 0);
|
|
8114
8430
|
if (!food) return expect(false, "the catalog has a food that spoils");
|
|
8115
|
-
const at = (storage, days2) =>
|
|
8431
|
+
const at = (storage, days2) => freshness2(food, { ageDays: 0, since: 0, storage, storedAt: 0 }, days2, { rules: catalog.rules });
|
|
8116
8432
|
const days = food.shelfLife * 1.2;
|
|
8117
8433
|
expect(at("ambient", days) !== "fresh", "at room temperature it is past its best", { food: food.id });
|
|
8118
8434
|
if ("fridge" in catalog.rules.storage) expect(at("fridge", days) !== at("ambient", days) || at("fridge", days) === "fresh", "in the fridge it keeps better", { food: food.id });
|
|
@@ -8137,13 +8453,16 @@ function scenariosOf(module, catalog, text, provider, modelSet) {
|
|
|
8137
8453
|
export {
|
|
8138
8454
|
WEAR_TAGS,
|
|
8139
8455
|
createItemKit,
|
|
8456
|
+
wearOfFreshness,
|
|
8457
|
+
wearOfAge,
|
|
8140
8458
|
WEAR_TARGET,
|
|
8141
8459
|
WEAR_AMOUNT,
|
|
8142
8460
|
wearableMaterials,
|
|
8143
8461
|
setWear,
|
|
8144
|
-
|
|
8462
|
+
SHAPES,
|
|
8145
8463
|
shade,
|
|
8146
8464
|
canonicalFrame,
|
|
8465
|
+
CUP_FLOOR_SHARE,
|
|
8147
8466
|
isShape,
|
|
8148
8467
|
shapeOf,
|
|
8149
8468
|
drawShape,
|
|
@@ -8157,6 +8476,7 @@ export {
|
|
|
8157
8476
|
ITEM_FAMILIES,
|
|
8158
8477
|
SHELL_PART_ID,
|
|
8159
8478
|
itemContents,
|
|
8479
|
+
itemVessel,
|
|
8160
8480
|
tagForDestruction,
|
|
8161
8481
|
itemOpening,
|
|
8162
8482
|
OPENING_NAME,
|
|
@@ -8174,6 +8494,9 @@ export {
|
|
|
8174
8494
|
hasItemModel,
|
|
8175
8495
|
listItemModels,
|
|
8176
8496
|
buildItem,
|
|
8497
|
+
WASH_NAME,
|
|
8498
|
+
setItemDirt,
|
|
8499
|
+
setItemFoam,
|
|
8177
8500
|
ITEM_BUDGETS,
|
|
8178
8501
|
sizeClassOf,
|
|
8179
8502
|
triangleBudgetOf,
|
|
@@ -8202,4 +8525,4 @@ export {
|
|
|
8202
8525
|
HUMAN_HEIGHT,
|
|
8203
8526
|
createItemsTestModule
|
|
8204
8527
|
};
|
|
8205
|
-
//# sourceMappingURL=chunk-
|
|
8528
|
+
//# sourceMappingURL=chunk-XJG7IGO3.js.map
|