@zephyr3d/scene 0.9.7 → 0.9.8
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/animation/animationset.js +52 -55
- package/dist/animation/animationset.js.map +1 -1
- package/dist/animation/joint_dynamics_modifier.js +19 -19
- package/dist/animation/joint_dynamics_modifier.js.map +1 -1
- package/dist/app/engine.js +131 -131
- package/dist/app/engine.js.map +1 -1
- package/dist/avatar/wardrobe.js +13 -13
- package/dist/avatar/wardrobe.js.map +1 -1
- package/dist/camera/camera.js +201 -201
- package/dist/camera/camera.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/material/mixins/lightmodel/pbrmetallicroughness.js +5 -5
- package/dist/material/mixins/lightmodel/pbrmetallicroughness.js.map +1 -1
- package/dist/material/mtoon.js +4 -4
- package/dist/material/mtoon.js.map +1 -1
- package/dist/material/pbrblueprint.js +11 -11
- package/dist/material/pbrblueprint.js.map +1 -1
- package/dist/material/shader/helper.js +284 -284
- package/dist/material/shader/helper.js.map +1 -1
- package/dist/posteffect/ssr.js +9 -9
- package/dist/posteffect/ssr.js.map +1 -1
- package/dist/render/lightpass.js +5 -5
- package/dist/render/lightpass.js.map +1 -1
- package/dist/render/renderer.js +7 -7
- package/dist/render/renderer.js.map +1 -1
- package/dist/shadow/esm.js +1 -1
- package/dist/shadow/esm.js.map +1 -1
- package/dist/shadow/shadow_region.js +45 -45
- package/dist/shadow/shadow_region.js.map +1 -1
- package/dist/utility/serialization/manager.js +275 -275
- package/dist/utility/serialization/manager.js.map +1 -1
- package/dist/utility/serialization/scene/camera.js.map +1 -1
- package/dist/utility/serialization/scene/mesh.js.map +1 -1
- package/dist/utility/serialization/scene/sprite.js.map +1 -1
- package/package.json +1 -1
|
@@ -641,7 +641,7 @@ function bakeHumanoidRotationTracks(sourceClip, srcSkeleton, dstSkeleton, srcRoo
|
|
|
641
641
|
* Start (or update) playback of an animation clip.
|
|
642
642
|
*
|
|
643
643
|
* Behavior:
|
|
644
|
-
* - If the clip is already playing,
|
|
644
|
+
* - If the clip is already playing, stops it first.
|
|
645
645
|
* - Otherwise initializes playback state (repeat counter, speed, weight, initial time).
|
|
646
646
|
* - Registers clip tracks and skeletons into the active sets for blending and application.
|
|
647
647
|
*
|
|
@@ -653,62 +653,59 @@ function bakeHumanoidRotationTracks(sourceClip, srcSkeleton, dstSkeleton, srcRoo
|
|
|
653
653
|
console.error(`Animation ${name} not exists`);
|
|
654
654
|
return;
|
|
655
655
|
}
|
|
656
|
+
if (this.isPlayingAnimation(name)) {
|
|
657
|
+
this.stopAnimation(name);
|
|
658
|
+
}
|
|
656
659
|
const fadeIn = Math.max(options?.fadeIn ?? 0, 0);
|
|
657
|
-
const
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
const blendId = track.getBlendId();
|
|
685
|
-
let blendedTracks = nodeTracks.get(blendId);
|
|
686
|
-
if (!blendedTracks) {
|
|
687
|
-
blendedTracks = [];
|
|
688
|
-
nodeTracks.set(blendId, blendedTracks);
|
|
689
|
-
}
|
|
690
|
-
blendedTracks.push(track);
|
|
691
|
-
}
|
|
692
|
-
});
|
|
693
|
-
ani.skeletons?.forEach((v, k)=>{
|
|
694
|
-
const rig = this.model.findSkeletonRigById(k);
|
|
695
|
-
if (rig) {
|
|
696
|
-
const refcount = this._activeRigs.get(rig);
|
|
697
|
-
this._activeRigs.set(rig, refcount ? refcount + 1 : 1);
|
|
698
|
-
rig.playing = true;
|
|
699
|
-
return;
|
|
700
|
-
}
|
|
701
|
-
const binding = this.model.findSkinBindingById(k);
|
|
702
|
-
if (binding) {
|
|
703
|
-
const refcount = this._activeSkinBindings.get(binding);
|
|
704
|
-
this._activeSkinBindings.set(binding, refcount ? refcount + 1 : 1);
|
|
705
|
-
binding.playing = true;
|
|
706
|
-
const rigRefcount = this._activeRigs.get(binding.rig);
|
|
707
|
-
this._activeRigs.set(binding.rig, rigRefcount ? rigRefcount + 1 : 1);
|
|
708
|
-
binding.rig.playing = true;
|
|
660
|
+
const repeat = options?.repeat ?? 0;
|
|
661
|
+
const speedRatio = options?.speedRatio ?? 1;
|
|
662
|
+
const weight = options?.weight ?? ani.weight ?? 1;
|
|
663
|
+
this._activeAnimations.set(ani, {
|
|
664
|
+
repeat,
|
|
665
|
+
weight,
|
|
666
|
+
speedRatio,
|
|
667
|
+
fadeIn,
|
|
668
|
+
fadeOut: 0,
|
|
669
|
+
repeatCounter: 0,
|
|
670
|
+
currentTime: speedRatio < 0 ? ani.timeDuration : 0,
|
|
671
|
+
animateTime: 0,
|
|
672
|
+
fadeOutStart: 0,
|
|
673
|
+
firstFrame: true
|
|
674
|
+
});
|
|
675
|
+
ani.tracks?.forEach((v, k)=>{
|
|
676
|
+
let nodeTracks = this._activeTracks.get(k);
|
|
677
|
+
if (!nodeTracks) {
|
|
678
|
+
nodeTracks = new Map();
|
|
679
|
+
this._activeTracks.set(k, nodeTracks);
|
|
680
|
+
}
|
|
681
|
+
for (const track of v){
|
|
682
|
+
const blendId = track.getBlendId();
|
|
683
|
+
let blendedTracks = nodeTracks.get(blendId);
|
|
684
|
+
if (!blendedTracks) {
|
|
685
|
+
blendedTracks = [];
|
|
686
|
+
nodeTracks.set(blendId, blendedTracks);
|
|
709
687
|
}
|
|
710
|
-
|
|
711
|
-
|
|
688
|
+
blendedTracks.push(track);
|
|
689
|
+
}
|
|
690
|
+
});
|
|
691
|
+
ani.skeletons?.forEach((v, k)=>{
|
|
692
|
+
const rig = this.model.findSkeletonRigById(k);
|
|
693
|
+
if (rig) {
|
|
694
|
+
const refcount = this._activeRigs.get(rig);
|
|
695
|
+
this._activeRigs.set(rig, refcount ? refcount + 1 : 1);
|
|
696
|
+
rig.playing = true;
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
699
|
+
const binding = this.model.findSkinBindingById(k);
|
|
700
|
+
if (binding) {
|
|
701
|
+
const refcount = this._activeSkinBindings.get(binding);
|
|
702
|
+
this._activeSkinBindings.set(binding, refcount ? refcount + 1 : 1);
|
|
703
|
+
binding.playing = true;
|
|
704
|
+
const rigRefcount = this._activeRigs.get(binding.rig);
|
|
705
|
+
this._activeRigs.set(binding.rig, rigRefcount ? rigRefcount + 1 : 1);
|
|
706
|
+
binding.rig.playing = true;
|
|
707
|
+
}
|
|
708
|
+
});
|
|
712
709
|
}
|
|
713
710
|
/**
|
|
714
711
|
* Stop playback of an animation clip.
|