@adatechnology/game-items-three 0.10.2 → 0.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.global.js +20 -14
- package/dist/index.global.js.map +1 -1
- package/package.json +13 -13
package/dist/index.global.js
CHANGED
|
@@ -16100,37 +16100,37 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
16100
16100
|
if (shape.kind === "cylinder") return [shape.radius, shape.height / 2, shape.radius];
|
|
16101
16101
|
return [shape.radius, shape.radius, shape.radius];
|
|
16102
16102
|
};
|
|
16103
|
-
var hostedSolids = (spec, state,
|
|
16103
|
+
var hostedSolids = (spec, state, pose3) => {
|
|
16104
16104
|
const byId = new Map((state?.parts ?? []).map((p) => [p.id, p]));
|
|
16105
16105
|
const out = [];
|
|
16106
16106
|
for (const ps of spec.parts) {
|
|
16107
16107
|
const st = byId.get(ps.id);
|
|
16108
16108
|
if (st && (GONE.has(st.status) || st.group !== 0)) continue;
|
|
16109
|
-
const ov =
|
|
16110
|
-
const center = toWorld(
|
|
16111
|
-
const rotation = quat.mul(
|
|
16109
|
+
const ov = pose3.poses.get(ps.id);
|
|
16110
|
+
const center = toWorld(pose3.position, pose3.rotation, ov?.pos ?? ps.position);
|
|
16111
|
+
const rotation = quat.mul(pose3.rotation, ov?.q ?? quatFromEuler(...ps.rotation ?? [0, 0, 0]));
|
|
16112
16112
|
out.push({ center, half: halfOf(ps.shape), rotation });
|
|
16113
16113
|
}
|
|
16114
16114
|
return out;
|
|
16115
16115
|
};
|
|
16116
16116
|
var placedPieces = /* @__PURE__ */ new WeakMap();
|
|
16117
16117
|
var isSamePose = ({ known, position, rotation }) => known.position[0] === position[0] && known.position[1] === position[1] && known.position[2] === position[2] && known.rotation[0] === rotation[0] && known.rotation[1] === rotation[1] && known.rotation[2] === rotation[2] && known.rotation[3] === rotation[3];
|
|
16118
|
-
var hostedPieces = (pieces,
|
|
16118
|
+
var hostedPieces = (pieces, pose3) => pieces.map((piece2, index) => {
|
|
16119
16119
|
const known = placedPieces.get(piece2);
|
|
16120
|
-
const p =
|
|
16120
|
+
const p = pose3.position, q = pose3.rotation;
|
|
16121
16121
|
const isSamePlace = known !== void 0 && (piece2.key !== void 0 || known.index === index) && isSamePose({ known, position: p, rotation: q });
|
|
16122
16122
|
if (known && isSamePlace) return known.solid;
|
|
16123
|
-
const solid = placedPiece(piece2, index,
|
|
16123
|
+
const solid = placedPiece(piece2, index, pose3);
|
|
16124
16124
|
placedPieces.set(piece2, { position: [p[0], p[1], p[2]], rotation: [q[0], q[1], q[2], q[3]], index, solid });
|
|
16125
16125
|
return solid;
|
|
16126
16126
|
});
|
|
16127
|
-
var placedPiece = (piece2, index,
|
|
16128
|
-
const base = { center: toWorld(
|
|
16127
|
+
var placedPiece = (piece2, index, pose3) => {
|
|
16128
|
+
const base = { center: toWorld(pose3.position, pose3.rotation, piece2.center), half: piece2.half, rotation: quat.mul(pose3.rotation, piece2.rotation), key: piece2.key ?? `${piece2.id}:${index}` };
|
|
16129
16129
|
if (!piece2.mesh) return base;
|
|
16130
16130
|
const source = piece2.mesh.vertices;
|
|
16131
16131
|
const vertices = new Float32Array(source.length);
|
|
16132
16132
|
for (let i = 0; i < source.length; i += 3) {
|
|
16133
|
-
const world = toWorld(
|
|
16133
|
+
const world = toWorld(pose3.position, pose3.rotation, [source[i], source[i + 1], source[i + 2]]);
|
|
16134
16134
|
vertices[i] = world[0];
|
|
16135
16135
|
vertices[i + 1] = world[1];
|
|
16136
16136
|
vertices[i + 2] = world[2];
|
|
@@ -23950,6 +23950,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
23950
23950
|
return ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
23951
23951
|
};
|
|
23952
23952
|
}
|
|
23953
|
+
var pose = new Float64Array(7);
|
|
23954
|
+
var pose2 = new Float64Array(7);
|
|
23953
23955
|
|
|
23954
23956
|
// ../game-items/dist/index.js
|
|
23955
23957
|
var DEFAULT_RULES = {
|
|
@@ -45441,8 +45443,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
45441
45443
|
}
|
|
45442
45444
|
}
|
|
45443
45445
|
connect(e, spec, valves);
|
|
45444
|
-
const
|
|
45445
|
-
world.add(e.id, spec, { x:
|
|
45446
|
+
const pose3 = at(e.item);
|
|
45447
|
+
world.add(e.id, spec, { x: pose3.x, y: e.floorY, z: pose3.z, ry: pose3.ry });
|
|
45446
45448
|
out.added++;
|
|
45447
45449
|
if (!isBlocked) continue;
|
|
45448
45450
|
for (const p of spec.parts || []) {
|
|
@@ -46649,7 +46651,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
46649
46651
|
}
|
|
46650
46652
|
var residentialTower = residentialTowerTemplate();
|
|
46651
46653
|
|
|
46652
|
-
// ../game-floorplan-three/dist/chunk-
|
|
46654
|
+
// ../game-floorplan-three/dist/chunk-W4VG2X7N.js
|
|
46653
46655
|
var __defProp3 = Object.defineProperty;
|
|
46654
46656
|
var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp3(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
|
|
46655
46657
|
var __publicField = (obj, key2, value) => __defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
|
|
@@ -59045,7 +59047,11 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
59045
59047
|
if (LOOSE.has(part.material) || part.shape.kind !== "box" || part.rotation) continue;
|
|
59046
59048
|
const [x, y, z] = part.shape.size;
|
|
59047
59049
|
if (y >= x && y >= z) {
|
|
59048
|
-
if (z < x && x >= 0.6 * width)
|
|
59050
|
+
if (z < x && x >= 0.6 * width) {
|
|
59051
|
+
part.anchored = false;
|
|
59052
|
+
part.structure = { role: "beam", maxSpan: SHELF_SPAN * x };
|
|
59053
|
+
continue;
|
|
59054
|
+
}
|
|
59049
59055
|
part.structure = { role: "column" };
|
|
59050
59056
|
} else if (y <= x && y <= z) part.structure = { role: "beam", maxSpan: SHELF_SPAN * Math.max(x, z) };
|
|
59051
59057
|
}
|