stardance has been extended another month! the new deadline is october 31 :)

You are browsing as a guest. Sign up (or log in) to start making projects!

7h 41m 19s logged

The end?

Probably not, but it sounds cool and is a Minecraft reference.
Anyway, as you can see, I (sadly along with the help of an LLM, since I’m not the best at physics (i promise I only used it to explain the physics part and fix some insanely weird bugs)) implemented the collision system.

What it took

So, to achieve this and not make my computer burn down, I used a spatial grid. The way this one worked is:

  • I added 2 buffers, one for cell heads, and other for next particles
  • Created a linked list using those, with the last one pointing to index -1.
  • Then, using some nonsense calculations, for every particle I checked every particle in their own cell and the 8 surrounding ones. That way I didn’t have to make a literal billion if statements per second.
  • Then I fiddled around with making the particles stop moving on their own, and bim bam boom, I’ve got a nice layer of particles at the bottom.

What’s next?

I probably won’t finish this during stardance, but I’ll add some mouse interactions so the simulation isn’t so stagnant, and that should probably be it.

Attachments

In the attachments you’ve got a simulation of 2,000 and 100,000 particles, and a screenshot of the final result.

0
33

Comments 2

@Knaj

HOW THE FUCK ARE THEY CORRUPT

@Knaj

too bad, i guess.