@adatechnology/game-urban-three 0.2.1 → 0.2.2

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.
@@ -36,6 +36,41 @@ var GameUrbanThree = (() => {
36
36
  loadUrbanTestModule: () => loadUrbanTestModule
37
37
  });
38
38
 
39
+ // ../game-contracts/dist/index.js
40
+ var UNSAFE_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
41
+ var isPlainObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) && Object.getPrototypeOf(value) === Object.prototype;
42
+ var deepMerge = (base, patch) => {
43
+ if (!patch) return base;
44
+ const result = { ...base };
45
+ for (const [key, value] of Object.entries(patch)) {
46
+ if (value === void 0 || UNSAFE_KEYS.has(key)) continue;
47
+ const current = result[key];
48
+ result[key] = isPlainObject(current) && isPlainObject(value) ? deepMerge(current, value) : value;
49
+ }
50
+ return result;
51
+ };
52
+ var mergeById = (shipped, extra) => {
53
+ const entries = /* @__PURE__ */ new Map();
54
+ for (const entry of [...shipped, ...extra ?? []]) entries.set(entry.id, entry);
55
+ return entries;
56
+ };
57
+ var applyPatches = (entries, patches) => {
58
+ for (const [id, patch] of Object.entries(patches ?? {})) {
59
+ const entry = entries.get(id);
60
+ if (entry) entries.set(id, deepMerge(entry, patch));
61
+ }
62
+ };
63
+ var removeIds = (entries, ids) => {
64
+ for (const id of ids ?? []) entries.delete(id);
65
+ };
66
+ var KIT_ORIGIN_KEY = "kitOrigin";
67
+ function markKitOrigin(object2, origin) {
68
+ const node = object2;
69
+ node.userData = node.userData ?? {};
70
+ node.userData[KIT_ORIGIN_KEY] = { ...origin };
71
+ return object2;
72
+ }
73
+
39
74
  // ../game-shapes/dist/chunk-R4RY23RH.js
40
75
  function canonicalJson(value) {
41
76
  if (value === null) return "null";
@@ -1859,7 +1894,7 @@ var GameUrbanThree = (() => {
1859
1894
  return mesh2;
1860
1895
  };
1861
1896
  function draw(scene, drawOptions = {}) {
1862
- const root = drawOptions.root ?? new THREE.Group();
1897
+ const root = markKitOrigin(drawOptions.root ?? new THREE.Group(), { owner: "game-urban-three", kind: "urban" });
1863
1898
  const animators = [];
1864
1899
  const lights = [];
1865
1900
  const objects = [];
@@ -9074,34 +9109,6 @@ gl_Position = projectionMatrix * mvPosition;
9074
9109
  registerLocale("en", en_default);
9075
9110
  registerLocale("pt-BR", pt_BR_default);
9076
9111
 
9077
- // ../game-contracts/dist/index.js
9078
- var UNSAFE_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
9079
- var isPlainObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) && Object.getPrototypeOf(value) === Object.prototype;
9080
- var deepMerge = (base, patch) => {
9081
- if (!patch) return base;
9082
- const result = { ...base };
9083
- for (const [key, value] of Object.entries(patch)) {
9084
- if (value === void 0 || UNSAFE_KEYS.has(key)) continue;
9085
- const current = result[key];
9086
- result[key] = isPlainObject(current) && isPlainObject(value) ? deepMerge(current, value) : value;
9087
- }
9088
- return result;
9089
- };
9090
- var mergeById = (shipped, extra) => {
9091
- const entries = /* @__PURE__ */ new Map();
9092
- for (const entry of [...shipped, ...extra ?? []]) entries.set(entry.id, entry);
9093
- return entries;
9094
- };
9095
- var applyPatches = (entries, patches) => {
9096
- for (const [id, patch] of Object.entries(patches ?? {})) {
9097
- const entry = entries.get(id);
9098
- if (entry) entries.set(id, deepMerge(entry, patch));
9099
- }
9100
- };
9101
- var removeIds = (entries, ids) => {
9102
- for (const id of ids ?? []) entries.delete(id);
9103
- };
9104
-
9105
9112
  // ../game-vehicles-fleet/dist/index.js
9106
9113
  var cars = [
9107
9114
  "compact_hatch",