iphone - Box2d Collision Detction - to tell which edge it collided? -


I am using box2d to find out the collision for my game.

In most cases, something like "Detecting the enemy" like detection of conflict or things that are identical without regard to direction.

In my case, collision detection is used to prevent the protagonist from passing through the wall. Therefore, it is important to know that from which direction he reached the wall, so I can update my situation properly. For now, my template code is:

  if ((collide!) {Rabbit. CSP (rabbit. Position.x + (pitch / 4), rabbit. Power. Or + ((roll / 4) * (- 1))); } And if (abdomen (roll)> stomach (pitch)) {rabbit. COP (rabbit .position.x + (pitch / 4), rabbit.} And if (abdomen (pitch)> eb (roll) {rabbit C.P.P (rabbit.fg.exe, rabbit.Comp.Y ++ (roll / 4) * (- 1));} Other {Rabbit.Search = CCP (Rabbit.Search.A., Rabbit.Com)   

Of course, lots of code in this code There are problems, almost a lot are listed here. So, there is no way, by using Box 2D, which direction from which direction can we hit the "hero" object?

Thank you in advance.

If it works then check and use

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -