This project is a Box2D simulation that implements Newton's law of universal gravitation to simulate gravitational forces between dynamic bodies. It is developed as a project for the Physics 2 class at CITM University.
The main goal of this project, created for the Physics 2 class at CITM University, is to showcase the behavior of gravitational forces using Box2D's physics engine. The simulation involves creating a 2D environment where dynamic bodies interact with each other based on the gravitational pull they exert on one another.
Caption: Example of the Box2D Gravity Simulation in action.
- Simulation of Gravitational Forces: Bodies within the simulation interact with each other according to Newton's law of universal gravitation.
- Box2D Integration: Utilizes Box2D, a popular 2D physics engine, for handling the physics simulation.
- Visualization: Provides visualization of bodies and their interactions within the simulation.
To run this project locally:
- Dependencies: Ensure you have the necessary dependencies installed.
- Build: Build the project using the provided build system or IDE.
- Run: Execute the simulation to observe the gravitational interactions between bodies.
- F1: Activate / Deactivate debug mode
- 1: Spawn planet on mouse position
- 2: Spawn crate (debug purpouses)
- 3: Spawn chain (debug purpouses)
- Left Click: drag bodies (only if debug mode is ON)
-
Box2D GitHub Repository: Box2D on GitHub
-
CITM University: CITM Official Website
-
Assets planet generator by Deep Fold on Itch.io
-
Assets background generator by Deep Fold on Itch.io
You can download the source code and executable from the Releases section.
Contributions are welcome! Feel free to fork the project, make improvements, and submit pull requests.
This project is licensed under the MIT License.