0
\$\begingroup\$

I've encountered a problem in my attempt to implement Collision Handling for a game I'm creating, involving a collision with two angled platforms.

I'm using GJK-EPA for detecting/handling collisions so I can pull the penetration vector and depth from each collision, and using this I have been calculating the angle of the surface the player collides with.

What I don't understand, is how I should resolve a collision when the character is moving from one slope to a steeper slope, one slope to a shallower slope and flat-surface -> slope and vice versa.

I attempted comparing penetration depths but due to the nature of GJK, I can only do this with some additional vector maths which then refuses to work for steep->shallow slopes. Additionally: It sometimes seems to 'spasm' on direct contact with vertices.

Basically, can anyone tell me a good/common way of handling angles of objects that are touching TWO platforms, using GJK-EPA?

Thank you!

(To note: I'm relatively new to game development, and I'm trying to get some smooth slope physics working, just so you know the 'situation').

\$\endgroup\$

1 Answer 1

-1
\$\begingroup\$

not too sure either, but I could imagine using the angle of incidence (movement vector), mirroring it along the normal of the slope/surface and applying the resulting vector to your movement. this way a steeper slope would affect much compared to a shallow slope. your movement vector is a mix between gravity and applied forces such as user input accerlerating your object over time.

I don't know GJK-EPA nor do I understand what you mean with penetration depths. Do I understand you at least correctly?

\$\endgroup\$
1
  • \$\begingroup\$ You answer does not really address the question's issue. When asking what the poster intended, a comment is the right place for that. \$\endgroup\$ Commented May 18, 2013 at 15:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .