Skip to content

Commit

Permalink
More Animation fixes. See #4377.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Feb 5, 2014
1 parent 092e3ad commit 4a80dff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/extras/animation/Animation.js
Expand Up @@ -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();

}

Expand Down Expand Up @@ -230,8 +231,6 @@ THREE.Animation.prototype.update = function ( delta ) {

if ( this.currentTime > duration ) {

this.reset();

if ( this.loop === false ) {

this.stop();
Expand Down
2 changes: 1 addition & 1 deletion src/extras/animation/KeyFrameAnimation.js
Expand Up @@ -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;

Expand Down

0 comments on commit 4a80dff

Please sign in to comment.