From 7c92bc1315b65980a68d4bc5230b8340f96ca8a7 Mon Sep 17 00:00:00 2001
From: Quantum <quantum2048@gmail.com>
Date: Sun, 27 Oct 2013 16:59:23 -0400
Subject: [PATCH] Now uses km as radius.

---
 punyverse/entity.py  |  1 -
 punyverse/world.json | 33 +++++++++++++++++++++++----------
 punyverse/world.py   |  2 +-
 3 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/punyverse/entity.py b/punyverse/entity.py
index 5854311..e40f64b 100644
--- a/punyverse/entity.py
+++ b/punyverse/entity.py
@@ -77,7 +77,6 @@ class Satellite(Planet):
         if self.orbit_cache == cache:
             return self.orbit_id
 
-        print 'Orbit cache miss'
         if self.orbit_id is not None:
             glDeleteLists(self.orbit_id, 1)
 
diff --git a/punyverse/world.json b/punyverse/world.json
index 0aed6ae..db036f8 100644
--- a/punyverse/world.json
+++ b/punyverse/world.json
@@ -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,
-  "tick": 4320,
-  "length": "kilometre per world units for satellite distance",
+  "tick": 432,
   "length": 63.7,
   "planets": {
     "earth": {
       "texture": ["earth.jpg", "earth_medium.jpg", "earth_small.jpg", [0, 0.28, 1, 1]],
-      "radius": 100,
+      "radius": 6378.1,
       "z": "AU",
       "pitch": -90,
       "yaw": 23.4,
@@ -21,7 +30,7 @@
       "satellites": {
         "moon": {
           "texture": ["moon.jpg", "moon_medium.jpg", "moon_small.jpg", [0.53, 0.53, 0.53, 1]],
-          "radius": 27.25,
+          "radius": 1738.14,
           "distance": 38439,
           "sma": 384399,
           "eccentricity": 0.0549,
@@ -39,7 +48,7 @@
     },
     "mars": {
       "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",
       "pitch": -90,
       "yaw": 25.19,
@@ -55,14 +64,16 @@
     },
     "jupiter": {
       "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",
       "pitch": -90,
       "yaw": 3.13
     },
     "saturn": {
       "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",
       "pitch": -90,
       "yaw": 26.73,
@@ -74,7 +85,8 @@
     },
     "uranus": {
       "texture": ["uranus.jpg", [0, 0.53, 0.84, 1]],
-      "radius": 400,
+      "radius": 25559,
+      "mass": 8.6810e+25,
       "z": "19.23 * AU",
       "pitch": -90,
       "yaw": 97.77,
@@ -89,7 +101,8 @@
     },
     "neptune": {
       "texture": ["neptune.jpg", [0.31, 0.49, 0.59, 1]],
-      "radius": 388,
+      "radius": 24764,
+      "mass": 1.0243e+26,
       "z": "30.5 * AU",
       "pitch": -90,
       "yaw": 28.32
diff --git a/punyverse/world.py b/punyverse/world.py
index a896d6e..dcca6cf 100644
--- a/punyverse/world.py
+++ b/punyverse/world.py
@@ -83,7 +83,7 @@ def load_world(file):
             yaw = e(info.get('yaw', 0))
             roll = e(info.get('roll', 0))
             delta = e(info.get('delta', 5))
-            radius = e(info.get('radius', None))
+            radius = e(info.get('radius', length)) / length
             background = info.get('background', False)
 
             if 'texture' in info: