PavolHejný

Vibrations in Babylon.js + Oimo.js

Recommended Posts

Hi,

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.

https://www.babylonjs-playground.com/#DCR6ZG#1


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: https://www.babylonjs-playground.com/#DCR6ZG#4 (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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.