sa2kit 1.0.5 → 1.0.6

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/mmd/index.js CHANGED
@@ -529,16 +529,47 @@ var MMDPlayerEnhanced = ({
529
529
  audioRef.current = null;
530
530
  }
531
531
  if (helperRef.current) {
532
+ console.log("\u{1F9F9} \u5F00\u59CB\u6E05\u7406 MMDAnimationHelper");
533
+ try {
534
+ helperRef.current.enable("animation", false);
535
+ helperRef.current.enable("ik", false);
536
+ helperRef.current.enable("grant", false);
537
+ helperRef.current.enable("physics", false);
538
+ console.log("\u2705 \u5DF2\u505C\u7528\u6240\u6709 helper \u7CFB\u7EDF");
539
+ } catch (error2) {
540
+ console.warn("\u26A0\uFE0F \u505C\u7528 helper \u7CFB\u7EDF\u5931\u8D25:", error2);
541
+ }
532
542
  try {
533
543
  const helperObjects = helperRef.current.objects;
534
544
  if (helperObjects && Array.isArray(helperObjects)) {
535
- console.log(`\u{1F9F9} \u6E05\u9664 helper \u4E2D\u7684 ${helperObjects.length} \u4E2A\u5BF9\u8C61`);
545
+ console.log(`\u{1F9F9} \u6E05\u9664 helper \u4E2D\u7684 ${helperObjects.length} \u4E2A\u5BF9\u8C61\uFF08\u5305\u62EC\u7269\u7406\u7CFB\u7EDF\uFF09`);
546
+ helperObjects.forEach((obj) => {
547
+ if (obj.physics) {
548
+ console.log("\u{1F527} \u6E05\u7406\u7269\u7406\u7CFB\u7EDF:", obj.mesh?.name || "unnamed");
549
+ try {
550
+ if (obj.physics.reset) {
551
+ obj.physics.reset();
552
+ }
553
+ if (obj.physics.world) {
554
+ const world = obj.physics.world;
555
+ while (world.getNumCollisionObjects() > 0) {
556
+ const body = world.getCollisionObjectArray().at(0);
557
+ world.removeCollisionObject(body);
558
+ }
559
+ }
560
+ obj.physics = null;
561
+ } catch (physicsError) {
562
+ console.warn("\u26A0\uFE0F \u6E05\u7406\u7269\u7406\u7CFB\u7EDF\u5931\u8D25:", physicsError);
563
+ }
564
+ }
565
+ });
536
566
  helperObjects.length = 0;
537
567
  }
538
568
  } catch (error2) {
539
- console.warn("\u26A0\uFE0F \u65E0\u6CD5\u8BBF\u95EE helper.objects\uFF0C\u521B\u5EFA\u65B0\u7684 helper:", error2);
569
+ console.warn("\u26A0\uFE0F \u65E0\u6CD5\u8BBF\u95EE helper.objects:", error2);
540
570
  }
541
571
  helperRef.current = null;
572
+ console.log("\u2705 MMDAnimationHelper \u6E05\u7406\u5B8C\u6210");
542
573
  }
543
574
  if (sceneRef.current.background && sceneRef.current.background.isTexture) {
544
575
  console.log("\u{1F9F9} \u6E05\u9664\u573A\u666F\u80CC\u666F\u8D34\u56FE");