# AnimData

Class · category: Animation

Source: https://github.com/playcanvas/engine/blob/970d89f6d3bc6667f4e1f88153abd6e7e82ed52c/src/framework/anim/evaluator/anim-data.js#L8

Wraps a set of data used in animation: a flat [data](https://api.playcanvas.com/engine/classes/AnimData.md#data) array read [components](https://api.playcanvas.com/engine/classes/AnimData.md#components) values
at a time, so a three-component set holds positions and a four-component set holds quaternions.
An [AnimTrack](https://api.playcanvas.com/engine/classes/AnimTrack.md) keeps its keyframe times and values as AnimData that its curves index into.

## Constructors

### constructor

```ts
new AnimData(components: number, data: number[] | Float32Array<ArrayBufferLike>)
```

Create a new animation AnimData instance.

**Parameters**

- `components` (`number`): 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.
- `data` (`number[] | Float32Array<ArrayBufferLike>`): The set of data.

## Accessors

### components

```ts
get components(): number
```

Gets the number of components that make up an element.

### data

```ts
get data(): number[] | Float32Array<ArrayBufferLike>
```

Gets the data.
