Buckets:
| ; | |
| Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); | |
| const THREE = require("three"); | |
| class MorphAnimMesh extends THREE.Mesh { | |
| constructor(geometry, material) { | |
| super(geometry, material); | |
| this.type = "MorphAnimMesh"; | |
| this.mixer = new THREE.AnimationMixer(this); | |
| this.activeAction = null; | |
| } | |
| setDirectionForward() { | |
| this.mixer.timeScale = 1; | |
| } | |
| setDirectionBackward() { | |
| this.mixer.timeScale = -1; | |
| } | |
| playAnimation(label, fps) { | |
| if (this.activeAction) { | |
| this.activeAction.stop(); | |
| this.activeAction = null; | |
| } | |
| const clip = THREE.AnimationClip.findByName(this, label); | |
| if (clip) { | |
| const action = this.mixer.clipAction(clip); | |
| action.timeScale = clip.tracks.length * fps / clip.duration; | |
| this.activeAction = action.play(); | |
| } else { | |
| throw new Error("THREE.MorphAnimMesh: animations[" + label + "] undefined in .playAnimation()"); | |
| } | |
| } | |
| updateAnimation(delta) { | |
| this.mixer.update(delta); | |
| } | |
| copy(source, recursive) { | |
| super.copy(source, recursive); | |
| this.mixer = new THREE.AnimationMixer(this); | |
| return this; | |
| } | |
| } | |
| exports.MorphAnimMesh = MorphAnimMesh; | |
| //# sourceMappingURL=MorphAnimMesh.cjs.map | |
Xet Storage Details
- Size:
- 1.23 kB
- Xet hash:
- 6ab7d3051a0833400f490881596f46197b4e714079b2a74a3da02655b7623fe5
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.