Particle collisions (with cache)

Show off your games, demos and other (playable) creations.
Post Reply
User avatar
darkfrei
Party member
Posts: 1169
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 5209 times
particle-collisions-01.love
(1.36 KiB) Downloaded 177 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: 1169
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 5147 times
particle-collisions-02.love
(2.08 KiB) Downloaded 171 times
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
darkfrei
Party member
Posts: 1169
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 4781 times
particle-collisions-03.love
(2.16 KiB) Downloaded 151 times
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
麻猫和黄猫
Prole
Posts: 1
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
Post Reply

Who is online

Users browsing this forum: No registered users and 36 guests