Jaymun723 / vysics-engine

A "simple" 2D impulse based, rigid body physics engine.

Home Page:https://jaymun723.github.io/vysics-engine/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vysics Engine

⚠️ This project is still in early development !

A 2D impulse based, rigid body physics engine for the web. The goal of this project is not to create a state of the art physics engine. The goal is to create an understandable code that people can read & used to better understand classic physics.

πŸš€ Try it online

Based on:

Implemented & Todos

βœ…: Implemented

πŸ”§: Still needs some work

πŸ”œ: Not implemented but planned

Physics parts

  • Shapes:
    • Circle βœ…
    • Rectangle βœ…
    • Convex Polygons βœ…
    • Any type of Polygons (decomposition in convex polygons) πŸ”œ
  • Forces:
    • Gravity βœ…
    • Drag βœ…
    • Linear / Angular dumping πŸ”œ
    • Constraints πŸ”œ
    • Joints πŸ”œ
  • Integrations:
    • Verlet integration βœ…
  • Collisions:
    • Broad Phase:
      • Brute method βœ…
      • Grid method βœ… πŸ”§
      • R-Trees method πŸ”œ (rbush for inspiration)
    • Narrow phase:
      • SAT βœ…
      • GJK πŸ”œ
    • Resolution based on impulse βœ… πŸ”§
    • Continuous detection πŸ”œ (Physics for Game Programmers; Continuous Collision)

More engine related parts

  • Debug drawings (using Vancas) πŸ”œ
  • Tests (using jest) πŸ”œ (maybe never 😞)
  • Integration with Vancas πŸ”œ
  • Optimisation (not a priority) πŸ”œ

Examples

The playground and more importantly its code are a good example on how to use the vysics engine.

More examples will come after πŸ”œ...

Documentation

W.I.P.

For the moment you may want to generate docs using TypeDoc.

About

A "simple" 2D impulse based, rigid body physics engine.

https://jaymun723.github.io/vysics-engine/


Languages

Language:TypeScript 97.6%Language:HTML 1.5%Language:CSS 0.8%Language:JavaScript 0.1%