Jump to content
  • Advertisement
Sign in to follow this  
????????? ????????

Finding right vector to resolve collision

This topic is 1482 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!