#[repr(C)]pub struct Vector4 {
pub x: f32,
pub y: f32,
pub z: f32,
pub w: f32,
}Fields§
§x: f32§y: f32§z: f32§w: f32Implementations§
Source§impl Vector4
impl Vector4
Sourcepub fn new(x: f32, y: f32, z: f32, w: f32) -> Self
pub fn new(x: f32, y: f32, z: f32, w: f32) -> Self
Creates a vector from its x, y, z, and w components.
Sourcepub fn length_squared(&self) -> f32
pub fn length_squared(&self) -> f32
Returns the squared length of the vector, avoiding the square root
computed by length.
Sourcepub fn distance(&self, value: &Self) -> f32
pub fn distance(&self, value: &Self) -> f32
Returns the distance between the points self and value.
Sourcepub fn distance_squared(&self, value: &Self) -> f32
pub fn distance_squared(&self, value: &Self) -> f32
Returns the squared distance between the points self and value.
Trait Implementations§
impl Copy for Vector4
impl StructuralPartialEq for Vector4
Auto Trait Implementations§
impl Freeze for Vector4
impl RefUnwindSafe for Vector4
impl Send for Vector4
impl Sync for Vector4
impl Unpin for Vector4
impl UnsafeUnpin for Vector4
impl UnwindSafe for Vector4
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