w00dy Posted August 18, 2015 Share Posted August 18, 2015 Hi Guys, I'm new into the Babylon.js development and I have a question about collision of meshes. My Scenario:I want to get information about meshe to meshe(s) collision. So if I move a mesh against another I want to get the information which one I hit and for example the exact point of the hit.It should also be possible to hit two meshes at the same time and get this information. With this information I want to implement a kind of "snapping" functionialiy. My Problem is: There is no information about the mesh I hit with the moved mesh. The are some propertys inside of the mesh like collider but all empty.Maybe I'm totaly on the wrong way and I hope you can help me. Here is a playground with my success fo far: http://www.babylonjs-playground.com/#WJHE8 Thank you very much for your help.If my explenation is not good enough please feel free to ask. I will try the explain it in more detail then. Best Regards,Holger Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 18, 2015 Share Posted August 18, 2015 That's clearly something missing in the current version But thanks to the magic of the web, I have fixed it:http://www.babylonjs-playground.com/#WJHE8#2 The new property for the event (additionalData) will be available soon on the repo (like today) eps 1 Quote Link to comment Share on other sites More sharing options...
w00dy Posted August 19, 2015 Author Share Posted August 19, 2015 Hi Deltakosh, thank you very much. Your improvement will help me a lot, Do you have also an idea how to get the intersectionPoint?m.additionalData._collider._intersectionPoint is always empty on playground example http://www.babylonjs-playground.com/#WJHE8%232. I'm also playing a little bit with the onCollide function like in my playground here: http://www.babylonjs-playground.com/#OMBOJNow if you hit a mesh you get the correct information about what mesh was hit and sometimes you also get the intersectionPoint information...but not always and sometimes the information seems to be wrong? Thank you again for your help. Best regards Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 20, 2015 Share Posted August 20, 2015 Beware here: intersections are not using collisions engine but a faster (and less precise)engine. Si this is why there is no itnersectionPoint as there is no collision evaluated For your second question, I'm always getting intersection point info (which is expected ). can you provide a better sample where the issue is isolated? 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.