possible to make a "one way" wall...

khoowaikeong
Posts: 43
Joined: Fri Jun 15, 2012 7:11 am

possible to make a "one way" wall...

Post by khoowaikeong »

a wall you can walk thru from one side, but not the other... :shock:
kinda like a forcefield...
zarlox
Posts: 31
Joined: Tue Apr 26, 2011 5:52 pm

Re: possible to make a "one way" wall...

Post by zarlox »

One possible way of doing this would be to use a collision callback. Inside the callback, you check your dynamic body and see which side of the object is he coming from (looking at velocity direction). Depending on the direction, you cancel the collision or you let it collide.

There might be better ways though.
khoowaikeong
Posts: 43
Joined: Fri Jun 15, 2012 7:11 am

Re: possible to make a "one way" wall...

Post by khoowaikeong »

just an update, i follow the suggest and implemented it by overriding the response function in the dispatcher. it work great. :lol:

thanks for the idea!