Jump to content

View more

Image of the Day

Adding some finishing touches...
Follow us for more
#screenshotsaturday #indiedev... by #MakeGoodGames https://t.co/Otbwywbm3a
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Platformer Physics - what to do with multiple resolves?

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 bombshell93   Members   

245
Like
0Likes
Like

Posted 05 May 2012 - 12:09 PM

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

#2 CulDeVu   Members   

3027
Like
1Likes
Like

Posted 05 May 2012 - 02:22 PM

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 tongue.png

 

"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

 


#3 bombshell93   Members   

245
Like
0Likes
Like

Posted 06 May 2012 - 09:01 AM

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.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.