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,
|
||||
"mass": 5.97219e+24,
|
||||
"rotation": 86400,
|
||||
"division": 70,
|
||||
"atmosphere": {
|
||||
"cloud_texture": "cloudmap.png",
|
||||
"diffuse_texture": "atmosphere_earth.png",
|
||||
|
@ -35,6 +36,7 @@
|
|||
"radius": 1738.14,
|
||||
"distance": 38439,
|
||||
"sma": 384399,
|
||||
"division": 30,
|
||||
"eccentricity": 0.0549,
|
||||
"inclination": 5.145,
|
||||
"rotation": 0,
|
||||
|
@ -59,6 +61,7 @@
|
|||
"mass": 6.4185e+23,
|
||||
"rotation": 88643,
|
||||
"orbit_distance": "AU",
|
||||
"division": 30,
|
||||
"satellites": {
|
||||
"phobos": {
|
||||
"distance": 9377,
|
||||
|
@ -240,7 +243,8 @@
|
|||
"texture": "sky.jpg",
|
||||
"optional": true,
|
||||
"lighting": false,
|
||||
"radius": 190000,
|
||||
"radius": 305000000,
|
||||
"division": 30,
|
||||
"pitch": 90,
|
||||
"yaw": 30,
|
||||
"roll": 180,
|
||||
|
|
|
@ -87,12 +87,12 @@ def load_world(file):
|
|||
radius = e(info.get('radius', length)) / length
|
||||
background = info.get('background', False)
|
||||
orbit_distance = e(info.get('orbit_distance', au))
|
||||
division = info.get('division', max(min(int(radius / 8), 60), 10))
|
||||
|
||||
if 'texture' in info:
|
||||
cheap, skip, texture = get_best_texture(info['texture'], optional=info.get('optional', False))
|
||||
if skip:
|
||||
return
|
||||
division = min(int(radius / 2), 100)
|
||||
if cheap:
|
||||
object_id = compile(colourball, radius, division, division, texture)
|
||||
else:
|
||||
|
@ -137,7 +137,6 @@ def load_world(file):
|
|||
cloud_texture = atmosphere_data.get('cloud_texture', None)
|
||||
cheap, _, cloud_texture = get_best_texture(cloud_texture)
|
||||
if not cheap:
|
||||
division = min(int(radius / 2), 100)
|
||||
cloudmap_id = compile(sphere, radius + 2, division, division, cloud_texture,
|
||||
lighting=False)
|
||||
cheap, _, atm_texture = get_best_texture(atm_texture)
|
||||
|
|
Loading…
Reference in a new issue