Code Monkey home page Code Monkey logo

quarkphysics's Introduction

Quark Physics

QuarkPhysics is a 2D physics engine designed for games. Its goal is to provide a reasonable approach to simulate rigid bodies, soft bodies, and different physics models together.

Examples | API Documentation | wiki(coming soon)

Note: The project is in the development phase until v1.0.


Example 01

Show Examples

Example 02 Example 02 Example 02 Example 03 Example 02

Features

  • General Features

    • Primitive shape types (circle, polygon, rectangle...etc)
    • Physical properties (mass, area, restitution etc.)
    • The API is designed specifically for 2D video games.
    • Raycasting
    • Collision layer masks for advanced collision filtering
    • SAP for broadphase
    • Supports sleeping islands to improve CPU performance.
    • Flexible and advanced event system.
    • It uses pixels directly as a unit without any abstractions.
    • Unlimited shape-mesh support for bodies.
    • Simple and consistent API
    • External .qmesh file support. There is also QMeshEditor app for create/edit/manage qmesh files.
  • Rigid bodies

    • Convex polygons support.
    • Joints to connect bodies
    • Reasonable stability for stacked objects.
    • Kinematic bodies for creating controllable physics objects.
    • Area bodies for detecting and reporting collisions.
  • Soft Bodies

    • Springs to connect particles.
    • Mass-spring model.
    • Area-volume preserving model.
    • Shape matching features.
    • Self collisions.
    • PBD dynamics.
    • Internal springs and internal particles for adding more complexity to soft body simulations.
    • Customizable constraints for adding more control to simulations.
    • Advanced particle methods.

Building Examples

You need to install SFML and CMake on your system before.

Download project, enter the main folder and call this;

    ./build.sh -r

Another way is that compiling the project directly via gcc if you're on linux call;

    ./run_linux_fast.sh -r

Using

Copy the "QuarkPhysics" named subfolder in the main folder to your project and use it.

Third Party

  • nlohmann's json for the json parsing. (Importing meshes via *.qmesh files)
  • SFML library for window,input,opengl.

Roadmap

  • 1.0
    • API revisions (v0.9x)
    • Optimizations ( v0.9x)
    • Bug fixes
  • 1.1
    • Automatic conversion of concave polygons to convex polygons (added v0.9x)
    • Breakable spring connections.
    • UV mapping features to QMesh
  • 1.2
    • Determinism (with fixed point method)
    • Destructable rigid bodies.
    • Continuous collision dedection (CCD)
    • Multithreading
  • 1.3
    • Fluid dynamics

quarkphysics's People

Contributors

erayzesen 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  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  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  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  avatar  avatar

quarkphysics's Issues

Pressurized soft bodies can roll on their own

Gridded pressurized soft body meshes of high poly spheres roll to the right on completely flat ground. To recreate, change the spawned soft body in examplesceneblobs.cpp to have a poly count of 32 or higher, and up the rigidities.

Fails to build. Possibly related to case sensitive file systems?

../QuarkPhysics/qjoint.h:30:10: fatal error: QRigidBody.h: No such file or directory
30 | #include "QRigidBody.h"
| ^~~~~~~~~~~~~~
compilation terminated.

I get a bunch of no file or directory messages trying to build the project. Perhaps my FS is case sensitive? On Garuda Linux, with a BTRFS filesystem.

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.