Platformer Physics - what to do with multiple resolves?

Started by
1 comment, last by Bombshell93 11 years, 11 months ago
I've got my platformer physics using SAT.
I'm setting up the later parts of the system, namely setting the order of things.

Step Begin
Velocity logic (player controls, Acceleration, gravity, etc.)

Step Middle (running parallel with logic that does not modify velocity or position)
Check with velocity, world collisions.
Calculate new velocity (stays the same if no collision)
Check with both new velocities, object collisions (I do project the shapes as if they were elongated in velocities direction, so fast moving objects are accounted for)
Calculate new velocity (stays the same if no collision)

Step End
Move object,
Run logic in need of updated position (parallel: Update broad-phase grid system.)

I'm stuck on Calculate new velocity because I have multiple resolves from the world collisions.
I didn't want to do it one by one because if one resolves into another world piece which resolves into another world piece, etc. you could end up hitting things you weren't going to hit with your intended velocity.
But now I'm not sure what to do with the list of resolves.

Any and all help is appreciated,
Thanks in advanced,
Bombshell
Advertisement
Sounds like a problem of over-compensation: http://www.wildbunny.co.uk/blog/2011/03/25/speculative-contacts-an-continuous-collision-engine-approach-part-1/

I'm sorry about any spelling or grammar mistakes or any undue brevity, as I'm most likely typing on my phone

"Hell, there's more evidence that we are just living in a frequency wave that flows in harmonic balance creating the universe and all its existence." ~ GDchat

I'm assuming the contact normal is the normal perpendicular to the smallest resolvable intersection?
But I'm still a bit confused.
I'm assuming it works by getting the shortest distance for object A to move without intersecting object B.
Then checks if the current velocity travels further than necessary, if so apply new velocity, else leave alone?
I'd just like to make sure I have the concept right, always helps to know how the code functions before implementing it.

This topic is closed to new replies.

Advertisement