Jump to content

Physics issue: Merged and rotated mesh goes through the floor


splash27
 Share

Recommended Posts

In this case, it looks like the merging of the meshes messes with the impostor system. It creates a single shape with the following halfExtents:

x: 0.1
y: 0.30000000596046444
z: 0.5000000029802323

 

And this does not quite match the L-shape you are trying to achieve. What you want to do instead, is create a compound-shape by using the parent-child system in BJS:

https://www.babylonjs-playground.com/#RAYW6X#2

 

Link to comment
Share on other sites

@Raggar, great!

However parenting system is not comfortable in cases of spawning instances. You'll have to create instance for every child and attach impostor for every child.

Can I fix halfExtents manually after merging meshes? If yes, how I can do this? I can't find such property in Impostor's properties.

Link to comment
Share on other sites

  • 1 month later...

My solution: https://www.babylonjs-playground.com/#RAYW6X#3

It's a little bit similar with solution by @Raggar, however less expensive and more universal (I think). Yeah, the main disadvantage is simplifying physics till bounding box, but it can be accepted in my case.

Anyway, it still looks like a hack. I wonder if merging algorithm can be fixed inside Babylon's core.

 

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