@adatechnology/game-animals-three 0.4.36 → 0.4.37

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.
@@ -3394,13 +3394,16 @@ var GameAnimalsThree = (() => {
3394
3394
  for (const u of Object.values(uniforms)) if (isTexture(u?.value)) out.add(u.value);
3395
3395
  }
3396
3396
  }
3397
+ var isInstanced = (o) => o.isInstancedMesh === true;
3397
3398
  function collect(roots) {
3398
3399
  const geometries = /* @__PURE__ */ new Set();
3399
3400
  const materials = /* @__PURE__ */ new Set();
3400
3401
  const textures = /* @__PURE__ */ new Set();
3401
3402
  const skeletons = /* @__PURE__ */ new Set();
3403
+ const instanced = /* @__PURE__ */ new Set();
3402
3404
  for (const root of roots) {
3403
3405
  root.traverse((object2) => {
3406
+ if (isInstanced(object2)) instanced.add(object2);
3404
3407
  const o = object2;
3405
3408
  if (o.geometry && typeof o.geometry.dispose === "function") geometries.add(o.geometry);
3406
3409
  if (o.skeleton && typeof o.skeleton.dispose === "function") skeletons.add(o.skeleton);
@@ -3412,7 +3415,7 @@ var GameAnimalsThree = (() => {
3412
3415
  }
3413
3416
  });
3414
3417
  }
3415
- return { geometries, materials, textures, skeletons };
3418
+ return { geometries, materials, textures, skeletons, instanced };
3416
3419
  }
3417
3420
  var marked = /* @__PURE__ */ new WeakSet();
3418
3421
  var shared = (r) => r.userData?.shared === true || marked.has(r);
@@ -3457,6 +3460,7 @@ var GameAnimalsThree = (() => {
3457
3460
  report.textures++;
3458
3461
  }
3459
3462
  for (const s of found.skeletons) s.dispose();
3463
+ for (const mesh2 of found.instanced) mesh2.dispose();
3460
3464
  return report;
3461
3465
  }
3462
3466
  function discardObject3D(objects, options = {}) {