Distance and minkowski difference for platformer

Started by
1 comment, last by Finalspace 9 years ago

Hi there,

i am having trouble figuring out a way how to calculate the correct distance and normal from a minkowski difference (AABB vs AABB = Point vs Extended AABB).

I tried computing the closest point from the player aabb center against the fatten boundary aabb and used this to determine the normal and then calculating the distance, but this produces problems when the player falls down due to gravity and also walks for example to the right where are walls and he get a normal from that side wall which points upwards or downwards and he will get stuck in the air or worst, get shoot down O_o...

Also this introduces the issue that the player can glide over holes even when he moving really slow.

My current way to solve this problem, is to get rid of all that flexibility and use sensors on left and right and top and bottom with fixed normals which then are used to determine the distance to the boundary - but these requires that all my geometry are aabb´s which is not what i want in the future.

So what are a good way to detect the distance (positive for non-penetrating cases and negative for penentrating cases) against two objects (AABB vs AABB, but which may be extended to other shapes as well - but dont produces these issues i descriped above?

Thanks,

Final

Advertisement

Well the GJK algorithm gives you closest points, and you can use the vector between these two points as a normal. Is this what you're looking for?

Well the GJK algorithm gives you closest points, and you can use the vector between these two points as a normal. Is this what you're looking for?

I know about GJK, but had never used it before - thought it was too complicated and not required for a simple platformer game.

Let me check if there are some articles in the realtime collision detection book i have lying here...

This topic is closed to new replies.

Advertisement