Selaa lähdekoodia

KeyframeTrack: Converted Object.assign() with *.prototype.*

Mr.doob 4 vuotta sitten
vanhempi
commit
6100437b3e

+ 3 - 9
src/animation/KeyframeTrack.js

@@ -455,14 +455,8 @@ class KeyframeTrack {
 
 
 }
 }
 
 
-Object.assign( KeyframeTrack.prototype, {
-
-	TimeBufferType: Float32Array,
-
-	ValueBufferType: Float32Array,
-
-	DefaultInterpolation: InterpolateLinear,
-
-} );
+KeyframeTrack.prototype.TimeBufferType = Float32Array;
+KeyframeTrack.prototype.ValueBufferType = Float32Array;
+KeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear;
 
 
 export { KeyframeTrack };
 export { KeyframeTrack };

+ 9 - 15
src/animation/tracks/BooleanKeyframeTrack.js

@@ -6,20 +6,14 @@ import { KeyframeTrack } from '../KeyframeTrack.js';
  */
  */
 class BooleanKeyframeTrack extends KeyframeTrack {}
 class BooleanKeyframeTrack extends KeyframeTrack {}
 
 
-Object.assign( BooleanKeyframeTrack.prototype, {
-
-	ValueTypeName: 'bool',
-	ValueBufferType: Array,
-
-	DefaultInterpolation: InterpolateDiscrete,
-
-	InterpolantFactoryMethodLinear: undefined,
-	InterpolantFactoryMethodSmooth: undefined
-
-	// Note: Actually this track could have a optimized / compressed
-	// representation of a single value and a custom interpolant that
-	// computes "firstValue ^ isOdd( index )".
-
-} );
+BooleanKeyframeTrack.prototype.ValueTypeName = 'bool';
+BooleanKeyframeTrack.prototype.ValueBufferType = Array;
+BooleanKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete;
+BooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear = undefined;
+BooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined;
+
+// Note: Actually this track could have a optimized / compressed
+// representation of a single value and a custom interpolant that
+// computes "firstValue ^ isOdd( index )".
 
 
 export { BooleanKeyframeTrack };
 export { BooleanKeyframeTrack };

+ 5 - 11
src/animation/tracks/ColorKeyframeTrack.js

@@ -5,17 +5,11 @@ import { KeyframeTrack } from '../KeyframeTrack.js';
  */
  */
 class ColorKeyframeTrack extends KeyframeTrack {}
 class ColorKeyframeTrack extends KeyframeTrack {}
 
 
-Object.assign( ColorKeyframeTrack.prototype, {
+ColorKeyframeTrack.prototype.ValueTypeName = 'color';
+// ValueBufferType is inherited
+// DefaultInterpolation is inherited
 
 
-	ValueTypeName: 'color'
-
-	// ValueBufferType is inherited
-
-	// DefaultInterpolation is inherited
-
-	// Note: Very basic implementation and nothing special yet.
-	// However, this is the place for color space parameterization.
-
-} );
+// Note: Very basic implementation and nothing special yet.
+// However, this is the place for color space parameterization.
 
 
 export { ColorKeyframeTrack };
 export { ColorKeyframeTrack };

+ 3 - 9
src/animation/tracks/NumberKeyframeTrack.js

@@ -5,14 +5,8 @@ import { KeyframeTrack } from '../KeyframeTrack.js';
  */
  */
 class NumberKeyframeTrack extends KeyframeTrack {}
 class NumberKeyframeTrack extends KeyframeTrack {}
 
 
-Object.assign( NumberKeyframeTrack.prototype, {
-
-	ValueTypeName: 'number'
-
-	// ValueBufferType is inherited
-
-	// DefaultInterpolation is inherited
-
-} );
+NumberKeyframeTrack.prototype.ValueTypeName = 'number';
+// ValueBufferType is inherited
+// DefaultInterpolation is inherited
 
 
 export { NumberKeyframeTrack };
 export { NumberKeyframeTrack };

+ 4 - 11
src/animation/tracks/QuaternionKeyframeTrack.js

@@ -15,16 +15,9 @@ class QuaternionKeyframeTrack extends KeyframeTrack {
 
 
 }
 }
 
 
-Object.assign( QuaternionKeyframeTrack.prototype, {
-
-	ValueTypeName: 'quaternion',
-
-	// ValueBufferType is inherited
-
-	DefaultInterpolation: InterpolateLinear,
-
-	InterpolantFactoryMethodSmooth: undefined // not yet implemented
-
-} );
+QuaternionKeyframeTrack.prototype.ValueTypeName = 'quaternion';
+// ValueBufferType is inherited
+QuaternionKeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear;
+QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined;
 
 
 export { QuaternionKeyframeTrack };
 export { QuaternionKeyframeTrack };

+ 5 - 12
src/animation/tracks/StringKeyframeTrack.js

@@ -6,17 +6,10 @@ import { KeyframeTrack } from '../KeyframeTrack.js';
  */
  */
 class StringKeyframeTrack extends KeyframeTrack {}
 class StringKeyframeTrack extends KeyframeTrack {}
 
 
-Object.assign( StringKeyframeTrack.prototype, {
-
-	ValueTypeName: 'string',
-	ValueBufferType: Array,
-
-	DefaultInterpolation: InterpolateDiscrete,
-
-	InterpolantFactoryMethodLinear: undefined,
-
-	InterpolantFactoryMethodSmooth: undefined
-
-} );
+StringKeyframeTrack.prototype.ValueTypeName = 'string';
+StringKeyframeTrack.prototype.ValueBufferType = Array;
+StringKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete;
+StringKeyframeTrack.prototype.InterpolantFactoryMethodLinear = undefined;
+StringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined;
 
 
 export { StringKeyframeTrack };
 export { StringKeyframeTrack };

+ 3 - 9
src/animation/tracks/VectorKeyframeTrack.js

@@ -5,14 +5,8 @@ import { KeyframeTrack } from '../KeyframeTrack.js';
  */
  */
 class VectorKeyframeTrack extends KeyframeTrack {}
 class VectorKeyframeTrack extends KeyframeTrack {}
 
 
-Object.assign( VectorKeyframeTrack.prototype, {
-
-	ValueTypeName: 'vector'
-
-	// ValueBufferType is inherited
-
-	// DefaultInterpolation is inherited
-
-} );
+VectorKeyframeTrack.prototype.ValueTypeName = 'vector';
+// ValueBufferType is inherited
+// DefaultInterpolation is inherited
 
 
 export { VectorKeyframeTrack };
 export { VectorKeyframeTrack };