https://github.com/aaronmcleancs/particlebox
Multithreaded particle dynamics engine using spatial hashing and quad tree collision detection to simulate forces among particles.
https://github.com/aaronmcleancs/particlebox
data-structures high-performance-computing multithreading physics-simulation sdl2
Last synced: 25 days ago
JSON representation
Multithreaded particle dynamics engine using spatial hashing and quad tree collision detection to simulate forces among particles.
- Host: GitHub
- URL: https://github.com/aaronmcleancs/particlebox
- Owner: aaronmcleancs
- Created: 2024-08-17T09:31:52.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-07T18:11:07.000Z (7 months ago)
- Last Synced: 2025-04-07T19:25:55.776Z (7 months ago)
- Topics: data-structures, high-performance-computing, multithreading, physics-simulation, sdl2
- Language: C++
- Homepage:
- Size: 509 KB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Performant Computing Particle Simulation
Multithreaded particle simulation written in C++ using SDL2. Simulates basic physics interactions between thousands of particles.
Features
Spatial Partitioning
Replaced brute-force O(N²) collision checks with a partitioned grid.Multithreading
Divided the particle set into chunks processed in parallel using threads.Memory Management & Random Generation
Pre-allocated particle storage and replaced rand() with modern, thread-local rngs.Installation
Prerequisites
- Homebrew (for macOS users)
- C++ compiler supporting C++11 or later
- SDL2 and SDL2_ttf librariesSteps
1. Install SDL2 and SDL2_ttf
brew install sdl2 sdl2_ttf2. Build the Project
make3. Run the Simulator
./ParticleSimulator