Parcourir la source

QuaternionKeyframeTrack: Convert to es6 class

Ian Purvis il y a 5 ans
Parent
commit
c08f7451d2
1 fichiers modifiés avec 6 ajouts et 11 suppressions
  1. 6 11
      src/animation/tracks/QuaternionKeyframeTrack.js

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

@@ -5,16 +5,17 @@ import { QuaternionLinearInterpolant } from '../../math/interpolants/QuaternionL
 /**
  * A Track of quaternion keyframe values.
  */
+class QuaternionKeyframeTrack extends KeyframeTrack {
 
-function QuaternionKeyframeTrack( name, times, values, interpolation ) {
+	InterpolantFactoryMethodLinear( result ) {
 
-	KeyframeTrack.call( this, name, times, values, interpolation );
+		return new QuaternionLinearInterpolant( this.times, this.values, this.getValueSize(), result );
 
-}
+	}
 
-QuaternionKeyframeTrack.prototype = Object.assign( Object.create( KeyframeTrack.prototype ), {
+}
 
-	constructor: QuaternionKeyframeTrack,
+Object.assign( QuaternionKeyframeTrack.prototype, {
 
 	ValueTypeName: 'quaternion',
 
@@ -22,12 +23,6 @@ QuaternionKeyframeTrack.prototype = Object.assign( Object.create( KeyframeTrack.
 
 	DefaultInterpolation: InterpolateLinear,
 
-	InterpolantFactoryMethodLinear: function ( result ) {
-
-		return new QuaternionLinearInterpolant( this.times, this.values, this.getValueSize(), result );
-
-	},
-
 	InterpolantFactoryMethodSmooth: undefined // not yet implemented
 
 } );