Particle collisions (with cache)

Show off your games, demos and other (playable) creations.
Post Reply
User avatar
darkfrei
Party member
Posts: 216
Joined: Sat Feb 08, 2020 11:09 pm

Particle collisions (with cache)

Post by darkfrei »

Hi all!

I've made some easy simulation about moving particles, it was very interesting to unterstand how to use cache grid to make such simulations faster.

The first version without collisions, but squares show where I need to check this collisions :)
Yellow: no collision, green: two circle bodies in this grid square.
Attachments
2021-04-22T23_10_39-Untitled.png
2021-04-22T23_10_39-Untitled.png (92.48 KiB) Viewed 915 times
particle-collisions-01.love
(1.36 KiB) Downloaded 21 times
Last edited by darkfrei on Sun May 02, 2021 5:39 pm, edited 1 time in total.
User avatar
darkfrei
Party member
Posts: 216
Joined: Sat Feb 08, 2020 11:09 pm

Re: [WIP] Particle collisions (with cache)

Post by darkfrei »

Second version:

Added collision detection (red).
Attachments
2021-04-23T23_05_56-Untitled.png
2021-04-23T23_05_56-Untitled.png (106.22 KiB) Viewed 853 times
particle-collisions-02.love
(2.08 KiB) Downloaded 21 times
User avatar
darkfrei
Party member
Posts: 216
Joined: Sat Feb 08, 2020 11:09 pm

Re: [WIP] Particle collisions (with cache)

Post by darkfrei »

The last version, all collisions work as expected.

Here can be better static resolution: move circles back to the collision, calculate the rest dt and move particles in the new direction. Same as continuous collision detection.
Attachments
2021-05-02T19_36_02-Untitled.png
2021-05-02T19_36_02-Untitled.png (104.87 KiB) Viewed 487 times
particle-collisions-03.love
(2.16 KiB) Downloaded 5 times
Post Reply

Who is online

Users browsing this forum: VictoriaBarker and 19 guests