BooleanKeyframeTrack.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import { InterpolateDiscrete } from '../../constants';
  2. import { KeyframeTrackPrototype } from '../KeyframeTrackPrototype';
  3. import { KeyframeTrackConstructor } from '../KeyframeTrackConstructor';
  4. /**
  5. *
  6. * A Track of Boolean keyframe values.
  7. *
  8. *
  9. * @author Ben Houston / http://clara.io/
  10. * @author David Sarno / http://lighthaus.us/
  11. * @author tschw
  12. */
  13. function BooleanKeyframeTrack( name, times, values ) {
  14. this.isBooleanKeyframeTrack = true;
  15. KeyframeTrackConstructor.call( this, name, times, values );
  16. };
  17. BooleanKeyframeTrack.prototype =
  18. Object.assign( Object.create( KeyframeTrackPrototype ), {
  19. constructor: BooleanKeyframeTrack,
  20. ValueTypeName: 'bool',
  21. ValueBufferType: Array,
  22. DefaultInterpolation: InterpolateDiscrete,
  23. InterpolantFactoryMethodLinear: undefined,
  24. InterpolantFactoryMethodSmooth: undefined
  25. // Note: Actually this track could have a optimized / compressed
  26. // representation of a single value and a custom interpolant that
  27. // computes "firstValue ^ isOdd( index )".
  28. } );
  29. export { BooleanKeyframeTrack };