From f92fe5544b64d27412b16ba63055046532adbb32 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Fri, 5 Jul 2024 11:39:47 +0200 Subject: [PATCH] Document Vec2 constants --- crates/emath/src/vec2.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/emath/src/vec2.rs b/crates/emath/src/vec2.rs index 483de197..03e0715c 100644 --- a/crates/emath/src/vec2.rs +++ b/crates/emath/src/vec2.rs @@ -121,12 +121,22 @@ impl From for mint::Vector2 { // ---------------------------------------------------------------------------- impl Vec2 { + /// Right pub const X: Self = Self { x: 1.0, y: 0.0 }; + + /// Down pub const Y: Self = Self { x: 0.0, y: 1.0 }; + /// +X pub const RIGHT: Self = Self { x: 1.0, y: 0.0 }; + + /// -X pub const LEFT: Self = Self { x: -1.0, y: 0.0 }; + + /// -Y pub const UP: Self = Self { x: 0.0, y: -1.0 }; + + /// +Y pub const DOWN: Self = Self { x: 0.0, y: 1.0 }; pub const ZERO: Self = Self { x: 0.0, y: 0.0 };