initial commit
This commit is contained in:
38
lib/animation/tracks/BooleanKeyframeTrack.js
Normal file
38
lib/animation/tracks/BooleanKeyframeTrack.js
Normal file
@ -0,0 +1,38 @@
|
||||
import { InterpolateDiscrete } from '../../constants.js';
|
||||
import { KeyframeTrack } from '../KeyframeTrack.js';
|
||||
|
||||
/**
|
||||
*
|
||||
* A Track of Boolean keyframe values.
|
||||
*
|
||||
*
|
||||
* @author Ben Houston / http://clara.io/
|
||||
* @author David Sarno / http://lighthaus.us/
|
||||
* @author tschw
|
||||
*/
|
||||
|
||||
function BooleanKeyframeTrack( name, times, values ) {
|
||||
|
||||
KeyframeTrack.call( this, name, times, values );
|
||||
|
||||
}
|
||||
|
||||
BooleanKeyframeTrack.prototype = Object.assign( Object.create( KeyframeTrack.prototype ), {
|
||||
|
||||
constructor: BooleanKeyframeTrack,
|
||||
|
||||
ValueTypeName: 'bool',
|
||||
ValueBufferType: Array,
|
||||
|
||||
DefaultInterpolation: InterpolateDiscrete,
|
||||
|
||||
InterpolantFactoryMethodLinear: undefined,
|
||||
InterpolantFactoryMethodSmooth: undefined
|
||||
|
||||
// Note: Actually this track could have a optimized / compressed
|
||||
// representation of a single value and a custom interpolant that
|
||||
// computes "firstValue ^ isOdd( index )".
|
||||
|
||||
} );
|
||||
|
||||
export { BooleanKeyframeTrack };
|
34
lib/animation/tracks/ColorKeyframeTrack.js
Normal file
34
lib/animation/tracks/ColorKeyframeTrack.js
Normal file
@ -0,0 +1,34 @@
|
||||
import { KeyframeTrack } from '../KeyframeTrack.js';
|
||||
|
||||
/**
|
||||
*
|
||||
* A Track of keyframe values that represent color.
|
||||
*
|
||||
*
|
||||
* @author Ben Houston / http://clara.io/
|
||||
* @author David Sarno / http://lighthaus.us/
|
||||
* @author tschw
|
||||
*/
|
||||
|
||||
function ColorKeyframeTrack( name, times, values, interpolation ) {
|
||||
|
||||
KeyframeTrack.call( this, name, times, values, interpolation );
|
||||
|
||||
}
|
||||
|
||||
ColorKeyframeTrack.prototype = Object.assign( Object.create( KeyframeTrack.prototype ), {
|
||||
|
||||
constructor: ColorKeyframeTrack,
|
||||
|
||||
ValueTypeName: 'color'
|
||||
|
||||
// ValueBufferType is inherited
|
||||
|
||||
// DefaultInterpolation is inherited
|
||||
|
||||
// Note: Very basic implementation and nothing special yet.
|
||||
// However, this is the place for color space parameterization.
|
||||
|
||||
} );
|
||||
|
||||
export { ColorKeyframeTrack };
|
30
lib/animation/tracks/NumberKeyframeTrack.js
Normal file
30
lib/animation/tracks/NumberKeyframeTrack.js
Normal file
@ -0,0 +1,30 @@
|
||||
import { KeyframeTrack } from '../KeyframeTrack.js';
|
||||
|
||||
/**
|
||||
*
|
||||
* A Track of numeric keyframe values.
|
||||
*
|
||||
* @author Ben Houston / http://clara.io/
|
||||
* @author David Sarno / http://lighthaus.us/
|
||||
* @author tschw
|
||||
*/
|
||||
|
||||
function NumberKeyframeTrack( name, times, values, interpolation ) {
|
||||
|
||||
KeyframeTrack.call( this, name, times, values, interpolation );
|
||||
|
||||
}
|
||||
|
||||
NumberKeyframeTrack.prototype = Object.assign( Object.create( KeyframeTrack.prototype ), {
|
||||
|
||||
constructor: NumberKeyframeTrack,
|
||||
|
||||
ValueTypeName: 'number'
|
||||
|
||||
// ValueBufferType is inherited
|
||||
|
||||
// DefaultInterpolation is inherited
|
||||
|
||||
} );
|
||||
|
||||
export { NumberKeyframeTrack };
|
40
lib/animation/tracks/QuaternionKeyframeTrack.js
Normal file
40
lib/animation/tracks/QuaternionKeyframeTrack.js
Normal file
@ -0,0 +1,40 @@
|
||||
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 };
|
35
lib/animation/tracks/StringKeyframeTrack.js
Normal file
35
lib/animation/tracks/StringKeyframeTrack.js
Normal file
@ -0,0 +1,35 @@
|
||||
import { InterpolateDiscrete } from '../../constants.js';
|
||||
import { KeyframeTrack } from '../KeyframeTrack.js';
|
||||
|
||||
/**
|
||||
*
|
||||
* A Track that interpolates Strings
|
||||
*
|
||||
*
|
||||
* @author Ben Houston / http://clara.io/
|
||||
* @author David Sarno / http://lighthaus.us/
|
||||
* @author tschw
|
||||
*/
|
||||
|
||||
function StringKeyframeTrack( name, times, values, interpolation ) {
|
||||
|
||||
KeyframeTrack.call( this, name, times, values, interpolation );
|
||||
|
||||
}
|
||||
|
||||
StringKeyframeTrack.prototype = Object.assign( Object.create( KeyframeTrack.prototype ), {
|
||||
|
||||
constructor: StringKeyframeTrack,
|
||||
|
||||
ValueTypeName: 'string',
|
||||
ValueBufferType: Array,
|
||||
|
||||
DefaultInterpolation: InterpolateDiscrete,
|
||||
|
||||
InterpolantFactoryMethodLinear: undefined,
|
||||
|
||||
InterpolantFactoryMethodSmooth: undefined
|
||||
|
||||
} );
|
||||
|
||||
export { StringKeyframeTrack };
|
31
lib/animation/tracks/VectorKeyframeTrack.js
Normal file
31
lib/animation/tracks/VectorKeyframeTrack.js
Normal file
@ -0,0 +1,31 @@
|
||||
import { KeyframeTrack } from '../KeyframeTrack.js';
|
||||
|
||||
/**
|
||||
*
|
||||
* A Track of vectored keyframe values.
|
||||
*
|
||||
*
|
||||
* @author Ben Houston / http://clara.io/
|
||||
* @author David Sarno / http://lighthaus.us/
|
||||
* @author tschw
|
||||
*/
|
||||
|
||||
function VectorKeyframeTrack( name, times, values, interpolation ) {
|
||||
|
||||
KeyframeTrack.call( this, name, times, values, interpolation );
|
||||
|
||||
}
|
||||
|
||||
VectorKeyframeTrack.prototype = Object.assign( Object.create( KeyframeTrack.prototype ), {
|
||||
|
||||
constructor: VectorKeyframeTrack,
|
||||
|
||||
ValueTypeName: 'vector'
|
||||
|
||||
// ValueBufferType is inherited
|
||||
|
||||
// DefaultInterpolation is inherited
|
||||
|
||||
} );
|
||||
|
||||
export { VectorKeyframeTrack };
|
Reference in New Issue
Block a user