Skip to content

A gravity simulation with visual spacetime curvature where you can drag and throw celestial bodies to observe realistic orbital mechanics and gravitational interactions

License

Notifications You must be signed in to change notification settings

FSDevelop/gravity-simulator

Repository files navigation

Orbiter

A gravity simulation with visual spacetime curvature where you can drag and throw celestial bodies to observe realistic orbital mechanics and gravitational interactions.

Features

  • Real-time gravitational physics simulation
  • Visual spacetime grid showing gravitational warping
  • Interactive drag and throw mechanics
  • Adjustable gravity constant
  • Infinite zoomable universe
  • 3D-styled celestial bodies with shadows

Controls

  • WASD: Move camera
  • +/-: Zoom in/out
  • Q/E: Decrease/increase gravity constant
  • Mouse drag: Drag and throw bodies

Setup

Install dependencies:

npm install

Run as desktop app:

npm start

Run in web browser:

npm run web

Then open http://localhost:8000

Project Structure

orbiter/
├── electron.js
├── index.html
├── main.js
├── phaser.min.js
└── src/
    ├── Body.js
    ├── Bodies.js
    ├── Graphic.js
    ├── Input.js
    ├── Physics.js
    └── scenes/
        ├── MainScene.js
        └── UIScene.js

License

MIT

About

A gravity simulation with visual spacetime curvature where you can drag and throw celestial bodies to observe realistic orbital mechanics and gravitational interactions

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published