PavolHejný Posted December 6, 2017 Share Posted December 6, 2017 Hi, Can I somehow (with physics plugin Oimo.js) set different gravity for different meshes? For example I want to simulate environment in water and I want to have there buoyancy. https://www.babylonjs-playground.com/#2B84TV#7 Thanks a lot for your advice. Quote Link to comment Share on other sites More sharing options...
Arte Posted December 6, 2017 Share Posted December 6, 2017 2 hours ago, PavolHejný said: Hi, Can I somehow (with physics plugin Oimo.js) set different gravity for different meshes? For example I want to simulate environment in water and I want to have there buoyancy. https://www.babylonjs-playground.com/#2B84TV#7 Thanks a lot for your advice. I'm not guru on physics . It might help you. https://www.babylonjs-playground.com/#2B84TV#8 PavolHejný 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted December 6, 2017 Share Posted December 6, 2017 Thats what mass is for (but I might be wrong) if you wanted to be fancy https://www.babylonjs-playground.com/#2B84TV#12 brianzinn and PavolHejný 2 Quote Link to comment Share on other sites More sharing options...
brianzinn Posted December 6, 2017 Share Posted December 6, 2017 for small objects (not counting ie: water/air resistance): force = mass X gravity. I made a small PG:https://www.babylonjs-playground.com/#2B84TV#10 If the sphere mass and diameters are the same they bounce the same. A bigger sphere with same mass does not bounce the same, so something else is being taken into account! I thought then that if I made their density the same they would act more similar (in PG), so the physics engine must already do something, as they don't bounce the same from same start point. There was a thread recently on physics friction with interesting comments. Some engines have extra functionality - I tried the PG in Cannon. I'm not aware of their being a way to explicitly set density for buoyancy. Maybe you can apply impulses with a vertical vector to influence the buoyancy. PavolHejný, Wingnut and Arte 3 Quote Link to comment Share on other sites More sharing options...
PavolHejný Posted December 6, 2017 Author Share Posted December 6, 2017 Thanks for every advice. @Arte Setting inital velocity is good and easy hack for some cases. @brianzinn I think that is exactly the problem of Oimo. Oimo is physics in vaccum - everythink is falling with same acceleration. @Pryme8 Perfect hack! Arte 1 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.