Giter Site home page Giter Site logo

leandrosq / cpp-physics-sandbox Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 4.53 MB

Simple Verlet physics sandbox

Home Page: https://leandrosq.github.io/cpp-physics-sandbox/

CMake 19.38% Shell 2.12% C++ 63.58% JavaScript 6.65% HTML 3.30% CSS 4.98%
cpp emscripten physics verlet wasm cpp23 sandbox verlet-integration verlet-physics

cpp-physics-sandbox's Introduction

C++ Simple physics engine

Implements a simple physics engine in C++ based on Verlet integration and Verlet constraints.

Live demo here

About

You can check the WEB version here. It is a port using WASM generated by Emscripten using WebGL on the browser.

  • Restricted only to circles
  • Supports gravity
  • Supports collisions
    • Implements a Quadtree for collision detection
  • Supports constraints
    • Implements both a circle and a rectangle world constraint
  • Supports user interaction
    • Dragging
    • Spawning
    • Explode

Controls

Desktop

Left click to spawn circles

Right click to drag circles

Middle click to explode circles

Space bar to flip the Gravity vector

Z to toggle Gravity ON/OFF

Up arrow to increase the Gravity force

Down arrow to decrease the Gravity force

Left arrow to decrease the Gravity angle

Right arrow to increase the Gravity angle

ESC to exit

Other controls included on the GUI can be used with the mouse as demonstrated below.

Project

Resources

Name Description
ClangD Language Server for C++
CMake Cross-platform open-source make system
Clang-tidy A clang-based C++ “linter” tool
Clang-format A tool to format C/C++/Obj-C code
Emscripten Used for the web port, generating the WASM binaries.
Raylib A simple and easy-to-use library to enjoy videogames programming
Dear ImGui Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies
Dear ImGui Raylib Dear ImGui bindings for Raylib
NES CSS NES.css is NES-style (8bit-like) CSS Framework.
Github Actions Used for CI/CD
Github Pages Used for hosting the web version

cpp-physics-sandbox's People

Contributors

leandrosq avatar

Stargazers

 avatar

Watchers

 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.