lo-th / Oimo.js

Lightweight 3d physics engine for javascript
http://lo-th.github.io/Oimo.js
MIT License
3.07k stars 303 forks source link

Elastic-like force to original position #53

Open fabiodr opened 7 years ago

fabiodr commented 7 years ago

I'm trying to reproduce something like this demo, applying a constant force in direction to original anchor position/rotation.

https://youtu.be/RLEEVGxu_k8?t=3m2s

It's more like the inverse of gravity, the larger the distance, larger the force, but have to slow down on the way back.

Do you have any idea how to achieve this? Working around to simulate it, like in the planet gravity demo? Does Oimo.js have something like elastic force or constraint?