浏览代码

More Animation related clean up.
This is a bit of a mess... :/

Mr.doob 11 年之前
父节点
当前提交
6c6d6a7875

+ 1 - 1
examples/canvas_morphtargets_horse.html

@@ -60,7 +60,7 @@
 				scene.add( light );
 				scene.add( light );
 
 
 				var loader = new THREE.JSONLoader( true );
 				var loader = new THREE.JSONLoader( true );
-				loader.load( "models/animated/horse.js", function( geometry ) {
+				loader.load( "models/animated/horse.js", function ( geometry ) {
 
 
 					mesh = new THREE.Mesh( geometry, new THREE.MeshLambertMaterial( { color: 0x606060, morphTargets: true, overdraw: 0.5 } ) );
 					mesh = new THREE.Mesh( geometry, new THREE.MeshLambertMaterial( { color: 0x606060, morphTargets: true, overdraw: 0.5 } ) );
 					mesh.scale.set( 1.5, 1.5, 1.5 );
 					mesh.scale.set( 1.5, 1.5, 1.5 );

+ 4 - 1
examples/js/controls/PathControls.js

@@ -217,7 +217,10 @@ THREE.PathControls = function ( object, domElement ) {
 
 
 		THREE.AnimationHandler.add( animationData );
 		THREE.AnimationHandler.add( animationData );
 
 
-		return new THREE.Animation( parent, name, THREE.AnimationHandler.CATMULLROM_FORWARD, false );
+		var animation = new THREE.Animation( parent, name );
+		animation.interpolationType = THREE.AnimationHandler.CATMULLROM_FORWARD;
+
+		return animation;
 
 
 	};
 	};
 
 

+ 1 - 1
examples/misc_animation_keys.html

@@ -126,7 +126,7 @@
 				ensureLoop( sphereMesh.animation );
 				ensureLoop( sphereMesh.animation );
 				THREE.AnimationHandler.add( sphereMesh.animation );
 				THREE.AnimationHandler.add( sphereMesh.animation );
 												
 												
-				var sphereMeshAnimation = new THREE.Animation( sphereMesh, sphereMesh.animation.name, THREE.AnimationHandler.LINEAR )
+				var sphereMeshAnimation = new THREE.Animation( sphereMesh, sphereMesh.animation.name )
 				sphereMeshAnimation.play();
 				sphereMeshAnimation.play();
 				
 				
 				scene.add( sphereMesh );
 				scene.add( sphereMesh );

+ 1 - 4
examples/webgl_loader_collada_skinning.html

@@ -93,10 +93,7 @@
 
 
 						THREE.AnimationHandler.add( skin.geometry.animation );
 						THREE.AnimationHandler.add( skin.geometry.animation );
 
 
-						var animation = new THREE.Animation(
-							skin,
-							skin.geometry.animation.name
-						  );
+						var animation = new THREE.Animation( skin, skin.geometry.animation.name );
 						// animation.loop = false;
 						// animation.loop = false;
 						animation.play();
 						animation.play();
 						
 						

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

@@ -4,7 +4,7 @@
  * @author alteredq / http://alteredqualia.com/
  * @author alteredq / http://alteredqualia.com/
  */
  */
 
 
-THREE.Animation = function ( root, name, interpolationType ) {
+THREE.Animation = function ( root, name ) {
 
 
 	this.root = root;
 	this.root = root;
 	this.data = THREE.AnimationHandler.get( name );
 	this.data = THREE.AnimationHandler.get( name );
@@ -17,7 +17,7 @@ THREE.Animation = function ( root, name, interpolationType ) {
 	this.isPaused = true;
 	this.isPaused = true;
 	this.loop = true;
 	this.loop = true;
 
 
-	this.interpolationType = interpolationType !== undefined ? interpolationType : THREE.AnimationHandler.LINEAR;
+	this.interpolationType = THREE.AnimationHandler.LINEAR;
 
 
 	this.points = [];
 	this.points = [];
 	this.target = new THREE.Vector3();
 	this.target = new THREE.Vector3();