After debugging some physics issues in PICORACER-2048 I decided to make a little area to play around with improving the physics and collisions.
I'm using the "Separating Axis Theorem" to find collisions, and clipping to find the contact points.
Lots of work to do still, many optimisations can be made.
Known issues: contact points are sometimes broken, collision response is not always right.
Optimisations to make:
- cache AABB
- cache world polygons
- don't check AABBs that are not in the same area
- don't check equivalent axes more than once
- remember the previous axis since it's likely to be the same or next to it on the next iteration.
Cool! Would it be hard to code it to be general-purpose physics library for pico? Also why not use circle and square collisions when possible as additional optimizations? Some of the shapes in the playground are approaching circles so player wouldn't notice much of a difference if it would be check against circle of specific radius.
Well it's effectively a general-purpose physics library for pico (once the bugs are fixed).
Yes, I plan to add in circle-circle collisions and circle-convex polygon collisions.
hey man, this is completely irrelevant, but i am part of the celeste classic community. we found you as the first person to start making a level pack, but havent been able to find it. i hope you can come back to me and tell me more about it, contact us here https://discord.gg/erxCgvb
[Please log in to post a comment]