ATTENTION: this project is totally WORK IN PROGRESS
Planetry is a simple app for gravitational simulations of objects in space. You can specify the objects or bodys by your own. A scripting system allows you to check for specific events.
For example: you simulate the solar system with the sun and all its planets and add a second star that passes through the solar system. A simple script, written in Lua, can check on each simulation step, when or if Earth moves outside of the habitable zone. If the event occurs it can pause the simulation and display additional information.
This project needs SDL2 and Lua 5.1 as requirements which have to be installed first.
First install the requirements via homebrew: brew install dep sdl2 [email protected]
Just type: ./install-dependencies-linux.sh
. This may take some time as SDL gets build from source within the script.
Todo ... I would be more than happy to get help here :D
The golang dependencies are managed via dep. To get the dependencies type: dep ensure
To build the executable type: go build
After the executable was build, you can start the simulation by typing:
./planetry
NOTE: Planetry loads all the files in
testdata/
. Later you can create projects and load these, but currently if you want to change something in the simulation, just alter the files intestdata/
.
Feel free to add more Lua scripts or edit testdata/system.json
.
On runtime, you can use:
y
to zoom out,x
to zoom in,s
to speed up,a
to slow down,SPACE
to pause/unpause
See docs/SCENE.md.
See docs/SCRIPTING.md.
As you may noticed: this project is in a really early stage of development. Here's the stuff that has to be done next:
- Attach camera to object (v1)
- Draw bodies in their real size; not just pixels (v1)
- Scripts per scene description (v2)
- Draw grid (v2)
- Alter speed (v2)
- Create project by command (v2)
- Live time / event script support like on pause, on start up, ...
- Collision
- Runtime memory functions for scripting
- 3D rendering
- Window appears but no objects were drawn. After switching to MacOS Mojave I had to update the go dependencies as well as SDL on the system.