phs-galaxy/Planets.gd

8 lines
218 B
GDScript

extends Spatial
class_name SolarSystem
func get_gravitation_acceleration(position: Vector3) -> Vector3:
# TODO: Take all planets and their mass into account
return ($Earth.transform.origin - position).normalized()