This commit is contained in:
Maximilian Ammann 2022-01-21 13:07:52 +01:00
parent f86eac84e0
commit 50c2f0fe97
8 changed files with 9 additions and 14 deletions

View File

@ -5,7 +5,7 @@ use mapr::io::{HttpFetcherConfig, TileFetcher};
use mapr::tesselation::Tesselated;
use std::io::Cursor;
use vector_tile::parse_tile_reader;
use vector_tile::tile::{Layer};
use vector_tile::tile::Layer;
fn tessselate(layer: &Layer) {
let _: (VertexBuffers<_, u32>, _) = layer.tesselate().unwrap();

View File

@ -2,7 +2,7 @@
use std::time::Duration;
use cgmath::{Vector2};
use cgmath::Vector2;
use winit::event::{DeviceEvent, KeyboardInput, TouchPhase, WindowEvent};
use crate::input::pan_handler::PanHandler;
@ -66,7 +66,7 @@ impl InputController {
self.shift_handler.process_key_press(*key, *state);
self.tilt_handler.process_key_press(*key, *state);
true
},
}
WindowEvent::Touch(touch) => match touch.phase {
TouchPhase::Started => self.pan_handler.process_touch_start(),
TouchPhase::Ended => self.pan_handler.process_touch_end(),

View File

@ -1,5 +1,5 @@
use super::UpdateState;
use crate::render::camera::{Camera};
use crate::render::camera::Camera;
use crate::render::render_state::RenderState;
use cgmath::{EuclideanSpace, Point3, Vector2, Vector3};
use std::time::Duration;

View File

@ -6,7 +6,7 @@ use log::{error, info};
use crate::coords::TileCoords;
use vector_tile::parse_tile_bytes;
use vector_tile::tile::{Layer};
use vector_tile::tile::Layer;
use crate::io::web_tile_fetcher::WebTileFetcher;
use crate::io::{HttpFetcherConfig, TileFetcher};

View File

@ -134,7 +134,6 @@ impl Camera {
clip.w / clip.w
);
Self::clip_to_window_transform(self.width, self.height) * ndc
}
@ -156,7 +155,7 @@ impl Camera {
.unwrap()
* fixed_window;
let unprojected = view_proj.invert().unwrap() * ndc;
Vector3::new(
unprojected.x / unprojected.w,
unprojected.y / unprojected.w,
@ -180,7 +179,7 @@ impl Camera {
1.0,
);
let unprojected_nalgebra = view_proj.invert().unwrap() * pt;
Vector3::new(
unprojected_nalgebra.x / unprojected_nalgebra.w,
unprojected_nalgebra.y / unprojected_nalgebra.w,
@ -328,7 +327,7 @@ impl Perspective {
#[cfg(test)]
mod tests {
use cgmath::{AbsDiffEq, Matrix4, SquareMatrix, Vector2, Vector3, Vector4};
use super::{Camera, Perspective};

View File

@ -1,8 +1,6 @@
use std::default::Default;
use std::{cmp, iter};
use wgpu::{Buffer, Limits, Queue};
use winit::dpi::PhysicalSize;
use winit::window::Window;

View File

@ -81,7 +81,6 @@ impl VertexShaderState {
pub mod tile {
use super::{ShaderTileMetadata, ShaderVertex};
use crate::platform::COLOR_TEXTURE_FORMAT;
use super::{FragmentShaderState, VertexShaderState};

View File

@ -1,4 +1,3 @@
use std::ops::Add;
use bytemuck::Pod;
@ -12,7 +11,7 @@ use lyon_path::traits::SvgPathBuilder;
use lyon_path::Path;
use vector_tile::geometry::{Command, Geometry};
use vector_tile::tile::{Layer};
use vector_tile::tile::Layer;
use crate::render::ShaderVertex;
use crate::tesselation::{Tesselated, VertexConstructor, DEFAULT_TOLERANCE};