fireball/lib/animation/tracks/QuaternionKeyframeTrack.js

41 lines
1.0 KiB
JavaScript
Raw Normal View History

2018-12-25 13:59:22 +00:00
import { InterpolateLinear } from '../../constants.js';
import { KeyframeTrack } from '../KeyframeTrack.js';
import { QuaternionLinearInterpolant } from '../../math/interpolants/QuaternionLinearInterpolant.js';
/**
*
* A Track of quaternion keyframe values.
*
* @author Ben Houston / http://clara.io/
* @author David Sarno / http://lighthaus.us/
* @author tschw
*/
function QuaternionKeyframeTrack( name, times, values, interpolation ) {
KeyframeTrack.call( this, name, times, values, interpolation );
}
QuaternionKeyframeTrack.prototype = Object.assign( Object.create( KeyframeTrack.prototype ), {
constructor: QuaternionKeyframeTrack,
ValueTypeName: 'quaternion',
// ValueBufferType is inherited
DefaultInterpolation: InterpolateLinear,
InterpolantFactoryMethodLinear: function ( result ) {
return new QuaternionLinearInterpolant( this.times, this.values, this.getValueSize(), result );
},
InterpolantFactoryMethodSmooth: undefined // not yet implemented
} );
export { QuaternionKeyframeTrack };