28 Commits

Author SHA1 Message Date
a8e3bb6104 Fix incorrect triangle normal when colliding against level geom, reverse gear, engine sound 2025-07-01 11:57:53 +04:00
00190a45fc Lots of optimizations and bug fixes for static geometry, improved debugging 2025-07-01 00:09:10 +04:00
8378b943cb Compound shapes support, better debug ui 2025-06-16 01:19:31 +04:00
735c61fd05 First implementation of track collision (non convex triangle level geometry) 2025-05-12 01:17:49 +04:00
df0fe56368 Refactor rewind to include the whole world, not just physics sceen 2025-05-08 14:32:31 +04:00
a4ed430efe Fix a bunch of collision bugs 2025-05-03 23:24:45 +04:00
8fe95ce5a0 Fork raylib to expose GetGLProcAddress 2025-05-03 00:18:30 +04:00
3bab8ac88e Proper raycasts against other rigid bodies instead of a fake plane 2025-04-27 17:06:04 +04:00
50d0401479 Implement friction in PGS 2025-03-15 20:53:45 +04:00
d1feaa0602 More progress on PGS 2025-03-09 22:54:40 +04:00
ccd987aeae Start implementing optimized substepping (collision detection only once per frame) 2025-03-08 14:50:39 +04:00
860f9f59b6 Optimize edge separation test, use SOA structs in more places 2025-03-02 21:14:12 +04:00
a1e8d0f231 Disable edge separation tests for now and make a stress test 2025-03-01 20:54:26 +04:00
0f60cdda13 Use BVH to find potential collision pairs before simulation steps 2025-03-01 20:12:54 +04:00
503d6170c2 Fix restitution and start implementing BVH acceleration for collision 2025-03-01 19:04:01 +04:00
66f42c3cee Implement restitution, better hack for static friction 2025-02-04 01:51:54 +04:00
25ff57168b Collisions for the convex shape 2025-02-02 02:41:24 +04:00
196bafb401 Static and dynamic friction working, it's starting to look pretty convincing
Still got a bug when colliding with edges at some specific rotations. Probably fucked relative position conversion somewhere and using a local pos instead
2025-01-26 22:43:23 +04:00
aca890bcb7 Super stable collision resolution
- Store collision manifold points as local to body before applying them, this way penetration can be calculated exactly for each contact point
- Fix implementation error in closest_point_between_segments
- Calculate separation for each contact point separately
2025-01-26 17:31:28 +04:00
19a1398068 Try to fix edge collision issues, more debug stuff 2025-01-23 04:06:11 +04:00
f2f23ee2e0 Proper stable collisions
Turns out when you get a collision pair YOU SHOULD HANDLE CONTACT RESPONSE FOR BOTH BODIES, NOT JUST ONE OF THEM
Otherwise they move and their next collision (if a->b, b->a are found and resolved separately) they might penetrate badly or worse and everything blows up

This is probably not as important in sequential impulse type solvers because the actual position update is deferred, but in a position based one it's pretty important as it turns out.

It's also better for performance because I don't have to run the collision query for the same two bodies two times
2025-01-23 02:16:12 +04:00
b40dd32b36 Funny boxes flying 2025-01-19 23:46:01 +04:00
4f7a494fff Interesting... collision response 2025-01-19 22:15:22 +04:00
0961b7551a Manifold contact optimization 2025-01-19 21:44:42 +04:00
82470ca3c7 Edge contacts and fix bug with face contacts 2025-01-19 18:16:52 +04:00
4af30979d5 collision detection progress 2025-01-19 04:32:36 +04:00
923cb6f459 Convex vs convex face manifolds working 2025-01-18 17:16:32 +04:00
43f8c66ec1 Start implementing convex collisions 2025-01-17 00:24:17 +04:00