Jump to content

Collision between meshes


w00dy
 Share

Recommended Posts

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

 

Link to comment
Share on other sites

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/#OMBOJ

Now 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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...