コード例 #1
0
ファイル: Universe.py プロジェクト: gpjt/explorer
    def __init__(self):
        self.sky = SurroundingSky()

        sun = Sun((0, 0, 0), (0, 0, 0))

        earth = Earth(sun.offset(79262956, -128906582, -13927363), (24.85, 15.34, 2.499))

        # Some interesting values:
        #  Distant orbit
        #self.userSpaceship = UserSpaceship(earth.offset(0, 0, 19999), earth.relativeVelocity(-4.4667, 0, 0))
        #  Roughly as high as the ISS
        self.userSpaceship = UserSpaceship(earth.offset(0, 0, earth.radius + 340), earth.relativeVelocity(-7.73, 0, 0))
        #  GEO
        # self.userSpaceship = UserSpaceship(earth.offset(0, 0, 42164), earth.relativeVelocity(-3.07, 0, 0))
        #  Here's a good resource for finding velocity for a circular orbit at a given altitude,
        #  though you need to remember that it's altitude and not distance from the centre of the
        #  Earth: <http://home.att.net/~ntdoug/UCM2.html>

        spaceStation = SpaceStation(earth.offset(1, 1, earth.radius + 335), earth.relativeVelocity(-7.73, 0, 0))

        self.objects = []
        self.objects.append(sun)
        self.objects.append(earth)
        self.objects.append(self.userSpaceship)
        self.objects.append(spaceStation)

        self.initialDashboardRelativeTo = earth