Vibrations in Babylon.js + Oimo.js

Recommended Posts


I'm making the game using the Babylon.js and Oimo.js.
I want to put cubes one to the other and create bigger buildings - just like wooden domino or jenga cubes in real world. But if I put a lot of cubes one to the other, they will start to shake and the whole building will collapse.

I can not figure out why this is happening? Can I somehow get rid of this vibration?

Thanks a lot for your advice.

Share this post

Link to post
Share on other sites

Ho @PavolHejný,

Welcome to the forum!

First - the default physics engine is cannon and not oimo, so you are technically using cannon.js.

Two things that can help your physics interactions be a bit more precise: Reduce restitution, increase iterations: (line 35 and 26 respectively) .

Restitution was the main cause of this behavior. The forces "transferred" between the cubes and were not reduced too much during the process (you had 0.9, 90% restitution, which is a lot).

Increasing the amount of iterations the physics engine does will increase its precision, but will reduce performance a bit. I put a 100, but I guess 50 will be enough as well. 20 is too little (default is 10).

Hope this helps!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.