Jump to content

Weird physics


ruina
 Share

Recommended Posts

Hi, I'm having a problem with physics. Not sure whether I'm doing something wrong or if there is a bug.

Look at this snippet:

http://www.babylonjs-playground.com/#26LQEZ#14

The box falls to the ground, no problem. But, if you go to line 38 and change this:

dice.position.y = 39;

with this

dice.position.y = 40;

and run, the box goes through the ground.

Curiously, only happens with some values. For example, with y = 44, the box stops again into the ground, but assigning y values of 50, 51, the issue happens again. And with 52, the box works again as expected.

Its a bug of the physics engine?

Link to comment
Share on other sites

Interesting, but the box still seems to go through the ground partially.

I have switched the physics engine to CannonJs and the box behaves normally no matter the position it starts. I guess that it is a problem of OimoJs.

 

Link to comment
Share on other sites

Yes, this is Oimo's problem. the main issue is the units. take every vector you have (position, size) and multiply by 100, and it will behave differently. Another solution would be to add restitution - http://www.babylonjs-playground.com/#26LQEZ#18

But I am not sure this is what you expect to have.

Cannon works much better in that sense. Each engine has its upsides and downsides.

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