1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//! Utility types and conversion traits.

use bevy::math::Vec2;
use lyon_tessellation::math::{Point, Vector};

pub trait ToPoint {
    fn to_point(self) -> Point;
}

pub trait ToVector {
    fn to_vector(self) -> Vector;
}

impl ToPoint for Vec2 {
    fn to_point(self) -> Point {
        Point::new(self.x, self.y)
    }
}

impl ToVector for Vec2 {
    fn to_vector(self) -> Vector {
        Vector::new(self.x, self.y)
    }
}