Files
old-2sajsmeetup/node_modules/three/src/animation/KeyframeTrackConstructor.js

26 lines
635 B
JavaScript
Raw Normal View History

2017-03-11 15:22:17 +01:00
import { AnimationUtils } from './AnimationUtils';
function KeyframeTrackConstructor( name, times, values, interpolation ) {
if( name === undefined ) throw new Error( "track name is undefined" );
if( times === undefined || times.length === 0 ) {
throw new Error( "no keyframes in track named " + name );
}
this.name = name;
this.times = AnimationUtils.convertArray( times, this.TimeBufferType );
this.values = AnimationUtils.convertArray( values, this.ValueBufferType );
this.setInterpolation( interpolation || this.DefaultInterpolation );
this.validate();
this.optimize();
}
export { KeyframeTrackConstructor };