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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)