@adatechnology/game-weapons-three 0.29.1 → 0.29.3

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.
@@ -25010,6 +25010,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
25010
25010
  var THIN_SHEET_CRUSH = 5e-4;
25011
25011
  var THIN_SHEET_CONTACT = 0.025;
25012
25012
  var DMG_PER_J = 0.02;
25013
+ var THROW_SPREAD = 0.6;
25013
25014
  var FRAGMENT_RAYS = 256;
25014
25015
  var FRAGMENT_MAX_WEIGHT = 8;
25015
25016
  var SHELTER_DEFAULTS = { k: 2800, brokenTransmission: 0.5, minPath: 5e-3 };
@@ -25053,6 +25054,12 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
25053
25054
  var MASONRY_CRUMBLE_SPEED = 0.6;
25054
25055
  var MASONRY_TOPPLE = 0.4;
25055
25056
  var MASONRY_TOPPLE_MIN_HEIGHT = 0.5;
25057
+ var SPIN_REACH = 0.1;
25058
+ var bornSpin = (size, chipSpin, rnd2) => {
25059
+ const reach2 = Math.hypot(size[0] ?? 0, size[1] ?? 0, size[2] ?? 0) / 2;
25060
+ const scale = reach2 <= SPIN_REACH ? 1 : SPIN_REACH / reach2;
25061
+ return [(rnd2() - 0.5) * chipSpin * scale, (rnd2() - 0.5) * chipSpin * scale, (rnd2() - 0.5) * chipSpin * scale];
25062
+ };
25056
25063
  var TILE_CLUMPS = 160;
25057
25064
  var TILE_THICKNESS = 0.018;
25058
25065
  var PANEL_EDGE_PILLAR = 2;
@@ -27668,7 +27675,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
27668
27675
  size: [cell.size[0], cell.size[1], cell.size[2]],
27669
27676
  rotation: q,
27670
27677
  velocity: [dv[0] * k, dv[1] * k + 0.5 * rnd2(), dv[2] * k],
27671
- angularVelocity: [(rnd2() - 0.5) * 8, (rnd2() - 0.5) * 8, (rnd2() - 0.5) * 8],
27678
+ angularVelocity: bornSpin(cell.size, 8, rnd2),
27672
27679
  mass: mass * faceArea(cell) / total,
27673
27680
  ...marks.length > 0 ? { marks } : {},
27674
27681
  ...inner && laid ? { unit: true } : inner ? { inner } : {}
@@ -27707,7 +27714,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
27707
27714
  size,
27708
27715
  rotation: q,
27709
27716
  velocity: [out0[0] * k, out0[1] * k + 0.5 * rnd2(), out0[2] * k],
27710
- angularVelocity: [(rnd2() - 0.5) * 12, (rnd2() - 0.5) * 12, (rnd2() - 0.5) * 12],
27717
+ angularVelocity: bornSpin(size, 12, rnd2),
27711
27718
  mass: layer3.mat.density * size[0] * size[1] * size[2]
27712
27719
  });
27713
27720
  }
@@ -28033,7 +28040,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
28033
28040
  size,
28034
28041
  rotation: q,
28035
28042
  velocity: [vdir[0] * k, vdir[1] * k + 0.5 * rnd2(), vdir[2] * k],
28036
- angularVelocity: [(rnd2() - 0.5) * 20, (rnd2() - 0.5) * 20, (rnd2() - 0.5) * 20],
28043
+ angularVelocity: bornSpin(size, 20, rnd2),
28037
28044
  mass: mass / n,
28038
28045
  inner: true
28039
28046
  });
@@ -28380,6 +28387,10 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
28380
28387
  loosened(o, opened, "break", src);
28381
28388
  collapseCheck(o, src);
28382
28389
  };
