Skip to content

etaiami09-cmd/PSim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++ Particle Simulator

Idea

  • 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

Current Features

  • 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

Installation Guidelines

Requirements

  • Visual Studio 2022
  • MSVS Desktop Development with C++ workload
  • CMake 3.20 or later
  • vcpkg
  • Git

Setup

Clone Repository

git clone https://github.com/etaiami09-cmd/PSim.git
cd PSim

Install vcpkg and SFML

* 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

Configure and build

mkdir out/build
cd out/build
cmake ../.. -DCMAKE_TOOLCHAIN_FILE=C:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build .

Run

./PSim.exe

Contribution Guidelines

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.

Tests

I have not yet added any tests, but when i do, any pull request must pass all tests before being sent

Credits

This project uses tinyfiledialogs by mtolly for cross-platform file selection

About

My first real project - A full particle simulation written in C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors