Skip to content

Latest commit

 

History

History
101 lines (73 loc) · 3.81 KB

README.md

File metadata and controls

101 lines (73 loc) · 3.81 KB

2D-Physics-engine

This repository includes the source code for a 2D physics engine implemented in JavaScript, entirely from scratch without reliance on any external physics libraries. The engine is capable of simulating ball collisions, gravitation and other things, adhering to real-world physical laws such as the law of conservation of energy.


⚠️Please be advised that this project is still in it's beta phase and may still experience bugs and glitches.⚠️

Summary

Features

  • More than a hundred ball collisions in real time.

  • Ability to simulate multiple objects with varying mass and velocity

  • The engine provides control over the friction and gravity of each individual object.

  • Creating walls and curves.

  • Can copy objects, ball and walls.
  • Realistic simulation of gravitation and object's attraction.

  • Perfectly circular orbit around any object.

  • Integration of springs in order to constraints movements.

  • Allow to zoom out and zoom in, and move the camera with right click.

Installation

  1. Clone this repository
  2. Serve the index.html file through a server service, such as express,flask or by utilizing the built-in server feature in Visual Studio Code.

Examples

To showcase the capabilities of the physics engine, here is some examples:

Multiple collisions in a bottle scenario

Double pendulum experiment

Newton's gravity implementation

Gravity prediction

All features working simultaneously

Credits