Jump to content

Terrain mesh collision against rigid bodies?


ChaseMoskal
 Share

Recommended Posts

Hey folks!

I was wondering, what are some techniques to accomplish physical interactions against a terrain mesh, imported as an .obj file?

I had attempted this earlier, and was having troubles — warnings saying MeshImpostor can only collide with Sphere — or something like that, I don't recall exactly but I'm sure some of you know what I'm talking about.

I'm hoping to have objects of all kinds (spheres, cuboids, cylinders, ellipsoids, etc?) physically interacting with static terrain meshes, which will include some bumpy ground, buildings, caves, etc.

Also, I haven't really decided on a physics engine yet (oimo, cannon, ammo, etc?), so if one can handle this problem better than others, I'm all ears!

Thanks!

Link to comment
Share on other sites

Hi guys.  Ever seen the Oimo no-meshImposter terrain?  http://lo-th.github.io/Oimo.js/test_terrain.html

I was reminded of it... by this thread@adam's last post in that thread... says it all.  There's sphere imposters under that ground.  And, as we can plainly see, boxes are tumbling down that terrain, and looking pretty good. 

But, perhaps you still need meshImposters for the oddly-shaped mesh that you'll be tumbling-around in those hills?  Yep, I hear ya.

Maybe the wisest move... use CannonJS (because it has meshImposter), but still make a ground like the one we see in that Oimo demo... with lots of sphere imposters beneath.

Now use Cannon's meshImposter for your oddly-shaped tumbling mesh.  Since meshImposters react with spheres, and since the heightMap ground is actually blanketed with sphere imposters, all should work nicely.

Doing the opposite... using a meshImposter for the heightMap, but then, somehow, making compound imposters of many spheres... trying to "fit" oddly shaped tumbling mesh... would likely be more difficult. *shrug*  Not sure.  All this stuff is still evolving, and "best practices" are still being established.

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