pub struct Vector3<T> {
pub x: T,
pub y: T,
pub z: T,
}
Fields§
§x: T
§y: T
§z: T
Implementations§
Source§impl<T: Copy + PartialEq + FloatType + NumberType + Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Div<Output = T> + MulAssign<T>> Vector3<T>
impl<T: Copy + PartialEq + FloatType + NumberType + Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Div<Output = T> + MulAssign<T>> Vector3<T>
Source§impl<T: Copy + PartialEq + PartialOrd + FloatType + NumberType + Default + Neg<Output = T> + Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Div<Output = T> + MulAssign<T>> Vector3<T>
impl<T: Copy + PartialEq + PartialOrd + FloatType + NumberType + Default + Neg<Output = T> + Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Div<Output = T> + MulAssign<T>> Vector3<T>
pub fn coordinate_system(d1: &Self) -> (Self, Self, Self)
Source§impl<T: Copy + PartialEq + FloatType + Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Div<Output = T> + MulAssign<T>> Vector3<T>
impl<T: Copy + PartialEq + FloatType + Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Div<Output = T> + MulAssign<T>> Vector3<T>
pub fn dot(&self, rhs: &Self) -> T
pub fn length_squared(&self) -> T
pub fn length(&self) -> T
pub fn normalize(&self) -> Self
pub fn distance_squared(a: &Self, b: &Self) -> T
pub fn distance(a: &Self, b: &Self) -> T
pub fn cross(v1: &Self, v2: &Self) -> Self
pub fn mul_assign(&mut self, f: T)
Trait Implementations§
Source§impl<T: AddAssign<T>> AddAssign for Vector3<T>
impl<T: AddAssign<T>> AddAssign for Vector3<T>
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moreSource§impl<T: DivAssign<T> + Copy> DivAssign<T> for Vector3<T>
impl<T: DivAssign<T> + Copy> DivAssign<T> for Vector3<T>
Source§fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
Performs the
/=
operation. Read moreSource§impl<T: DivAssign<T>> DivAssign for Vector3<T>
impl<T: DivAssign<T>> DivAssign for Vector3<T>
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/=
operation. Read moreSource§impl<T: MulAssign<T> + Copy> MulAssign<T> for Vector3<T>
impl<T: MulAssign<T> + Copy> MulAssign<T> for Vector3<T>
Source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the
*=
operation. Read moreSource§impl<T: MulAssign<T>> MulAssign for Vector3<T>
impl<T: MulAssign<T>> MulAssign for Vector3<T>
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*=
operation. Read moreSource§impl<T: SubAssign<T>> SubAssign for Vector3<T>
impl<T: SubAssign<T>> SubAssign for Vector3<T>
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read moreimpl<T: Copy> Copy for Vector3<T>
impl<T> StructuralPartialEq for Vector3<T>
Auto Trait Implementations§
impl<T> Freeze for Vector3<T>where
T: Freeze,
impl<T> RefUnwindSafe for Vector3<T>where
T: RefUnwindSafe,
impl<T> Send for Vector3<T>where
T: Send,
impl<T> Sync for Vector3<T>where
T: Sync,
impl<T> Unpin for Vector3<T>where
T: Unpin,
impl<T> UnwindSafe for Vector3<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.