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

how to change ```move``` in a body #26

Closed jeromeetienne closed 9 years ago

jeromeetienne commented 9 years ago

I created a body with { move: false } as parameter (so it isnt move by the physics)

later i would like to change this and start to make it move. how can i change that ?

jeromeetienne commented 9 years ago

similarly, how can i change the mass of an object ?

lo-th commented 9 years ago

hello you can't change move on simulation move:true for dynamique and false for statique but you can force position of dynamique object by body.setPosition(v);

mass is auto you can change density in obj.config[0] is fixed at start i have to look if is possible to change in time.

look src/dev/util/Body.js for full possibility

jeromeetienne commented 9 years ago

thanks for your prompt answer and those informations :)

in my case, i want to change a dynamic object to static object, should i just recreate the body ?

lo-th commented 9 years ago

yes

jeromeetienne commented 9 years ago

thanks