# AnimCurve

Class · category: Animation

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

Animation curve links an input data set to an output data set and defines the interpolation
method to use. The [paths](https://api.playcanvas.com/engine/classes/AnimCurve.md#paths) name the targets the curve drives, [input](https://api.playcanvas.com/engine/classes/AnimCurve.md#input) and
[output](https://api.playcanvas.com/engine/classes/AnimCurve.md#output) index into the owning [AnimTrack](https://api.playcanvas.com/engine/classes/AnimTrack.md)'s keyframe time and value data, and
[interpolation](https://api.playcanvas.com/engine/classes/AnimCurve.md#interpolation) is one of [INTERPOLATION_STEP](https://api.playcanvas.com/engine/variables/INTERPOLATION_STEP.md), [INTERPOLATION_LINEAR](https://api.playcanvas.com/engine/variables/INTERPOLATION_LINEAR.md) or
[INTERPOLATION_CUBIC](https://api.playcanvas.com/engine/variables/INTERPOLATION_CUBIC.md).

## Constructors

### constructor

```ts
new AnimCurve(paths: AnimCurvePath[], input: number, output: number, interpolation: number)
```

Create a new animation curve.

**Parameters**

- `paths` ([`AnimCurvePath`](https://api.playcanvas.com/engine/interfaces/AnimCurvePath.md)`[]`): Array of paths identifying the targets of this curve, for
  example the local position of a node.
- `input` (`number`): Index of the curve which specifies the key data.
- `output` (`number`): Index of the curve which specifies the value data.
- `interpolation` (`number`): The interpolation method to use. One of the following:

  - [INTERPOLATION_STEP](https://api.playcanvas.com/engine/variables/INTERPOLATION_STEP.md)
  - [INTERPOLATION_LINEAR](https://api.playcanvas.com/engine/variables/INTERPOLATION_LINEAR.md)
  - [INTERPOLATION_CUBIC](https://api.playcanvas.com/engine/variables/INTERPOLATION_CUBIC.md)

## Accessors

### input

```ts
get input(): number
```

The index of the AnimTrack input which contains the key data for this curve.

### interpolation

```ts
get interpolation(): number
```

The interpolation method used by this curve.

### output

```ts
get output(): number
```

The index of the AnimTrack input which contains the key data for this curve.

### paths

```ts
get paths(): AnimCurvePath[]
```

The list of paths which identify targets of this curve.
