garidan Posted February 19, 2015 Share Posted February 19, 2015 I need to perform a precise mesh collision detection: meshes have strange shapes but are very few and the scene is almost static, only one mesh at a time is drag and dropped in the scene, so there's no computational resources problem. I already tried with "usePreciseIntersection: true" but calling it precise ..... it's not: meshes[0].actionManager.registerAction(new BABYLON.ExecuteCodeAction( { trigger: BABYLON.ActionManager.OnIntersectionEnterTrigger, parameter: { mesh:meshes[1], usePreciseIntersection: true } }, function () { meshesMaterial[0].diffuseColor=BABYLON.Color3.Red(); })); Reading at the link below, I need a sort of "mesh collider".Any idea ? Any external library or "trick" ?Thanks http://blogs.msdn.com/b/davrous/archive/2014/11/18/understanding-collisions-amp-physics-by-building-a-cool-webgl-babylon-js-demo-with-oimo-js.aspx Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 19, 2015 Share Posted February 19, 2015 Actually there is no mesh vs mesh intersection or collisions. This is far too slow to doBUT if you want to do it by yourself you can check every triangle of first mesh with every triangle of the second mesh(Check the collider class to get an triangle testing function) But warning: this will be SOO SLOOOWWWW Quote Link to comment Share on other sites More sharing options...
garidan Posted February 20, 2015 Author Share Posted February 20, 2015 OK, I think I need a Bounding Volume Hierarchy (BVH) The bounding volume hierarchies of two objects are traversed recursively. The recursion stops at the leaves and at disjoint bounding volumes. Whenever two BVs overlap, one of them is tested against the children of the other one. If ever I do this, I'll let you know :-) http://image.diku.dk/projects/media/christian.bay.kasper.andersen.06B.pdf HugoMcPhee 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 20, 2015 Share Posted February 20, 2015 Oh yeah this is great:) Quote Link to comment Share on other sites More sharing options...
Alessandro Posted April 14, 2016 Share Posted April 14, 2016 Hello guys, I have the same problem concerning the precision with meshes intersection, especially meshes with strange shapes. I was just wondering if you find any solution to this problem, bhv's algorithms seems to be very complex to implement. Thanks 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.