BooleanKeyframeTrack.js 800 字节
Newer Older
B
bentok 已提交
1
import { InterpolateDiscrete } from '../../constants.js';
2
import { KeyframeTrack } from '../KeyframeTrack.js';
R
Rich Harris 已提交
3

4
/**
5
 * A Track of Boolean keyframe values.
6 7
 */

M
Mr.doob 已提交
8
function BooleanKeyframeTrack( name, times, values ) {
9

10
	KeyframeTrack.call( this, name, times, values );
11

M
Mr.doob 已提交
12
}
13

14
BooleanKeyframeTrack.prototype = Object.assign( Object.create( KeyframeTrack.prototype ), {
15

R
Rich Harris 已提交
16
	constructor: BooleanKeyframeTrack,
17

18 19
	ValueTypeName: 'bool',
	ValueBufferType: Array,
20

R
Rich Harris 已提交
21
	DefaultInterpolation: InterpolateDiscrete,
22

23 24
	InterpolantFactoryMethodLinear: undefined,
	InterpolantFactoryMethodSmooth: undefined
25

26 27 28
	// Note: Actually this track could have a optimized / compressed
	// representation of a single value and a custom interpolant that
	// computes "firstValue ^ isOdd( index )".
29

30
} );
R
Rich Harris 已提交
31

32
export { BooleanKeyframeTrack };