Particle collisions (with cache)

Show off your games, demos and other (playable) creations.
Post Reply
User avatar
darkfrei
Party member
Posts: 1204
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 8998 times
particle-collisions-01.love
(1.36 KiB) Downloaded 339 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: 1204
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 8936 times
particle-collisions-02.love
(2.08 KiB) Downloaded 326 times
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
darkfrei
Party member
Posts: 1204
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 8570 times
particle-collisions-03.love
(2.16 KiB) Downloaded 314 times
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
麻猫和黄猫
Prole
Posts: 2
Joined: Tue Jun 13, 2023 10:58 pm
Location: china

Re: Particle collisions (with cache)

Post by 麻猫和黄猫 »

hi,i am from china , your game its the only one i can understand in this fourm, its very helpul ,i must say thanks to you
User avatar
darkfrei
Party member
Posts: 1204
Joined: Sat Feb 08, 2020 11:09 pm

Re: Particle collisions (with cache)

Post by darkfrei »

麻猫和黄猫 wrote: Thu Mar 28, 2024 4:54 pm hi,i am from china , your game its the only one i can understand in this fourm, its very helpul ,i must say thanks to you
Thanks! I am learning how to code and I've made alot of small programs: https://github.com/darkfrei/love2d-lua-tests
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
Post Reply

Who is online

Users browsing this forum: Amazon [Bot] and 7 guests