Finding right vector to resolve collision

Started by
1 comment, last by ????????? ???????? 9 years, 4 months ago

Hey guys

Recently I read this papers about Separating Axis Theorem http://www.metanetsoftware.com/technique/tutorialA.html

So, I started to write my own physical engine, but there's trouble on my way:

4q_.jpg

Here's "player" (shown as blue rectangle) ovelaying two wall blocks (shown as green rects). Player's speed vector shown as red arrow. According this (http://www.metanetsoftware.com/technique/tutorialA.html) "player" sholud be extruded along axis with minimal overlay value. Finded extruding vector for object "B" seems to be logical, unlike object's "A" vector. The problem is that if "player" moving along the wall it start to twitch down when collision like that happens.

I have an idea to move away "player" in reverse direction of its speed vector somehow. But still I need to find right normal to collision side to resolve impulses.

What can I do?

sorry for my broken language

Advertisement

You could find out what edges are internal to the geometry and mark those so they are ignored in collision.

Another thing I would recommend anyway would be to make your character collision shape a sphere or a pill shaped. Having rounded edges will help your character slide over edges. This will help prevent the player from getting stuck on small bumps.

My current game project Platform RPG

Thanks a lot! This information is super-helpful!

This topic is closed to new replies.

Advertisement