lo-th / Oimo.js

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

Objects shaking all time #84

Open romanunit opened 5 years ago

romanunit commented 5 years ago

Hey. I am using Oimo.js physics for Babylon.js, and I has arisen a problem. When several objects are near or above each other, these objects start to shake uncontrollably until the objects fly apart from each other.

I attach a link to the video. Someone can help with this problem? https://youtu.be/fAEQQYNWHlc

In the video, I do not attach any force to the objects. I spawn them down and put some objects on top of others.

I found the function this.orientation.addTime (this.angularVelocity, timeStep); if this.angularVelocity assigns all coordinates to 0, then the shaking problem is solved, but in this way I block the turns of objects, but for me they are important. Can someone tell me on this issue? I also found that the authors of this code were

With best regards, Roman.

romanunit commented 5 years ago

@lo-th, could you please help me?

lo-th commented 5 years ago

i think you should increase size of all object

romanunit commented 5 years ago

i think you should increase size of all object

@lo-th, Thanks for reply. But how it`s change my problem? I think problem is with colliders, bcs when I discard mass from object everything stop shake.

I have coins with different size. Also I can show you example with cubes where i thing we have the same problem. https://www.babylonjs-playground.com/#DCR6ZG#1

Cubes are shaking. But they should not do that.

lo-th commented 5 years ago

yes cube is to little 10 or 100 and you see difference

romanunit commented 5 years ago

@lo-th, I increased the cubes by 10 or 100, but they are still shaking. Is it possible to remove shaking without increasing all objects? https://youtu.be/rLiVFJr5dUc

Thanks!

lo-th commented 5 years ago

mm you can try to up world iteration world.numIterations = 30; // default is 8

or maybe change physics engine Energy have verry good stacking https://lo-th.github.io/Energy.lab/#building

oimo don't have linear or rotation limiter

jacycode commented 5 years ago

fix the problem?The coefficient of restitution of the shape in config maybe help you.

stefanuddenberg commented 4 years ago

Bump; curious if you ever solved this issue!