Advertisement Jump to content
Sign in to follow this  
Ussyless

Collision handling- corners & jumping

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

greetings, i've drawn a diagram to explain my problem

 

R3j5zSE.jpg

so basically, my problem is, when jumping up into, or dropping onto a corner, in some situations, it will overlap too much in the Y axis, so it will be handled by the X axis, my system basically compares which one is overlapping the least, then takes action based on that

 

i'm wondering if anyone has any suggestions to stop this happening, perhaps somehow bias it towards parallel surfaces, or based on the speed of the  object

 

multisampling could work somewhat, but i was hoping for a more refined solution that won't use so much power

 

any ideas?

Share this post


Link to post
Share on other sites
Advertisement

One simple, but more expensive solution, is to reduce the time step for the particle close to the wall. This way the particle will move less between time steps, decreasing the likelihood of the situation you described.

 

Edit: actually this won't help. Sorry :)

Edited by brucedjones

Share this post


Link to post
Share on other sites

i'm wondering if anyone has any suggestions to stop this happening ... or based on the speed of the  object

 

That sounds right.  

 

You may want to investigate continuous collision detection.  Incorporating speed or velocity should give you a "first time of impact" along the y-axis.

Edited by DT....

Share this post


Link to post
Share on other sites

Greetings, yeah, i just tried basing it off of the speed (overlap / speed), so for example, if the y overlap is 3, and the yspeed is -5 (abs 5), and the x overlap is 1, and x speed is 1, it will do

if (3/5 < 1/1 handle that axis first), this is showing some interesting glitches when jumping while moving fast into a roof though, i'll try to isolate the cause, i have a feeling that i could combine both approaches somehow to fix that, not sure yet

Share this post


Link to post
Share on other sites

So i've created a functional example that i can play with, and monitor results, see what happens by giving it certain variables (before i was using a platformer type system i had made, and it was hard to see exactly what conditions were causing glitchy collisions)

 

anyway, as you can see in this picture, it seems to be working for now,i think i'll have to put it back into a platformer example so i can experiment with it

 

edit: also, the green line is the movement vector

 

KInzn7v.png

Edited by Ussyless

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!