PavolHejný Posted October 5, 2017 Share Posted October 5, 2017 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. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted October 6, 2017 Share Posted October 6, 2017 Welcome to the forum !!! Moving your topic in the relevant category :-) PavolHejný 1 Quote Link to comment Share on other sites More sharing options...
RaananW Posted October 6, 2017 Share Posted October 6, 2017 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! PavolHejný 1 Quote Link to comment Share on other sites More sharing options...
PavolHejný Posted October 9, 2017 Author Share Posted October 9, 2017 Thanks, Now I understand what is happening much better. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.