/cpparticles

☄️ A very basic 2D physics engine written in C++. Rigid body dynamics, soft body dynamics (mass-spring model) and collision detection. Includes SFML demo programs.

Primary LanguageC++MIT LicenseMIT

CPParticles

A basic 2D physics library-ish written in C++ with included SFML demo programs. Made for practice and funsies with some guidance from this Python tutorial.

Also the Line and QuadTree guidance and learning from this.

Installation

To use CPParticles in your project, include the include and src folders in your project directory. The cpparticles.hpp header file includes all the header files in the library:

#include "include/cpparticles.hpp"

Alternatively, you may also choose to include the individual header files.

Demo

This repository includes three demo files for your viewing pleasure (and also, in the meantime to serve as examples on how to use this library and demonstrate its capabilities because this readme is yet to be made fully extensive).

Compiling the demo programs requires SFML to be installed.

collisions.cpp

This program demonstrates particle physics in the library within the standard environment.

Collisions demo

gas_cloud.cpp

This program demonstrates how changing the environment attributes in the library can be used to simulate a gas cloud.

Gas cloud demo

soft_body.cpp

This program demonstrates the use of springs to create a soft body.

Soft body demo

License

This project is licensed under the MIT license. See LICENSE.md for details.