-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
anim-data.js
39 lines (36 loc) · 900 Bytes
/
anim-data.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* Wraps a set of data used in animation.
*
* @category Animation
*/
class AnimData {
/**
* Create a new animation AnimData instance.
*
* @param {number} components - Specifies how many components make up an element of data. For
* example, specify 3 for a set of 3-dimensional vectors. The number of elements in data array
* must be a multiple of components.
* @param {Float32Array|number[]} data - The set of data.
*/
constructor(components, data) {
this._components = components;
this._data = data;
}
/**
* Gets the number of components that make up an element.
*
* @type {number}
*/
get components() {
return this._components;
}
/**
* Gets the data.
*
* @type {Float32Array|number[]}
*/
get data() {
return this._data;
}
}
export { AnimData };