2
0
Mr.doob 11 жил өмнө
parent
commit
4a80dffab7

+ 2 - 3
src/extras/animation/Animation.js

@@ -115,9 +115,10 @@ THREE.Animation.prototype.update = function ( delta ) {
 
 	var duration = this.data.length;
 
-	if ( this.loop === true ) {
+	if ( this.loop === true && this.currentTime > duration ) {
 
 		this.currentTime %= duration;
+		this.reset();
 
 	}
 
@@ -230,8 +231,6 @@ THREE.Animation.prototype.update = function ( delta ) {
 
 	if ( this.currentTime > duration ) {
 
-		this.reset();
-
 		if ( this.loop === false ) {
 
 			this.stop();

+ 1 - 1
src/extras/animation/KeyFrameAnimation.js

@@ -178,7 +178,7 @@ THREE.KeyFrameAnimation.prototype.update = function ( delta ) {
 
 	var duration = this.data.length;
 
-	if ( this.loop === true ) {
+	if ( this.loop === true && this.currentTime > duration ) {
 
 		this.currentTime %= duration;