Now uses km as radius.

This commit is contained in:
Quantum 2013-10-27 16:59:23 -04:00
parent 45d7142feb
commit 1bb8893635
3 changed files with 24 additions and 12 deletions

View file

@ -77,7 +77,6 @@ class Satellite(Planet):
if self.orbit_cache == cache: if self.orbit_cache == cache:
return self.orbit_id return self.orbit_id
print 'Orbit cache miss'
if self.orbit_id is not None: if self.orbit_id is not None:
glDeleteLists(self.orbit_id, 1) glDeleteLists(self.orbit_id, 1)

View file

@ -1,13 +1,22 @@
{ {
"au": "greatly shrunk so planets can actually be seen", "comments": {
"au": "greatly shrunk so planets can actually be seen",
"tick": "real world second per game tick",
"length": "kilometre per world units for satellite distance and planetary radius",
"radius": "note that radius is equatorial, flattening will be implemented later",
"distance": "virtual distance to look better, in km",
"sma": "semi-major axis used with mass of parent to calculate orbit, in km",
"mass": "mass in kg",
"texture": "a group of texture to use, tried in that order. a list means a colour",
"model": "used to load a wavefront object instead of a textured sphere"
},
"au": 10000, "au": 10000,
"tick": 4320, "tick": 432,
"length": "kilometre per world units for satellite distance",
"length": 63.7, "length": 63.7,
"planets": { "planets": {
"earth": { "earth": {
"texture": ["earth.jpg", "earth_medium.jpg", "earth_small.jpg", [0, 0.28, 1, 1]], "texture": ["earth.jpg", "earth_medium.jpg", "earth_small.jpg", [0, 0.28, 1, 1]],
"radius": 100, "radius": 6378.1,
"z": "AU", "z": "AU",
"pitch": -90, "pitch": -90,
"yaw": 23.4, "yaw": 23.4,
@ -21,7 +30,7 @@
"satellites": { "satellites": {
"moon": { "moon": {
"texture": ["moon.jpg", "moon_medium.jpg", "moon_small.jpg", [0.53, 0.53, 0.53, 1]], "texture": ["moon.jpg", "moon_medium.jpg", "moon_small.jpg", [0.53, 0.53, 0.53, 1]],
"radius": 27.25, "radius": 1738.14,
"distance": 38439, "distance": 38439,
"sma": 384399, "sma": 384399,
"eccentricity": 0.0549, "eccentricity": 0.0549,
@ -39,7 +48,7 @@
}, },
"mars": { "mars": {
"texture": ["mars.jpg", "mars_small.jpg", "mars_medium.jpg", [0.85, 0.47, 0.2, 1]], "texture": ["mars.jpg", "mars_small.jpg", "mars_medium.jpg", [0.85, 0.47, 0.2, 1]],
"radius": 53.3, "radius": 3396.2,
"z": "1.524 * AU", "z": "1.524 * AU",
"pitch": -90, "pitch": -90,
"yaw": 25.19, "yaw": 25.19,
@ -55,14 +64,16 @@
}, },
"jupiter": { "jupiter": {
"texture": ["jupiter.jpg", "jupiter_medium.jpg", "jupiter_small.jpg", [0.65, 0.36, 0.19, 1]], "texture": ["jupiter.jpg", "jupiter_medium.jpg", "jupiter_small.jpg", [0.65, 0.36, 0.19, 1]],
"radius": 1120, "radius": 71492,
"mass": 1.8986e+27,
"z": "5.2 * AU", "z": "5.2 * AU",
"pitch": -90, "pitch": -90,
"yaw": 3.13 "yaw": 3.13
}, },
"saturn": { "saturn": {
"texture": ["saturn.jpg", "saturn_medium.jpg", "saturn_small.jpg", [0.9, 0.8, 0.64, 1]], "texture": ["saturn.jpg", "saturn_medium.jpg", "saturn_small.jpg", [0.9, 0.8, 0.64, 1]],
"radius": 945, "radius": 60268,
"mass": 5.6846e+26,
"z": "9.58 * AU", "z": "9.58 * AU",
"pitch": -90, "pitch": -90,
"yaw": 26.73, "yaw": 26.73,
@ -74,7 +85,8 @@
}, },
"uranus": { "uranus": {
"texture": ["uranus.jpg", [0, 0.53, 0.84, 1]], "texture": ["uranus.jpg", [0, 0.53, 0.84, 1]],
"radius": 400, "radius": 25559,
"mass": 8.6810e+25,
"z": "19.23 * AU", "z": "19.23 * AU",
"pitch": -90, "pitch": -90,
"yaw": 97.77, "yaw": 97.77,
@ -89,7 +101,8 @@
}, },
"neptune": { "neptune": {
"texture": ["neptune.jpg", [0.31, 0.49, 0.59, 1]], "texture": ["neptune.jpg", [0.31, 0.49, 0.59, 1]],
"radius": 388, "radius": 24764,
"mass": 1.0243e+26,
"z": "30.5 * AU", "z": "30.5 * AU",
"pitch": -90, "pitch": -90,
"yaw": 28.32 "yaw": 28.32

View file

@ -83,7 +83,7 @@ def load_world(file):
yaw = e(info.get('yaw', 0)) yaw = e(info.get('yaw', 0))
roll = e(info.get('roll', 0)) roll = e(info.get('roll', 0))
delta = e(info.get('delta', 5)) delta = e(info.get('delta', 5))
radius = e(info.get('radius', None)) radius = e(info.get('radius', length)) / length
background = info.get('background', False) background = info.get('background', False)
if 'texture' in info: if 'texture' in info: