GithubHelp home page GithubHelp logo

faishasj / cpparticles Goto Github PK

View Code? Open in Web Editor NEW
26.0 2.0 3.0 233 KB

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

License: MIT License

C++ 100.00%
cpp-library physics-simulation sfml

cpparticles's Introduction

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.

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.

cpparticles's People

Contributors

faishasj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.