"One way" reaction

Post Reply
mrijm
Posts: 1
Joined: Mon Oct 03, 2016 11:00 am

"One way" reaction

Post 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!
benelot
Posts: 350
Joined: Sat Jul 04, 2015 10:33 am
Location: Bern, Switzerland
Contact:

Re: "One way" reaction

Post 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.
hyyou
Posts: 96
Joined: Wed Mar 16, 2016 10:11 am

Re: "One way" reaction

Post 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.
benelot
Posts: 350
Joined: Sat Jul 04, 2015 10:33 am
Location: Bern, Switzerland
Contact:

Re: "One way" reaction

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