Jump to content
  • Advertisement
Sign in to follow this  
ajm113

2D AABB Collision Response Flip Out

This topic is 2475 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

I'm building a physics engine from scratch since I dont need fancy features or get a api which would be a over kill and learn something new.

Right now I have my collision detection working A OKAY! But the collision response is really getting to me. Whats going on is when I place a single AABB and have the player(Player AABB) walk on top of it, everything is perfect! ... but lets say you want to make a wall of AABBs so the player can't or get to a certain area. What happens if 1 physics AABB collides against 2 static AABB the physics AABB will flip out and ether appear on the bottom of the first AABB that gets checked or the "moveable" AABB will get re-positioned to back on top the first static AABB that gets checked for collision.

I've attached a video of whats going on if you can't understand what I'm trying to describe.
[media]
[/media]

Here is my code:
http://www.copypastecode.com/179297/?view=box


Is there a way to fix this to allow the "player" to be able to walk on AABBs without collision response throwing the player or objects under static AABBs?

Share this post


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