Sign in to follow this  

Platformer Physics - what to do with multiple resolves?

This topic is 2049 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'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

Share this post


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

Share this post


Link to post
Share on other sites

This topic is 2049 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this