Skip to content

Commit

Permalink
Document Vec2 constants
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Jul 5, 2024
1 parent 0a9e0c8 commit f92fe55
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/emath/src/vec2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,22 @@ impl From<Vec2> for mint::Vector2<f32> {
// ----------------------------------------------------------------------------

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 };
Expand Down

0 comments on commit f92fe55

Please sign in to comment.