Jump to content

Precise Collisions for imported meshes


Art Vandelay
 Share

Recommended Posts

Hi,

I realize this is a topic that was covered before but I couldn't find a solution and wasn't sure if there was one now.

I have several imported meshes in a scene (relatively complex ones) and I can drag and drop one at a time. I want to check whether the mesh I am dragging has collided with a different one. In that case it is blocked and can't be dragged further. The problem is I would like to check this precisely, meaning exactly when two meshes touch each other, and not just by using a bounding box. Is there any way to do this?

Thanks for your help!

Link to comment
Share on other sites

Hi guys.  Sorry for interrupting in the middle of a pending clarification question.

I just wanted to remind of the "surround with simple impostors" trick.  On mesh that aren't too complex, you can add (invisible) boxes along the edges of the mesh, and put a box impostor on each one.

In the below playground, I didn't add any physics to my "ridge boxes" yet, or ever.  But, in theory, it COULD work.  The ridge/edge boxes would need to be parented to something, so they wouldn't fly away-from mesh... upon impact.  But, in theory, 2-20 of these edge-physics "shapes"... could do physics reactions off-of one-another... fairly well.  No meshImpostors, no spheres-only limitations, but some meticulous ridge-box placements.

https://www.babylonjs-playground.com/#1UHFAP#195

Here, you can see the ridge/edge boxes in white... un-parented-ly positioned upon/around the plotted mesh.

Two of the ridge-positionings... are broken.  Dunno why.  Anyway, perhaps this is a good starter playground for doing some physics tests on "ridge-physics" shapes.  Turn-on the physics, impostor the ridge-boxes, parent them to something (inside makeThing() func).   Then generate 5-10 "things", put them in a box or tumble them across a ground... see how well they work... if wanted.  Tell/show results, if you please.

Note: Avoid impostor overlap at places where multiple ridge-boxes come together, if possible (I think).

Ok, now, back to the question at-hand, for-which I am curious about the answer.  :)  Party on!

Link to comment
Share on other sites

I'm confused.  :)

I'm not an intersect pro... sorry.

Ok, single mesh drinking glass.  No extra collision-sensor mesh.

Drop marble into glass.

Can we detect collision with bottom of glass?

Or will collision trigger when marble passes glass-lip?

*scratch scratch*  I should test.  :)

"precise" parameter... and we get bottom-of-glass collision? If so, cooooool.

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...