Hello, Space


Today I focused on getting any kind of space physics written. I wanted to add some objects that had mass and would attract each other. I also wanted to learn the math associated with getting an object into stable orbit around another object. 

## Objects in Space: remove gravity and dampening

To get the basic setup started, I followed this tutorial. https://www.youtube.com/watch?v=J2MItemlTcE&feature=youtu.be It helped me to get a ship moving in space. A very important learning is that I first had to disable all the default gravity, as well as linear/angular dampening, at the project level. When creating new `RigidBody2D`, I also had to set  Linear and Angular `Damp = 0`. 

## Physics of Satellites: figure out a velocity where things stay in orbit

Mostly this just involved reviewing things like

https://www.khanacademy.org/science/ap-physics-1/ap-centripetal-force-and-gravitation/newtons-law-of-gravitation-ap/v/acceleration-due-to-gravity-at-the-space-station

- https://www.physicsclassroom.com/class/circles/Lesson-4/Mathematics-of-Satellite-Motion

I haven't yet tuned objects carefully for circular (or elliptical) orbits. My key learning was that the mass of the object in orbit doesn't matter, just the velocity. 

## Viewing Orbits: add trails behind objects

Tried to get particles trails working first (https://www.gamefromscratch.com/post/2015/07/09/Godot-Engine-Tutorial-Part-12-Particles.aspx) but had issues changing the direction that particles were being emitted at runtime (https://github.com/godotengine/godot/issues/13492#issuecomment-360334416). Ultimately ended up following this guide, which just creates a trail of points and then cleans them up: https://www.youtube.com/watch?v=s5DwZZ0fZDg

---

https://github.com/nathanleiby/godot-wild-jam-22/commit/ff0f00fad738a75378a3a680095eaccd50637cd8

Get Orbit

Leave a comment

Log in with itch.io to leave a comment.