Преглед на файлове

AnimationClip: Revert .trim() changes, remove temp changes.

Don McCurdy преди 7 години
родител
ревизия
2321a4b492
променени са 3 файла, в които са добавени 5 реда и са изтрити 36 реда
  1. 2 2
      docs/api/en/animation/AnimationUtils.html
  2. 3 31
      src/animation/AnimationClip.js
  3. 0 3
      src/animation/KeyframeTrack.js

+ 2 - 2
docs/api/en/animation/AnimationUtils.html

@@ -49,9 +49,9 @@
 		</p>
 
 		<h3>[method:AnimationClip subclip]( [param:AnimationClip clip], [param:String name], [param:Number startFrame], [param:Number endFrame], [param:Number fps] )</h3>
-		<div>
+		<p>
 		Creates a new clip, containing only the segment of the original clip between the given frames.
-		</div>
+		</p>
 
 		<h2>Source</h2>
 

+ 3 - 31
src/animation/AnimationClip.js

@@ -409,42 +409,14 @@ Object.assign( AnimationClip.prototype, {
 
 	},
 
-	trim: function ( startTime, endTime ) {
+	trim: function () {
 
-		if ( startTime === undefined ) startTime = 0;
-		if ( endTime === undefined ) endTime = this.duration;
-
-		var tracks = [];
-
-		for ( var i = 0; i < this.tracks.length; ++ i ) {
-
-			var track = this.tracks[ i ];
-
-			var hasKeyframe = false;
-
-			// omit tracks without frames between new start/end times
-			for ( var j = 0; j < track.times.length; ++ j ) {
-
-				if ( startTime <= track.times[ j ] && endTime > track.times [ j ] ) {
-
-					hasKeyframe = true;
-
-					break;
-
-				}
-
-			}
-
-			if ( ! hasKeyframe ) continue;
-
-			this.tracks[ i ].trim( startTime, endTime );
+		for ( var i = 0; i < this.tracks.length; i ++ ) {
 
-			tracks.push( this.tracks[ i ] );
+			this.tracks[ i ].trim( 0, this.duration );
 
 		}
 
-		this.tracks = tracks;
-
 		return this;
 
 	},

+ 0 - 3
src/animation/KeyframeTrack.js

@@ -347,9 +347,6 @@ Object.assign( KeyframeTrack.prototype, {
 	// (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --> (0,0,1,1,0,0)
 	optimize: function () {
 
-		// TODO: Opt-out of optimization?
-		return this;
-
 		var times = this.times,
 			values = this.values,
 			stride = this.getValueSize(),