Trait sark_grids::point::Point2d

source ·
pub trait Point2d {
    // Required methods
    fn x(&self) -> f32;
    fn y(&self) -> f32;

    // Provided methods
    fn as_ivec2(&self) -> IVec2 { ... }
    fn as_uvec2(&self) -> UVec2 { ... }
    fn as_vec2(&self) -> Vec2 { ... }
    fn as_array(&self) -> [f32; 2] { ... }
    fn as_usize_array(&self) -> [usize; 2] { ... }
}
Expand description

A trait for types representing an arbitrary 2d point.

Required Methods§

source

fn x(&self) -> f32

source

fn y(&self) -> f32

Provided Methods§

source

fn as_ivec2(&self) -> IVec2

source

fn as_uvec2(&self) -> UVec2

source

fn as_vec2(&self) -> Vec2

source

fn as_array(&self) -> [f32; 2]

source

fn as_usize_array(&self) -> [usize; 2]

Implementations on Foreign Types§

source§

impl Point2d for Vec2

source§

fn x(&self) -> f32

source§

fn y(&self) -> f32

source§

impl Point2d for IVec2

source§

fn x(&self) -> f32

source§

fn y(&self) -> f32

source§

impl Point2d for UVec2

source§

fn x(&self) -> f32

source§

fn y(&self) -> f32

source§

impl Point2d for [f32; 2]

source§

fn x(&self) -> f32

source§

fn y(&self) -> f32

source§

impl Point2d for [i32; 2]

source§

fn x(&self) -> f32

source§

fn y(&self) -> f32

source§

impl Point2d for [u32; 2]

source§

fn x(&self) -> f32

source§

fn y(&self) -> f32

source§

impl Point2d for [usize; 2]

source§

fn x(&self) -> f32

source§

fn y(&self) -> f32

Implementors§