yunruse / oxomoco

An amateur gravity simulation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Oxomoco

aka "How Not To Do Gravity"

When I was 17, I was taught, formally, the law of gravitation. So, of course, I hacked together a 2D gravity simulator in Löve in my spare time! And as it turns out, two years later in University, I got an assignment to make what was, essentially, this but with a few bits more. Neat, huh?

The Earth, as it appears to move about the Moon's reference frame. The simulation zooms out and shows the Sun, and simulation speeds up to show its more flower-like path

It's completely a toy project, but it has:

  • reference frames, showing you different paths in different reference frames!
  • A renderer for the gravitational field strength, which is CPU-bound so a lil slow
  • A neat grid system which fades in different grid sizes as you zoom (Scrollwheel)!
  • A simulation speed slider (Shift+Scrollwheel), which has no simulation speed limit so you can very quickly go into the Unphysical Realm and fling the Moon into the great beyond!
  • The ability to move things around in real-time, or add random comets, and see how they, ah, destabilise things!

I never got to include the Solar System with accurate orbits (because I was a kid), but I still think this is pretty neat considering I was 2017 and, like, barely sentient. Clearly so, because this thing runs its own object-oriented engine and physics.

Instructions

Download Löve, extract this to a folder of your choice, and run love path/to/oxomoco. You might need an older version to run without bugs, sorry.

In addition to the tools available on 1, 2, 3 and 6, the following controls exist:

  • Space: pause and play simulation
  • Scrollwheel: zoom in and out
  • Shift-scrollwheel: Make time run faster or slower
  • F5: Restart
  • F11: Fullscreen
  • 9: Go into grid move
  • 8: Show gravitational field strength (press F2 to render - it's slow!)
  • D: Toggle debug display
  • T: Toggle body titles
  • P: Toggle paths
  • C: Toggle connections between bodies
  • V: Toggle velocity vector
  • B: Toggle body

License

CC0 2017 – 2019. To the extent possible under law, Mia yun Ruse has waived all copyright and related or neighboring rights to Oxomoco. .

About

An amateur gravity simulation


Languages

Language:Lua 99.6%Language:Batchfile 0.4%