Hello BBBoys ,
In this case im steel learning about physics.
I would like to share this playground where I need to pass the sphere through a cylinder hole:
not working example
Why it is is not working ?
BTW , I already tryed multiple PhysicsShapeType shapes without any luck.
Thanks for your help.
In case of complex shapes one need to use BABYLON.PhysicsShapeType.CONVEX_HULL.
In this case your PG will work - https://playground.babylonjs.com/#OYID75#1
The cheapest one is CONVEX_HULL
, but the top is closed so it cannot be inserted.
Sorry but I disagree, CONVEX_HULL
is convex, which means no cavity, no hole… The playground you linked triggers and error and in fact no physic body is actually assigned to the shapes, I guess that’s why it looks like it works
I think solution provided by @11128 (MESH
) is necessary in that case
I believe you are right
The error was due to some meshes had no geometry.
Here is the working example with MESH shape type - https://playground.babylonjs.com/#OYID75#3
Moved a bit to show that the ball bounces from outside - https://playground.babylonjs.com/#OYID75#4
Hello guys , I got it working as expected.
The trick is to assign physics to the meshes but not to root mesh.
Let me share:
now it works !!
Thanks for the quick responses !!