|
35444 | 35444 |
|
35445 | 35445 | this.setInterpolation( interpolation || this.DefaultInterpolation ); |
35446 | 35446 |
|
35447 | | - this.validate(); |
35448 | | - this.optimize(); |
35449 | | - |
35450 | 35447 | } |
35451 | 35448 |
|
35452 | 35449 | // Static methods |
@@ -35571,12 +35568,14 @@ |
35571 | 35568 | } |
35572 | 35569 |
|
35573 | 35570 | console.warn( 'THREE.KeyframeTrack:', message ); |
35574 | | - return; |
| 35571 | + return this; |
35575 | 35572 |
|
35576 | 35573 | } |
35577 | 35574 |
|
35578 | 35575 | this.createInterpolant = factoryMethod; |
35579 | 35576 |
|
| 35577 | + return this; |
| 35578 | + |
35580 | 35579 | }, |
35581 | 35580 |
|
35582 | 35581 | getInterpolation: function () { |
|
36113 | 36112 |
|
36114 | 36113 | } |
36115 | 36114 |
|
36116 | | - this.optimize(); |
36117 | | - |
36118 | 36115 | } |
36119 | 36116 |
|
36120 | 36117 | function getTrackTypeForValueTypeName( typeName ) { |
|
36489 | 36486 |
|
36490 | 36487 | this.duration = duration; |
36491 | 36488 |
|
| 36489 | + return this; |
| 36490 | + |
36492 | 36491 | }, |
36493 | 36492 |
|
36494 | 36493 | trim: function () { |
|
36503 | 36502 |
|
36504 | 36503 | }, |
36505 | 36504 |
|
| 36505 | + validate: function () { |
| 36506 | + |
| 36507 | + var valid = true; |
| 36508 | + |
| 36509 | + for ( var i = 0; i < this.tracks.length; i ++ ) { |
| 36510 | + |
| 36511 | + valid = valid && this.tracks[ i ].validate(); |
| 36512 | + |
| 36513 | + } |
| 36514 | + |
| 36515 | + return valid; |
| 36516 | + |
| 36517 | + }, |
| 36518 | + |
36506 | 36519 | optimize: function () { |
36507 | 36520 |
|
36508 | 36521 | for ( var i = 0; i < this.tracks.length; i ++ ) { |
@@ -41843,13 +41856,19 @@ |
41843 | 41856 | _updateTime: function ( deltaTime ) { |
41844 | 41857 |
|
41845 | 41858 | var time = this.time + deltaTime; |
| 41859 | + var duration = this._clip.duration; |
| 41860 | + var loop = this.loop; |
| 41861 | + var loopCount = this._loopCount; |
| 41862 | + |
| 41863 | + var pingPong = ( loop === LoopPingPong ); |
41846 | 41864 |
|
41847 | | - if ( deltaTime === 0 ) return time; |
| 41865 | + if ( deltaTime === 0 ) { |
41848 | 41866 |
|
41849 | | - var duration = this._clip.duration, |
| 41867 | + if ( loopCount === - 1 ) return time; |
41850 | 41868 |
|
41851 | | - loop = this.loop, |
41852 | | - loopCount = this._loopCount; |
| 41869 | + return ( pingPong && ( loopCount & 1 ) === 1 ) ? duration - time : time; |
| 41870 | + |
| 41871 | + } |
41853 | 41872 |
|
41854 | 41873 | if ( loop === LoopOnce ) { |
41855 | 41874 |
|
|
41886 | 41905 |
|
41887 | 41906 | } else { // repetitive Repeat or PingPong |
41888 | 41907 |
|
41889 | | - var pingPong = ( loop === LoopPingPong ); |
41890 | | - |
41891 | 41908 | if ( loopCount === - 1 ) { |
41892 | 41909 |
|
41893 | 41910 | // just started |
|
0 commit comments