28390
+ const thrownAlong = (out, dir) => {
28391
+ const across2 = vec.madd(out, dir, -vec.dot(out, dir));
28392
+ return vec.normalize(vec.madd(dir, [across2[0], 0, across2[2]], THROW_SPREAD), dir);
28393
+ };
28383
28394
  const failPart = (o, p, origin, dir, fragEnergy, cap, src, force) => {
28384
28395
  if (isLost(p)) return;
28385
28396
  if (p.st.stripped) {
@@ -28427,7 +28438,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
28427
28438
  const fragments = plan.map((f, i) => {
28428
28439
  const cw = toWorld(c, q, f.center);
28429
28440
  const out = vec.normalize(vec.sub(cw, hitW), [0, 1, 0]);
28430
- const dv = dir ? vec.normalize(vec.madd(out, dir, 0.6)) : out;
28441
+ const dv = dir ? thrownAlong(out, dir) : out;
28431
28442
  const k = speed * (0.6 + 0.8 * rnd2());
28432
28443
  const marks = marksInBox(f.center, f.size, f.q, holes);
28433
28444
  return {
@@ -28439,7 +28450,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
28439
28450
  size: f.size,
28440
28451
  rotation: quat.mul(q, f.q),
28441
28452
  velocity: [dv[0] * k, dv[1] * k + 0.5 * rnd2(), dv[2] * k],
28442
- angularVelocity: [(rnd2() - 0.5) * 12, (rnd2() - 0.5) * 12, (rnd2() - 0.5) * 12],
28453
+ angularVelocity: bornSpin(f.size, 12, rnd2),
28443
28454
  mass: mass * f.weight / totW,
28444
28455
  ...marks.length > 0 ? { marks } : {},
28445
28456
  ...f.inner ? { inner: true } : {}
@@ -28578,7 +28589,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
28578
28589
  rotation: q,
28579
28590
  velocity: v,
28580
28591
  inner: true,
28581
- angularVelocity: [(rnd2() - 0.5) * 30, (rnd2() - 0.5) * 30, (rnd2() - 0.5) * 30],
28592
+ angularVelocity: bornSpin(size, 30, rnd2),
28582
28593
  mass
28583
28594
  });
28584
28595
  }
@@ -52457,6 +52468,11 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
52457
52468
  "prompt.glass_door.open": "Close the glass door",
52458
52469
  "prompt.glass_door.closed": "Open the glass door",
52459
52470
  "prompt.flush": "Flush",
52471
+ "prompt.flush.off": "Flush",
52472
+ "prompt.flush.on": "Flushing",
52473
+ "program.wash": "Wash",
52474
+ "program.dry": "Spin-dry",
52475
+ "use.grill": "Put {item} on the grill",
52460
52476
  "prompt.toilet_lid": "Toilet lid",
52461
52477
  "prompt.toilet_lid.open": "Close the lid",
52462
52478
  "prompt.toilet_lid.closed": "Lift the lid",
@@ -52700,6 +52716,11 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
52700
52716
  "prompt.glass_door.open": "Fechar a porta de vidro",
52701
52717
  "prompt.glass_door.closed": "Abrir a porta de vidro",
52702
52718
  "prompt.flush": "Descarga",
52719
+ "prompt.flush.off": "Dar a descarga",
52720
+ "prompt.flush.on": "Descarga correndo",
52721
+ "program.wash": "Lavar",
52722
+ "program.dry": "Secar",
52723
+ "use.grill": "P\xF4r {item} na grelha",
52703
52724
  "prompt.toilet_lid": "Tampa do vaso",
52704
52725
  "prompt.toilet_lid.open": "Fechar a tampa",
52705
52726
  "prompt.toilet_lid.closed": "Levantar a tampa",
@@ -53327,7 +53348,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
53327
53348
  h: 1.3,
53328
53349
  y: 0,
53329
53350
  solid: true,
53330
- massKg: 6
53351
+ massKg: 6,
53352
+ fixed: true
53331
53353
  },
53332
53354
  {
53333
53355
  id: "dog_house",
@@ -56086,7 +56108,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
56086
56108
  }
56087
56109
  var residentialTower = residentialTowerTemplate();
56088
56110
 
56089
- // ../game-floorplan-three/dist/chunk-Z3IBCX7E.js
56111
+ // ../game-floorplan-three/dist/chunk-OGYLJ4F7.js
56090
56112
  var __defProp4 = Object.defineProperty;
56091
56113
  var __defNormalProp2 = (obj, key2, value) => key2 in obj ? __defProp4(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
56092
56114
  var __publicField2 = (obj, key2, value) => __defNormalProp2(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
@@ -94884,7 +94906,6 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
94884
94906
  ...DEBRIS_EFFECT_FAMILIES.flatMap((family) => [stageCrack(family), breachDust(family), collapseDust(family)]),
94885
94907
  REBAR_EXPOSE
94886
94908
  ];
94887
- var FACING5 = [0, 0, 1];
94888
94909
  var ORIGIN2 = [0, 0, 0];
94889
94910
  var FORWARD4 = [0, 0, -1];
94890
94911
  var IMPACT_MATERIALS = ["concrete", "metal", "wood", "glass", "flesh", "water"];
@@ -94894,7 +94915,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
94894
94915
  team: "weapons",
94895
94916
  budget: { particles: 40, decals: 1 },
94896
94917
  loop: 2,
94897
- timeline: [call2("impact", material, ORIGIN2, FACING5, 1, 0)]
94918
+ timeline: [call2("impact", material, ORIGIN2, NORMAL, 1, 0)]
94898
94919
  });
94899
94920
  var muzzleEffect = (weapon2) => ({
94900
94921
  id: `muzzle_${weapon2}`,
@@ -98600,7 +98621,6 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
98600
98621
  var FIRE_FLICKER_SWAY = 0.25;
98601
98622
  var FIRE_FLICKER_JITTER = 0.08;
98602
98623
  var LENS_FADE = 0.16;
98603
- var FLOOR_NORMAL_Y = 0.9;
98604
98624
  function rotate2(q, v) {
98605
98625
  const [qx, qy, qz, qw] = q;
98606
98626
  const ix = qw * v[0] + qy * v[2] - qz * v[1];
@@ -98737,7 +98757,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
98737
98757
  const [x, y, z] = this.place([recipe2[0], recipe2[1], recipe2[2]]);
98738
98758
  const options = recipe2[5];
98739
98759
  const normal = options?.n ? this.turn(options.n) : void 0;
98740
- const onFloor = !normal || normal[1] > FLOOR_NORMAL_Y;
98760
+ const onFloor = !normal;
98741
98761
  args = [x, onFloor ? this.context.groundAt(x, z) : y, z, recipe2[3], recipe2[4], normal ? { ...options, n: normal } : options];
98742
98762
  }
98743
98763
  this.context.trace?.("decal", args);