chrisgilbertjr / spring

a lightweight 2D rigid body physics engine for games.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spring game dynamics

Spring game dynamics is a small small physics engine used to simulate rigid bodies in 2D. Its written in C and does not use any external libraries. It can be built using MS Visual Studio, but UNIX builds using CMake are in the works. Spring was developed mainly for educational purposes, so I hope you can find it useful!

Features:

  • Circle, convex polygon, and line segment collision primitives.
  • Supports multiple shapes per rigid body, allowing for the creation of non-convex shapes that interact believably.
  • Broadphase collision detection using an array based sweep and prune algorithm.
  • Narrowphase collision detection done using the GJK algorithm to determine if two objects intersect.
  • Expanding polytype algorithm used to extract contact information from GJK collision.
  • Fast constraint solver using the sequential impulse algorithm.
  • Eight different joint types that allow the creation of things such as vehicles, bridges and ragdolls

Demos

Demos in Spring are built using the included demo API, which is based on GLFW3 and OpenGL 3.3. To run the demos, build the Visual Studio solution msvc/vs2013/demos. UNIX builds will be available in the future. Below i will include a link to videos of each demo running.

About

a lightweight 2D rigid body physics engine for games.


Languages

Language:C 97.8%Language:C++ 1.4%Language:Objective-C 0.7%Language:CMake 0.1%