Skip to content

pnfox/particles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Particle Physics Collisions with SFML

This program draws particles with random velocities into a SFML window. Particles collide with each other and window boundaries. There is a small friction coefficient and particles are assumed to have the same mass.

Two classes inside particles.cpp source file, ParticlePool and Particle. ParticlePool contructor creates multiple Particle´s and stores them in a C++ vector, which is then accessed to update movement and detect collisions. Details on how collision velocities are calculated are described in source code comments.

Written in C++.

Only built on Linux so far, can´t guarantee it will work on other systems although no majoy changes will be needed.

Version: 1.0

Build and running

  1. Clone the repository

  2. Run make then ./particles

Only dependency is SFML, which you may need to install seperately. If you have trouble linking SFML then make sure pkg-config can find the pc files for this, mine are located in /usr/lib64/pkgconfig

Created by Patrick Fox, 25th July 2019

About

Particle physics collisions with SFML

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published