Struct Vector2
#[repr(C)]pub struct Vector2 {
pub data: [f32; 2],
}Expand description
Vector with 2 floating point components: (x, y).
Fields§
§data: [f32; 2]Vector elements.
Implementations§
§impl Vector2
impl Vector2
pub const ZERO: Vector2
pub const ONE: Vector2
pub const POSITIVE_X: Vector2
pub const POSITIVE_Y: Vector2
pub const NEGATIVE_X: Vector2
pub const NEGATIVE_Y: Vector2
pub const MAX: Vector2
pub const MIN: Vector2
pub const NAN: Vector2
pub const INFINITY: Vector2
pub const NEG_INFINITY: Vector2
pub const fn new(x: f32, y: f32) -> Vector2
pub const fn new_single(v: f32) -> Vector2
pub const fn x(&self) -> f32
pub const fn y(&self) -> f32
Trait Implementations§
§impl AddAssign for Vector2
impl AddAssign for Vector2
§fn add_assign(&mut self, rhs: Vector2)
fn add_assign(&mut self, rhs: Vector2)
Performs the
+= operation. Read more§impl MulAssign for Vector2
impl MulAssign for Vector2
§fn mul_assign(&mut self, rhs: Vector2)
fn mul_assign(&mut self, rhs: Vector2)
Performs the
*= operation. Read more§impl SubAssign for Vector2
impl SubAssign for Vector2
§fn sub_assign(&mut self, rhs: Vector2)
fn sub_assign(&mut self, rhs: Vector2)
Performs the
-= operation. Read more§impl VariantConstraint for Vector2
impl VariantConstraint for Vector2
impl Copy for Vector2
impl PropertyTypeConstraint for Vector2
impl StructuralPartialEq for Vector2
Auto Trait Implementations§
impl Freeze for Vector2
impl RefUnwindSafe for Vector2
impl Send for Vector2
impl Sync for Vector2
impl Unpin for Vector2
impl UnwindSafe for Vector2
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more