Jump to content

Collision stop for physic


Dad72
 Share

Recommended Posts

Yes for the phisics collisions. 

The problem is that I use physics so that when I add an object on the stage with my editor, it is positioned on the ground, but if I move an object with the transform gizmo and it hits another object it found that eject as a bowling pin. I therefore wish to disable the collision of physics that is useful to me as an object does not receive the physical collisions.

The soil itself should continue to receive collisions. So what I need is to disable physical collision objects.

If I need a video can do in soirer or tomorrow.

Thanks

Link to comment
Share on other sites

Hi dad,

there is a way to disable objects from colliding into one another using cannon js:

http://www.babylonjs-playground.com/#A2WGF#1 , notice line 30 which disables collisions. Contact will be created, but will be ignored. This way only gravity (and other forces like impulses and velocity) will be taken into account. You can choose which body has collisions and which doesn't.

There is also a way to filter which bodies collide with the others, but this is a native cannon thing, I might write about it in the future.

Oh, and don't forget, this is a cannon feature. changing the engine to Oimo won't work anymore (one of the functionalities I still haven't united between the two)

Link to comment
Share on other sites

Thank you for ideas. it seems to me good solution that I will try to see the best.

By cons I am not sure I understood your second solution DK with physics constraints. A small example would help me understand better.

Link to comment
Share on other sites

This does not work as expected I think. I would like on the ground collision is enabled and the collision is off 2 spheres collide for example.

On this PR, I activate the collision as you Raanan and offers on the sphere I disable. But the sphere having no collision happens when even through the ground.

In this case, I think the solution of 2 Deltakosh could be interesting, but I did not really understand. It should I prevents two object to be ejected into contact with each other.

http://www.babylonjs-playground.com/#A2WGF#2

Link to comment
Share on other sites

Hi dad72,

to do that you will have to use cannon's collision groups and masks:

http://www.babylonjs-playground.com/#A2WGF#3

just a note, the collision group and mask are not indices, they are binary operations. 1 in binary = 0001, 2 in binary - 0010 , so it works. but with 3 i(0011 in binary) it might not work as expected. Not a lot of time to explain, but I hope this will get you further. 

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