|
@@ -27,12 +27,14 @@ function AnimationMixer( root ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
-Object.assign( AnimationMixer.prototype, EventDispatcher.prototype, {
|
|
|
+AnimationMixer.prototype = {
|
|
|
+
|
|
|
+ constructor: AnimationMixer,
|
|
|
|
|
|
// return an action for a clip optionally using a custom root target
|
|
|
// object (this method allocates a lot of dynamic memory in case a
|
|
|
// previously unknown clip/root combination is specified)
|
|
|
- clipAction: function( clip, optionalRoot ) {
|
|
|
+ clipAction: function ( clip, optionalRoot ) {
|
|
|
|
|
|
var root = optionalRoot || this._root,
|
|
|
rootUuid = root.uuid,
|
|
@@ -273,13 +275,13 @@ Object.assign( AnimationMixer.prototype, EventDispatcher.prototype, {
|
|
|
|
|
|
}
|
|
|
|
|
|
-} );
|
|
|
+};
|
|
|
|
|
|
// Implementation details:
|
|
|
|
|
|
Object.assign( AnimationMixer.prototype, {
|
|
|
|
|
|
- _bindAction: function( action, prototypeAction ) {
|
|
|
+ _bindAction: function ( action, prototypeAction ) {
|
|
|
|
|
|
var root = action._localRoot || this._root,
|
|
|
tracks = action._clip.tracks,
|
|
@@ -346,7 +348,7 @@ Object.assign( AnimationMixer.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- _activateAction: function( action ) {
|
|
|
+ _activateAction: function ( action ) {
|
|
|
|
|
|
if ( ! this._isActiveAction( action ) ) {
|
|
|
|
|
@@ -388,7 +390,7 @@ Object.assign( AnimationMixer.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- _deactivateAction: function( action ) {
|
|
|
+ _deactivateAction: function ( action ) {
|
|
|
|
|
|
if ( this._isActiveAction( action ) ) {
|
|
|
|
|
@@ -416,7 +418,7 @@ Object.assign( AnimationMixer.prototype, {
|
|
|
|
|
|
// Memory manager
|
|
|
|
|
|
- _initMemoryManager: function() {
|
|
|
+ _initMemoryManager: function () {
|
|
|
|
|
|
this._actions = []; // 'nActiveActions' followed by inactive ones
|
|
|
this._nActiveActions = 0;
|
|
@@ -461,14 +463,14 @@ Object.assign( AnimationMixer.prototype, {
|
|
|
|
|
|
// Memory management for AnimationAction objects
|
|
|
|
|
|
- _isActiveAction: function( action ) {
|
|
|
+ _isActiveAction: function ( action ) {
|
|
|
|
|
|
var index = action._cacheIndex;
|
|
|
return index !== null && index < this._nActiveActions;
|
|
|
|
|
|
},
|
|
|
|
|
|
- _addInactiveAction: function( action, clipUuid, rootUuid ) {
|
|
|
+ _addInactiveAction: function ( action, clipUuid, rootUuid ) {
|
|
|
|
|
|
var actions = this._actions,
|
|
|
actionsByClip = this._actionsByClip,
|
|
@@ -503,7 +505,7 @@ Object.assign( AnimationMixer.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- _removeInactiveAction: function( action ) {
|
|
|
+ _removeInactiveAction: function ( action ) {
|
|
|
|
|
|
var actions = this._actions,
|
|
|
lastInactiveAction = actions[ actions.length - 1 ],
|
|
@@ -548,7 +550,7 @@ Object.assign( AnimationMixer.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- _removeInactiveBindingsForAction: function( action ) {
|
|
|
+ _removeInactiveBindingsForAction: function ( action ) {
|
|
|
|
|
|
var bindings = action._propertyBindings;
|
|
|
for ( var i = 0, n = bindings.length; i !== n; ++ i ) {
|
|
@@ -565,7 +567,7 @@ Object.assign( AnimationMixer.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- _lendAction: function( action ) {
|
|
|
+ _lendAction: function ( action ) {
|
|
|
|
|
|
// [ active actions | inactive actions ]
|
|
|
// [ active actions >| inactive actions ]
|
|
@@ -588,7 +590,7 @@ Object.assign( AnimationMixer.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- _takeBackAction: function( action ) {
|
|
|
+ _takeBackAction: function ( action ) {
|
|
|
|
|
|
// [ active actions | inactive actions ]
|
|
|
// [ active actions |< inactive actions ]
|
|
@@ -613,7 +615,7 @@ Object.assign( AnimationMixer.prototype, {
|
|
|
|
|
|
// Memory management for PropertyMixer objects
|
|
|
|
|
|
- _addInactiveBinding: function( binding, rootUuid, trackName ) {
|
|
|
+ _addInactiveBinding: function ( binding, rootUuid, trackName ) {
|
|
|
|
|
|
var bindingsByRoot = this._bindingsByRootAndName,
|
|
|
bindingByName = bindingsByRoot[ rootUuid ],
|
|
@@ -634,7 +636,7 @@ Object.assign( AnimationMixer.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- _removeInactiveBinding: function( binding ) {
|
|
|
+ _removeInactiveBinding: function ( binding ) {
|
|
|
|
|
|
var bindings = this._bindings,
|
|
|
propBinding = binding.binding,
|
|
@@ -662,7 +664,7 @@ Object.assign( AnimationMixer.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- _lendBinding: function( binding ) {
|
|
|
+ _lendBinding: function ( binding ) {
|
|
|
|
|
|
var bindings = this._bindings,
|
|
|
prevIndex = binding._cacheIndex,
|
|
@@ -679,7 +681,7 @@ Object.assign( AnimationMixer.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- _takeBackBinding: function( binding ) {
|
|
|
+ _takeBackBinding: function ( binding ) {
|
|
|
|
|
|
var bindings = this._bindings,
|
|
|
prevIndex = binding._cacheIndex,
|
|
@@ -699,7 +701,7 @@ Object.assign( AnimationMixer.prototype, {
|
|
|
|
|
|
// Memory management of Interpolants for weight and time scale
|
|
|
|
|
|
- _lendControlInterpolant: function() {
|
|
|
+ _lendControlInterpolant: function () {
|
|
|
|
|
|
var interpolants = this._controlInterpolants,
|
|
|
lastActiveIndex = this._nActiveControlInterpolants ++,
|
|
@@ -720,7 +722,7 @@ Object.assign( AnimationMixer.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- _takeBackControlInterpolant: function( interpolant ) {
|
|
|
+ _takeBackControlInterpolant: function ( interpolant ) {
|
|
|
|
|
|
var interpolants = this._controlInterpolants,
|
|
|
prevIndex = interpolant.__cacheIndex,
|
|
@@ -741,5 +743,6 @@ Object.assign( AnimationMixer.prototype, {
|
|
|
|
|
|
} );
|
|
|
|
|
|
+Object.assign( AnimationMixer.prototype, EventDispatcher.prototype );
|
|
|
|
|
|
export { AnimationMixer };
|