Jump to content

Undesired movement when adding a joint


klem
 Share

Recommended Posts

Hi,

I'm very new to BabylonJS, but I need to admit it's a great framework, very polished. And the playground is a delicious toy :)

I'm currently playing with the physics plugin (cannon) and I'm trying to understand joints. In fact I've got an issue when I add a joint between 2 meshes : there is a force applied directly on those meshes. The result is an undesired pseudo-random movement at startup. I tried things with setLimit or setMotor on joint, but there is always a kind of big impulse at launch.

It looks like a bug, but I'm not really sure :D Here's the playground : http://www.babylonjs-playground.com/#24JRLD#1

In this playground, 2 cubes are "hinge-joined" but the initial movement is undesired. If you comment the addJoint call (line 112), cubes are placed correctly.

Is there a way to avoid this undesired movement? Other point, when you remove the joint, the cube (top) never stop moving ! is it a special property to avoid that ? I missed something?

Also I think I found a bug (another?) with the setMass function : joints are removed after setting a new mass on mesh. I prepared a demo with the bug here : http://www.babylonjs-playground.com/#24JRLD (same as before, but when user clicks, a setMass function call breaks the joint).

Any help would be greatly appreciated!

klem

Link to comment
Share on other sites

http://www.babylonjs-playground.com/#24JRLD#2

http://www.babylonjs-playground.com/#24JRLD#6

1 hour ago, klem said:

Other point, when you remove the joint, the cube (top) never stop moving ! is it a special property to avoid that ? I missed something?

I'm not sure what's going on there. I tried changing the friction and the sleep properties without success.

1 hour ago, klem said:

Also I think I found a bug (another?) with the setMass function : joints are removed after setting a new mass on mesh.

If you set the mass directly to the body, it doesn't break:

http://www.babylonjs-playground.com/#24JRLD#7

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