@adatechnology/game-animals-three 0.4.36 → 0.4.38

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.
@@ -85,6 +85,8 @@ var GameAnimalsThree = (() => {
85
85
  function drainDetached(queue, budgetMs, clock = () => performance.now()) {
86
86
  return queue.run(clock() + budgetMs, clock);
87
87
  }
88
+ var BODY_FOAM_SURFACES = ["hands", "arms", "torso", "hair", "mouth"];
89
+ var WASH_SURFACES = [...BODY_FOAM_SURFACES, "brush"];
88
90
  var KIT_ORIGIN_KEY = "kitOrigin";
89
91
  function markKitOrigin(object2, origin) {
90
92
  const node = object2;
@@ -3394,13 +3396,16 @@ var GameAnimalsThree = (() => {
3394
3396
  for (const u of Object.values(uniforms)) if (isTexture(u?.value)) out.add(u.value);
3395
3397
  }
3396
3398
  }
3399
+ var isInstanced = (o) => o.isInstancedMesh === true;
3397
3400
  function collect(roots) {
3398
3401
  const geometries = /* @__PURE__ */ new Set();
3399
3402
  const materials = /* @__PURE__ */ new Set();
3400
3403
  const textures = /* @__PURE__ */ new Set();
3401
3404
  const skeletons = /* @__PURE__ */ new Set();
3405
+ const instanced = /* @__PURE__ */ new Set();
3402
3406
  for (const root of roots) {
3403
3407
  root.traverse((object2) => {
3408
+ if (isInstanced(object2)) instanced.add(object2);
3404
3409
  const o = object2;
3405
3410
  if (o.geometry && typeof o.geometry.dispose === "function") geometries.add(o.geometry);
3406
3411
  if (o.skeleton && typeof o.skeleton.dispose === "function") skeletons.add(o.skeleton);
@@ -3412,7 +3417,7 @@ var GameAnimalsThree = (() => {
3412
3417
  }
3413
3418
  });
3414
3419
  }
3415
- return { geometries, materials, textures, skeletons };
3420
+ return { geometries, materials, textures, skeletons, instanced };
3416
3421
  }
3417
3422
  var marked = /* @__PURE__ */ new WeakSet();
3418
3423
  var shared = (r) => r.userData?.shared === true || marked.has(r);
@@ -3457,6 +3462,7 @@ var GameAnimalsThree = (() => {
3457
3462
  report.textures++;
3458
3463
  }
3459
3464
  for (const s of found.skeletons) s.dispose();
3465
+ for (const mesh2 of found.instanced) mesh2.dispose();
3460
3466
  return report;
3461
3467
  }
3462
3468
  function discardObject3D(objects, options = {}) {