Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 multithreading physics-simulation sdl2
Last synced: about 12 hours 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 (5 months ago)
- Default Branch: main
- Last Pushed: 2024-12-17T10:30:23.000Z (about 1 month ago)
- Last Synced: 2024-12-17T11:27:46.039Z (about 1 month ago)
- Topics: data-structures, multithreading, physics-simulation, sdl2
- Language: C++
- Homepage:
- Size: 416 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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