#[repr(C)]pub struct Vector4<T> {
pub x: T,
pub y: T,
pub z: T,
pub w: T,
}Fields§
§x: T§y: T§z: T§w: TImplementations§
source§impl Vector4<f32>
impl Vector4<f32>
pub fn zero() -> Vector4<f32>
pub fn from_array(data: [f32; 4]) -> Vector4<f32>
pub fn dot(&self, rhs: &Vector4<f32>) -> f32
pub fn len(&self) -> f32
pub fn cross(&self, other: &Vector4<f32>) -> Vector4<f32>
pub fn normalize(&self) -> Vector4<f32>
pub fn apply_matrix(&mut self, matrix: Mat4)
Trait Implementations§
source§impl<T> AddAssign<Vector4<T>> for Vector4<T>where
T: AddAssign<T>,
impl<T> AddAssign<Vector4<T>> for Vector4<T>where T: AddAssign<T>,
source§fn add_assign(&mut self, rhs: Vector4<T>)
fn add_assign(&mut self, rhs: Vector4<T>)
Performs the
+= operation. Read moresource§impl<T> PartialEq<Vector4<T>> for Vector4<T>where
T: PartialEq<T>,
impl<T> PartialEq<Vector4<T>> for Vector4<T>where T: PartialEq<T>,
source§impl<T> SubAssign<Vector4<T>> for Vector4<T>where
T: SubAssign<T>,
impl<T> SubAssign<Vector4<T>> for Vector4<T>where T: SubAssign<T>,
source§fn sub_assign(&mut self, rhs: Vector4<T>)
fn sub_assign(&mut self, rhs: Vector4<T>)
Performs the
-= operation. Read moreimpl<T> Copy for Vector4<T>where T: Copy,
impl<T> StructuralPartialEq for Vector4<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Vector4<T>where T: RefUnwindSafe,
impl<T> Send for Vector4<T>where T: Send,
impl<T> Sync for Vector4<T>where T: Sync,
impl<T> Unpin for Vector4<T>where T: Unpin,
impl<T> UnwindSafe for Vector4<T>where T: UnwindSafe,
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