Type Alias Vector2D

Source
pub type Vector2D = Vec2;
Expand description

2D Vector for UI coordinates, texture coordinates, etc.

Aliased Type§

#[repr(C)]
pub struct Vector2D { pub x: f32, pub y: f32, }

Fields§

§x: f32§y: f32

Trait Implementations§

Source§

impl BinarySerializable for Vector2D

Source§

fn to_binary(&self) -> Result<Vec<u8>, Error>
where Self: Serialize,

Serialize to binary format
Source§

fn from_binary(data: &[u8]) -> Result<Self, Error>
where Self: DeserializeOwned,

Deserialize from binary format
Source§

impl Vector2DExt for Vector2D

Source§

fn size(self) -> f32

Get the size (magnitude) of the 2D vector
Source§

fn size_squared(self) -> f32

Get the squared size (magnitude squared)
Source§

fn is_nearly_zero(self, tolerance: f32) -> bool

Check if the vector is nearly zero