X-Git-Url: http://www.dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Fcore%2Fcontroller.rs;h=030d962108caaa5ef46f701c9456d37cfa5c22b9;hb=e570927ad1703298a2c85599c7e25475c60b33d4;hp=1eeb13c9ff1e837d24e8db1101419f1ac89a0ba0;hpb=f3fe1a328df7ca0db89ddb14b7d45c3f16cea7fa;p=kaka%2Frust-sdl-test.git diff --git a/src/core/controller.rs b/src/core/controller.rs index 1eeb13c..030d962 100644 --- a/src/core/controller.rs +++ b/src/core/controller.rs @@ -1,4 +1,4 @@ -use common::Point2D; +use common::Point; use {hashmap, point}; use common::Radians; use sdl2::HapticSubsystem; @@ -88,11 +88,11 @@ impl Stick { #[inline(always)] #[allow(dead_code)] pub fn left(&self) -> bool { self.x < -0.99 } #[inline(always)] #[allow(dead_code)] pub fn right(&self) -> bool { self.x > 0.99 } - pub fn to_axis_point(&self) -> Point2D { + pub fn to_axis_point(&self) -> Point { point!(self.x as f64, self.y as f64) } - pub fn to_point(&self) -> Point2D { + pub fn to_point(&self) -> Point { let p = point!(self.x as f64, self.y as f64); if p.length() > 1.0 { p.normalized() @@ -102,7 +102,7 @@ impl Stick { } } -impl From<&Stick> for Point2D { +impl From<&Stick> for Point { fn from(item: &Stick) -> Self { Self { x: item.x as f64,