Explorar el Código

OrthograficView::radius_physical_pixels -> diameter_*

Johannes Hofmann hace 7 años
padre
commit
87739486fd
Se han modificado 2 ficheros con 6 adiciones y 6 borrados
  1. 2
    2
      src/atmos_layer.rs
  2. 4
    4
      src/orthografic_view.rs

+ 2
- 2
src/atmos_layer.rs Ver fichero

@@ -72,8 +72,8 @@ impl AtmosLayer {
72 72
         map_view: &MapView,
73 73
     ) {
74 74
         let (scale_x, scale_y) = {
75
-            let radius = OrthograficView::radius_physical_pixels(map_view);
76
-            ((radius / map_view.width) as f32, (radius / map_view.height) as f32)
75
+            let diam = OrthograficView::diameter_physical_pixels(map_view);
76
+            ((diam / map_view.width) as f32, (diam / map_view.height) as f32)
77 77
         };
78 78
 
79 79
         self.program.set_uniform_2f(cx, self.scale_uniform, scale_x, scale_y);

+ 4
- 4
src/orthografic_view.rs Ver fichero

@@ -211,14 +211,14 @@ impl OrthograficView {
211 211
         tiles
212 212
     }
213 213
 
214
-    pub fn radius_physical_pixels(map_view: &MapView) -> f64 {
214
+    pub fn diameter_physical_pixels(map_view: &MapView) -> f64 {
215 215
         2.0f64.powf(map_view.zoom) * (FRAC_1_PI * f64::from(map_view.tile_size))
216 216
     }
217 217
 
218 218
     pub fn transformation_matrix(map_view: &MapView) -> Matrix3<f64> {
219 219
         let (scale_x, scale_y) = {
220
-            let radius = Self::radius_physical_pixels(map_view);
221
-            (radius / map_view.width, radius / map_view.height)
220
+            let diam = Self::diameter_physical_pixels(map_view);
221
+            (diam / map_view.width, diam / map_view.height)
222 222
         };
223 223
 
224 224
         let scale_mat: Matrix3<f64> = Matrix3::from_cols(
@@ -290,7 +290,7 @@ impl OrthograficView {
290 290
     pub fn screen_coord_to_latlonrad(map_view: &MapView, screen_coord: ScreenCoord) -> LatLonRad {
291 291
         // Point on unit sphere
292 292
         let sphere_point = {
293
-            let recip_radius = 2.0 * Self::radius_physical_pixels(map_view).recip();
293
+            let recip_radius = 2.0 * Self::diameter_physical_pixels(map_view).recip();
294 294
             let sx = (screen_coord.x - map_view.width * 0.5) * recip_radius;
295 295
             let sy = (screen_coord.y - map_view.height * 0.5) * -recip_radius;
296 296
             let t = 1.0 - sx * sx - sy * sy;