Browse Source

BlendCharacter example mostly working with new animation system.

Ben Houston 10 years ago
parent
commit
bfee311b19
1 changed files with 7 additions and 3 deletions
  1. 7 3
      examples/js/BlendCharacter.js

+ 7 - 3
examples/js/BlendCharacter.js

@@ -40,19 +40,21 @@ THREE.BlendCharacter = function () {
 
 	this.update = function( dt ) {
 
-		scope.mixer.update( dt );
+		this.mixer.update( dt );
 
 	};
 
 	this.play = function( animName, weight ) {
 
-		this.removeAllActions();
+		this.mixer.removeAllActions();
 		this.mixer.play( new THREE.AnimationAction( this.animations[ animName ], 0, 1, 1, true ) );
 
 	};
 
 	this.crossfade = function( fromAnimName, toAnimName, duration ) {
 
+		this.mixer.removeAllActions();
+
 		var fromAction = new THREE.AnimationAction( this.animations[ fromAnimName ], 0, 1, 1, true );
 		var toAction = new THREE.AnimationAction( this.animations[ toAnimName ], 0, 1, 1, true );
 
@@ -65,6 +67,8 @@ THREE.BlendCharacter = function () {
 
 	this.warp = function( fromAnimName, toAnimName, duration ) {
 
+		this.mixer.removeAllActions();
+
 		var fromAction = new THREE.AnimationAction( this.animations[ fromAnimName ], 0, 1, 1, true );
 		var toAction = new THREE.AnimationAction( this.animations[ toAnimName ], 0, 1, 1, true );
 
@@ -98,7 +102,7 @@ THREE.BlendCharacter = function () {
 
 	this.stopAll = function() {
 
-		this.removeAllActions();
+		this.mixer.removeAllActions();
 
 	};