Browse Source

add ability to multiple QuaternionKeyframeTracks with quaternions.

Ben Houston 10 years ago
parent
commit
8b071b918e

+ 1 - 1
src/animation/tracks/BooleanKeyframeTrack.js

@@ -52,7 +52,7 @@ THREE.BooleanKeyframeTrack.prototype.clone = function() {
 		} );
 	}
 
-	return new THREE.BooleanKeyframeTrack( this.name );
+	return new THREE.BooleanKeyframeTrack( this.name, clonedKeys );
 
 };
 

+ 1 - 1
src/animation/tracks/ColorKeyframeTrack.js

@@ -52,7 +52,7 @@ THREE.ColorKeyframeTrack.prototype.clone = function() {
 		} );
 	}
 
-	return new THREE.ColorKeyframeTrack( this.name );
+	return new THREE.ColorKeyframeTrack( this.name, clonedKeys );
 
 };
 

+ 1 - 1
src/animation/tracks/NumberKeyframeTrack.js

@@ -52,7 +52,7 @@ THREE.NumberKeyframeTrack.prototype.clone = function() {
 		} );
 	}
 
-	return new THREE.NumberKeyframeTrack( this.name );
+	return new THREE.NumberKeyframeTrack( this.name, clonedKeys );
 
 };
 

+ 13 - 1
src/animation/tracks/QuaternionKeyframeTrack.js

@@ -39,6 +39,18 @@ THREE.QuaternionKeyframeTrack.prototype.compareValues = function( value0, value1
 
 };
 
+THREE.QuaternionKeyframeTrack.prototype.multiply = function( quat ) {
+
+	for( var i = 0; i < this.keys.length; i ++ ) {
+
+		this.keys[i].value.multiply( quat );
+		
+	}
+
+	return this;
+
+};
+
 THREE.QuaternionKeyframeTrack.prototype.clone = function() {
 
 	var clonedKeys = [];
@@ -52,7 +64,7 @@ THREE.QuaternionKeyframeTrack.prototype.clone = function() {
 		} );
 	}
 
-	return new THREE.QuaternionKeyframeTrack( this.name );
+	return new THREE.QuaternionKeyframeTrack( this.name, clonedKeys );
 
 };
 

+ 1 - 1
src/animation/tracks/StringKeyframeTrack.js

@@ -52,7 +52,7 @@ THREE.StringKeyframeTrack.prototype.clone = function() {
 		} );
 	}
 
-	return new THREE.StringKeyframeTrack( this.name );
+	return new THREE.StringKeyframeTrack( this.name, clonedKeys );
 
 };
 

+ 1 - 1
src/animation/tracks/VectorKeyframeTrack.js

@@ -52,7 +52,7 @@ THREE.VectorKeyframeTrack.prototype.clone = function() {
 		} );
 	}
 
-	return new THREE.VectorKeyframeTrack( this.name );
+	return new THREE.VectorKeyframeTrack( this.name, clonedKeys );
 
 };