Skip to content
/ yape Public

Yape (Yet another physics engine) is a rigid body impulse based physics engine written in C++

License

Notifications You must be signed in to change notification settings

zzef/yape

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yape

Yape (Yet another physics engine) is a rigid body impulse based physics engine written in C++. This was written to gain better understanding into rigid body physics engines as well as my personal enjoyment. It is riddled with tonnes of issues that I hope to fix as the time goes by. Features include:

  • Random polygon generation
  • Collision detection (Separated axis theorem)
  • Impulse based collision response
  • Broadphase
  • Frictional impulse (Coulomb friction)
  • Joints (Modelled with constraints)
  • Physics interpolation (For lower physics framerates)
  • Collisions (mid-phase and narrow phase)
  • Restitution (elastic and inelastic collisions)
  • Physical properties (mass, area, density etc.)

Useful resources for this project

Here are some of the resources I used for this project. I know everyone loves Erin Catto but I found the blog posts by dyn4j (specifically on constraints) and Randy Gaul to be the most helpful.

Todos and Further Improvements

  • Spacial Hashing
  • Implement warm starting (contact coherence) and impulse accumulation for better stability (especially at lower frames, sub 60fps).
  • Fix polygons disappearing bug.
  • Fix random jitter.
  • Allow for user to exert force via click and drag (perhaps model with a point constraint).
  • Remove unneccesary recalculations during manifold generation.
  • Finish Circle to circle (left the easiest till last) and circle to polygon collision.
  • Lots and lots of code refactoring.

Dependencies

  • gcc

How to run

You will need linux to run. Please do the following:

git clone https://github.com/zzef/yape.git

make clean

make

make install

./yape

How to use

  • Click screen to generate polygons and add them to the scene.
  • press 'b' to switch to box generation mode.
  • press 'i' to toggle interactive mode (in interactive mode you can drag polygons around).
  • press 'r' to reset current demo
  • press 'a' to toggle view constraints
  • press 'x' to clear all polygons
  • press 't' to toggle view contact points