- I want to make a 2D particle simulator in C++ using SFML
- The focus of this simulator will be on electromagnetism
- Particles will have position, velocity, mass, and a charge
- You will be able to add particles
- Basic GUI
- 2D particle simulator opens with a 800x600 window
- right click spawns positive particles, left click spawns negatives
- particles obey Coulomb's law & Lorentz force
- FPS + Particle Count HUD
- Electric field lines
- Press up/down to increase/decrease simulation speed
- Pause simulation with Space key
- Pressing Left Shift will pause any particle touching your cursor
- Save and load simulation state with Ctrl+S and Ctrl+O
- Visual Studio 2022
- MSVS Desktop Development with C++ workload
- CMake 3.20 or later
- vcpkg
- Git
git clone https://github.com/etaiami09-cmd/PSim.git
cd PSim
* git clone https://github.com/microsoft/vcpkg.git C:/dev/vcpkg
* C:/dev/vcpkg/bootstrap-vcpkg.bat
* C:/dev/vcpkg/vcpkg install sfml
* C:/dev/vcpkg/vcpkg integrate install
mkdir out/build
cd out/build
cmake ../.. -DCMAKE_TOOLCHAIN_FILE=C:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build .
./PSim.exe
I doubt anyone will ever see this repo, let alone actually use it, but if someone does find an issue they want fixed, they can either open an issue ticket or try to fix it themselves and send a pull request. Pull requests must explain the issue in detail, be well documented, and function properly.
I have not yet added any tests, but when i do, any pull request must pass all tests before being sent
This project uses tinyfiledialogs by mtolly for cross-platform file selection