A linear interpolation component for A-Frame.
Switch branches/tags
Nothing to show
Clone or download
Latest commit 885f452 Jul 30, 2017
Permalink
Failed to load latest commit information.
dist Dist bump Jul 30, 2017
examples Support for Aframe 0.6.0 and 0.6.1 Jul 30, 2017
tests Support for Aframe 0.6.0 and 0.6.1 Jul 30, 2017
.gitignore add .DS_Store to .gitignore Feb 6, 2017
LICENSE init commit Feb 6, 2017
README.md Update README.md Jul 30, 2017
index.js Support for Aframe 0.6.0 and 0.6.1 Jul 30, 2017
package.json 1.1.0 Jul 30, 2017

README.md

aframe-lerp-component

A linear interpolation component for A-Frame.

Changes the position, rotation, or scale when you call el.setAttribute('position', ...) from the current value to the new value.

The time taken to interpolate to the new value is the time between the previous change and the most recent change.

GIF Example

Try on Glitch: https://aframe-lerp-component.glitch.me/

API

Property Description Default Value
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:

<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="properties: position, rotation, scale"></a-entity>
  </a-scene>
</body>

npm

Install via npm:

npm install aframe-lerp-component

Then require and use.

require('aframe');
require('aframe-lerp-component');