mirror of
https://github.com/quantum5/punyverse.git
synced 2025-04-24 13:11:57 -04:00
Optimized surface division for speed.
This commit is contained in:
parent
5d5f7cceb4
commit
c043a6fe88
|
@ -23,6 +23,7 @@
|
||||||
"roll": -90,
|
"roll": -90,
|
||||||
"mass": 5.97219e+24,
|
"mass": 5.97219e+24,
|
||||||
"rotation": 86400,
|
"rotation": 86400,
|
||||||
|
"division": 70,
|
||||||
"atmosphere": {
|
"atmosphere": {
|
||||||
"cloud_texture": "cloudmap.png",
|
"cloud_texture": "cloudmap.png",
|
||||||
"diffuse_texture": "atmosphere_earth.png",
|
"diffuse_texture": "atmosphere_earth.png",
|
||||||
|
@ -35,6 +36,7 @@
|
||||||
"radius": 1738.14,
|
"radius": 1738.14,
|
||||||
"distance": 38439,
|
"distance": 38439,
|
||||||
"sma": 384399,
|
"sma": 384399,
|
||||||
|
"division": 30,
|
||||||
"eccentricity": 0.0549,
|
"eccentricity": 0.0549,
|
||||||
"inclination": 5.145,
|
"inclination": 5.145,
|
||||||
"rotation": 0,
|
"rotation": 0,
|
||||||
|
@ -59,6 +61,7 @@
|
||||||
"mass": 6.4185e+23,
|
"mass": 6.4185e+23,
|
||||||
"rotation": 88643,
|
"rotation": 88643,
|
||||||
"orbit_distance": "AU",
|
"orbit_distance": "AU",
|
||||||
|
"division": 30,
|
||||||
"satellites": {
|
"satellites": {
|
||||||
"phobos": {
|
"phobos": {
|
||||||
"distance": 9377,
|
"distance": 9377,
|
||||||
|
@ -240,7 +243,8 @@
|
||||||
"texture": "sky.jpg",
|
"texture": "sky.jpg",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"lighting": false,
|
"lighting": false,
|
||||||
"radius": 190000,
|
"radius": 305000000,
|
||||||
|
"division": 30,
|
||||||
"pitch": 90,
|
"pitch": 90,
|
||||||
"yaw": 30,
|
"yaw": 30,
|
||||||
"roll": 180,
|
"roll": 180,
|
||||||
|
|
|
@ -87,12 +87,12 @@ def load_world(file):
|
||||||
radius = e(info.get('radius', length)) / length
|
radius = e(info.get('radius', length)) / length
|
||||||
background = info.get('background', False)
|
background = info.get('background', False)
|
||||||
orbit_distance = e(info.get('orbit_distance', au))
|
orbit_distance = e(info.get('orbit_distance', au))
|
||||||
|
division = info.get('division', max(min(int(radius / 8), 60), 10))
|
||||||
|
|
||||||
if 'texture' in info:
|
if 'texture' in info:
|
||||||
cheap, skip, texture = get_best_texture(info['texture'], optional=info.get('optional', False))
|
cheap, skip, texture = get_best_texture(info['texture'], optional=info.get('optional', False))
|
||||||
if skip:
|
if skip:
|
||||||
return
|
return
|
||||||
division = min(int(radius / 2), 100)
|
|
||||||
if cheap:
|
if cheap:
|
||||||
object_id = compile(colourball, radius, division, division, texture)
|
object_id = compile(colourball, radius, division, division, texture)
|
||||||
else:
|
else:
|
||||||
|
@ -137,7 +137,6 @@ def load_world(file):
|
||||||
cloud_texture = atmosphere_data.get('cloud_texture', None)
|
cloud_texture = atmosphere_data.get('cloud_texture', None)
|
||||||
cheap, _, cloud_texture = get_best_texture(cloud_texture)
|
cheap, _, cloud_texture = get_best_texture(cloud_texture)
|
||||||
if not cheap:
|
if not cheap:
|
||||||
division = min(int(radius / 2), 100)
|
|
||||||
cloudmap_id = compile(sphere, radius + 2, division, division, cloud_texture,
|
cloudmap_id = compile(sphere, radius + 2, division, division, cloud_texture,
|
||||||
lighting=False)
|
lighting=False)
|
||||||
cheap, _, atm_texture = get_best_texture(atm_texture)
|
cheap, _, atm_texture = get_best_texture(atm_texture)
|
||||||
|
|
Loading…
Reference in a new issue