Page 1 of 1

"One way" reaction

Posted: Mon Oct 03, 2016 11:13 am
by mrijm
I need a selective impulse resolution.
Let's say we have a pair (A, B). Is there an standardised way to make A interact with B, and B to give no response to A; While, at the same time, A and B interacts with everything else in regular fashion. (Or a group, somthing like collisions masks)
Whan I say interact, I'm talking about applying impulse force after collision.

Quasi kinematic body, that works in the same simulation, but isn't infected by a select group of objects.

Thanks!

Re: "One way" reaction

Posted: Sat Oct 29, 2016 7:36 am
by benelot
I am not sure if you can get collision filters where group 1 collides with group 2 but not vice versa. You can try using http://www.bulletphysics.org/mediawiki- ... _Filtering.

But why would you want this effect? I mean that would get you for example two balls in opposite direction, but when they hit one (with full reflection and center hit) inverts its direction, but the other does not, so they both move in the same direction. That is really strange physics. I am interested why you would want this.

Re: "One way" reaction

Posted: Sat Oct 29, 2016 10:34 am
by hyyou
Sorry, I don't think "collision filters" can solve OP's problem.
Agree with Benelot that what OP asked for is potentially against Physics rule - OP is probably developing a game.

The solution should be "custom collision response", but I don't know how, specificially.
There may be a certain Bullet's callback that should be overridden in this case.
I also curious how to achieve this feature.

Re: "One way" reaction

Posted: Sun Oct 30, 2016 8:39 am
by benelot
If you include collision of object1 with object2 but not object2 with object1, then this might be exactly what is required. But I do not know if Bullet then disables the collision completely. In case this does not work, just store the original position and rotation, linear and angular velocity for the object that should not collide and detect collision using a method from here:http://www.bulletphysics.org/mediawiki- ... d_Triggers. Then, if you detect your target collision, just reset your object to where it was before and how it moved before. Could be the easiesy way to achieve this. But I would give the filter option a try as well.