Browse Source

Clip,Action,Mixer -> Animation*

Ben Houston 10 years ago
parent
commit
c88066f50e
3 changed files with 22 additions and 22 deletions
  1. 7 7
      src/animation/AnimationAction.js
  2. 5 5
      src/animation/AnimationClip.js
  3. 10 10
      src/animation/AnimationMixer.js

+ 7 - 7
src/animation/Action.js → src/animation/AnimationAction.js

@@ -6,7 +6,7 @@
  * @author David Sarno / http://lighthaus.us/
  */
 
-THREE.Action = function ( clip, startTime, timeScale, weight, loop ) {
+THREE.AnimationAction = function ( clip, startTime, timeScale, weight, loop ) {
 
 	this.clip = clip;
 	this.startTime = startTime || 0;
@@ -18,13 +18,13 @@ THREE.Action = function ( clip, startTime, timeScale, weight, loop ) {
 	this.cache = {}; // track name, track, last evaluated time, last evaluated value (with weight included), keyIndex.
 };
 
-THREE.Action.prototype = {
+THREE.AnimationAction.prototype = {
 
-	constructor: THREE.Action,
+	constructor: THREE.AnimationAction,
 
-	toClipTime: function( time ) {
+	toAnimationClipTime: function( time ) {
 
-		console.log( 'Action[' + this.clip.name + '].toClipTime( ' + time + ' )' );
+		console.log( 'AnimationAction[' + this.clip.name + '].toAnimationClipTime( ' + time + ' )' );
 
 		var clipTime = time - this.startTime;
 
@@ -55,9 +55,9 @@ THREE.Action.prototype = {
 
 	getAt: function( time ) {
 
-		console.log( 'Action[' + this.clip.name + '].getAt( ' + time + ' )' );
+		console.log( 'AnimationAction[' + this.clip.name + '].getAt( ' + time + ' )' );
 
-		var clipTime = this.toClipTime( time );
+		var clipTime = this.toAnimationClipTime( time );
 
 		var clipResults = this.clip.getAt( clipTime );
 

+ 5 - 5
src/animation/Clip.js → src/animation/AnimationClip.js

@@ -2,13 +2,13 @@
  *
  * Reusable set of Tracks that represent an animation.
  *
- * TODO: MUST add support for importing Clips from JSONLoader data files.
+ * TODO: MUST add support for importing AnimationClips from JSONLoader data files.
  * 
  * @author Ben Houston / http://clara.io/
  * @author David Sarno / http://lighthaus.us/
  */
 
-THREE.Clip = function ( name, duration, tracks ) {
+THREE.AnimationClip = function ( name, duration, tracks ) {
 
 	this.name = name || "";
 	this.duration = duration || 0;
@@ -16,9 +16,9 @@ THREE.Clip = function ( name, duration, tracks ) {
 
 };
 
-THREE.Clip.prototype = {
+THREE.AnimationClip.prototype = {
 
-	constructor: THREE.Clip,
+	constructor: THREE.AnimationClip,
 
 	getAt: function( clipTime ) {
 
@@ -37,7 +37,7 @@ THREE.Clip.prototype = {
 
 	importFromData: function( data ) {
 
-		// TODO: Convert this copy-paste code from AnimationHandler into an importer into Tracks and Clips with some improvements to the track names
+		// TODO: Convert this copy-paste code from AnimationHandler into an importer into Tracks and AnimationClips with some improvements to the track names
 
 		if ( data.initialized === true ) return data;
 

+ 10 - 10
src/animation/Mixer.js → src/animation/AnimationMixer.js

@@ -1,14 +1,14 @@
 /**
  *
- * Mixes together the Clips scheduled by Actions and applies them to the root and subtree
+ * Mixes together the AnimationClips scheduled by AnimationActions and applies them to the root and subtree
  *
- * TODO: MUST add support for blending between Actions based on their weights, right now only the last Action is applied at full weight.
+ * TODO: MUST add support for blending between AnimationActions based on their weights, right now only the last AnimationAction is applied at full weight.
  *
  * @author Ben Houston / http://clara.io/
  * @author David Sarno / http://lighthaus.us/
  */
 
-THREE.Mixer = function( root ) {
+THREE.AnimationMixer = function( root ) {
 
 	this.root = root;
 	this.actions = [];
@@ -16,12 +16,12 @@ THREE.Mixer = function( root ) {
 
 };
 
-THREE.Mixer.prototype = {
+THREE.AnimationMixer.prototype = {
 
-	constructor: THREE.Mixer,
+	constructor: THREE.AnimationMixer,
 
-	addAction: function( action ) {
-		console.log( root.name + ".Mixer.addAction( " + action.name + " )" );
+	addAnimationAction: function( action ) {
+		console.log( root.name + ".AnimationMixer.addAnimationAction( " + action.name + " )" );
 
 		this.actions.push( action );
 
@@ -36,8 +36,8 @@ THREE.Mixer.prototype = {
 
 	},
 
-	removeAction: function( action ) {
-		console.log( root.name + ".Mixer.addRemove( " + action.name + " )" );
+	removeAnimationAction: function( action ) {
+		console.log( root.name + ".AnimationMixer.addRemove( " + action.name + " )" );
 
 		var index = this.actions.indexOf( action );
 
@@ -49,7 +49,7 @@ THREE.Mixer.prototype = {
 	},
 
 	update: function( time ) {
-		console.log( root.name + ".Mixer.update( " + time + " )" );
+		console.log( root.name + ".AnimationMixer.update( " + time + " )" );
 
 		var mixerResults = {};