# aframe-lerp-component

> A linear interpolation component for A-Frame.

Latest version **1.1.0** (published 2017-07-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install aframe-lerp-component
pnpm add aframe-lerp-component
yarn add aframe-lerp-component
bun add aframe-lerp-component
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2017-07-30 |
| First published | 2017-02-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 27 |
| Author | Hayden Lee |
| Maintainers | haydenjameslee |
| Keywords | aframe, aframe-component, aframe-vr, vr, mozvr, webvr, lerp |

## Links

- npm: https://www.npmjs.com/package/aframe-lerp-component
- Repository: https://github.com/haydenjameslee/aframe-lerp-component
- Homepage: https://github.com/haydenjameslee/aframe-lerp-component#readme
- Issues: https://github.com/haydenjameslee/aframe-lerp-component/issues
- npm.io page: https://npm.io/package/aframe-lerp-component

## Dependencies (1)

- [almost-equal](https://npm.io/package/almost-equal.md) ^1.1.0

## Recent versions

- 1.1.0 (latest) — 2017-07-30
- 1.0.3 — 2017-03-06
- 1.0.2 — 2017-02-07
- 1.0.1 — 2017-02-06
- 1.0.0 — 2017-02-06

## README

## aframe-lerp-component

A linear interpolation component for [A-Frame](https://aframe.io).

Changes the position, rotation, or scale when you call `el.setAttribute('position', ...)` from the current value to the new value in time `duration`.

Use directly by calling `el.components.lerp.toPosition(from, to)`


![GIF Example](http://i.giphy.com/26xBP0MH0KHaCrhE4.gif)

Try on Glitch: https://aframe-lerp-component.glitch.me/

### API

| Property | Description | Default Value |
| -------- | ----------- | ------------- |
| duration  | Time to move from `from` to `to` in milliseconds (ms) |     100       |
| properties | Array of properties to lerp. Eg. to only lerp position and rotation set to `position, rotation` | position, rotation, scale |

### Installation

#### Browser

Install and use by directly including the [browser files](dist):

```html
<head>
  <title>My A-Frame Scene</title>
  <script src="https://aframe.io/releases/0.4.0/aframe.min.js"></script>
  <script src="https://unpkg.com/aframe-lerp-component/dist/aframe-lerp-component.min.js"></script>
</head>

<body>
  <a-scene>
    <a-entity lerp="duration: 100; properties: position, rotation, scale"></a-entity>
  </a-scene>
</body>
```

<!-- If component is accepted to the Registry, uncomment this. -->
<!--
Or with [angle](https://npmjs.com/package/angle/), you can install the proper
version of the component straight into your HTML file, respective to your
version of A-Frame:

```sh
angle install aframe-lerp-component
```
-->

#### npm

Install via npm:

```bash
npm install aframe-lerp-component
```

Then require and use.

```js
require('aframe');
require('aframe-lerp-component');
```

---
_Source: https://npm.io/package/aframe-lerp-component · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
