aframe-physics-spring

1.0.0 • Public • Published

aframe-physics-spring

Cannon.js spring class encapsulated in a AFRAME.component

Requirements

aframe physics system
aframe

Usage

<script src="https://cdn.rawgit.com/gftruj/aframe-physics-spring/master/dist/aframe-spring.min.js"></script>
....
<a-box id="one" static-body></a-box>
<a-box spring="target: #one"></box>

Attributes

spring="target: #entity; restLength: 1; damping: 100; stiffness: 1"

target - the other end of the spring
restLength - spring length when no forces applied
damping - how much can it stretch
stiffness - how much will it suppress the force

Example

glitch example

Package Sidebar

Install

npm i aframe-physics-spring

Weekly Downloads

8

Version

1.0.0

License

MIT

Unpacked Size

26.8 kB

Total Files

10

Last publish

Collaborators

  • gftruj