re_types/components/
vector2d_ext.rs1use super::Vector2D;
2
3impl Vector2D {
4 pub const ZERO: Self = Self(crate::datatypes::Vec2D::ZERO);
6
7 pub const ONE: Self = Self(crate::datatypes::Vec2D::ONE);
9}
10
11#[cfg(feature = "glam")]
12impl From<Vector2D> for glam::Vec2 {
13 #[inline]
14 fn from(v: Vector2D) -> Self {
15 Self::new(v.x(), v.y())
16 }
17}
18
19#[cfg(feature = "mint")]
20impl From<Vector2D> for mint::Vector2<f32> {
21 #[inline]
22 fn from(v: Vector2D) -> Self {
23 Self { x: v.x(), y: v.y() }
24 }
25}