소스 검색

Merge branch 'patch-1' of https://github.com/tormozok/three.js into dev

Mr.doob 10 년 전
부모
커밋
045c3bd77c
1개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. 6 2
      src/extras/objects/MorphBlendMesh.js

+ 6 - 2
src/extras/objects/MorphBlendMesh.js

@@ -299,8 +299,12 @@ THREE.MorphBlendMesh.prototype.update = function ( delta ) {
 
 		if ( animation.directionBackwards ) mix = 1 - mix;
 
-		this.morphTargetInfluences[ animation.currentFrame ] = mix * weight;
-		this.morphTargetInfluences[ animation.lastFrame ] = ( 1 - mix ) * weight;
+		if (animation.currentFrame !== animation.lastFrame) {
+			this.morphTargetInfluences[animation.currentFrame] = mix * weight;
+			this.morphTargetInfluences[animation.lastFrame] = ( 1 - mix ) * weight;
+		} else {
+			this.morphTargetInfluences[animation.currentFrame] = weight;
+		}
 
 	}