Particle collisions (with cache)

Show off your games, demos and other (playable) creations.
Post Reply
User avatar
darkfrei
Party member
Posts: 1168
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 5173 times
particle-collisions-01.love
(1.36 KiB) Downloaded 174 times
Last edited by darkfrei on Sun May 02, 2021 5:39 pm, edited 1 time in total.
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
darkfrei
Party member
Posts: 1168
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 5111 times
particle-collisions-02.love
(2.08 KiB) Downloaded 168 times
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
darkfrei
Party member
Posts: 1168
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 4745 times
particle-collisions-03.love
(2.16 KiB) Downloaded 149 times
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
Post Reply

Who is online

Users browsing this forum: ShoesForClues and 15 guests