[−][src]Struct gramit::vec::Vec4
Fields
x: f32
y: f32
z: f32
w: f32
Methods
impl Vec4
[src]
pub fn new(x: f32, y: f32, z: f32, w: f32) -> Self
[src]
Create a new vector with the given components.
pub fn x() -> Self
[src]
Create a unit vector along this axis.
pub fn y() -> Self
[src]
Create a unit vector along this axis.
pub fn z() -> Self
[src]
Create a unit vector along this axis.
pub fn w() -> Self
[src]
Create a unit vector along this axis.
pub fn angle_between(&self, other: &Vec4) -> Angle
[src]
Get the angle between this vector and another.
impl Vec4
[src]
pub fn truncate(self) -> Vec3
[src]
Truncate the w component of this Vec4
to produce a Vec3
.
pub fn homogenize(self) -> Vec3
[src]
Convert a homogeneous 4-vector to the corresponding point in 3-space.
Trait Implementations
impl ApproxEq<Vec4> for Vec4
[src]
fn approx_eq(self, rhs: Vec4) -> bool
[src]
fn within_threshold(self, rhs: Vec4, threshold: Vec4) -> bool
[src]
Compare two vectors for approximate equality.
Uses a third vector for component-wise thresholds.
impl Vector for Vec4
[src]
type Scalar = f32
The scalar type over which this vector type is defined. Read more
const DIMS: usize
[src]
fn length(&self) -> f32
[src]
fn dot(&self, other: &Self) -> f32
[src]
fn ones() -> Self
[src]
fn zeros() -> Self
[src]
fn unit(&self) -> Self
[src]
fn scalar_mul(&self, s: &f32) -> Self
[src]
fn vector_add(&self, v: &Self) -> Self
[src]
impl AsMut<[f32]> for Vec4
[src]
impl AsRef<[f32]> for Vec4
[src]
impl Into<Vec<f32>> for Vec4
[src]
impl Clone for Vec4
[src]
impl Copy for Vec4
[src]
impl Default for Vec4
[src]
impl PartialEq<Vec4> for Vec4
[src]
impl Debug for Vec4
[src]
impl Div<Vec4> for Vec4
[src]
type Output = Vec4
The resulting type after applying the /
operator.
fn div(self, rhs: Vec4) -> Vec4
[src]
Component-wise arithemetic operation.
impl<'_> Div<&'_ Vec4> for Vec4
[src]
type Output = Vec4
The resulting type after applying the /
operator.
fn div(self, rhs: &Vec4) -> Vec4
[src]
Component-wise arithemetic operation.
impl<'_> Div<Vec4> for &'_ Vec4
[src]
type Output = Vec4
The resulting type after applying the /
operator.
fn div(self, rhs: Vec4) -> Vec4
[src]
Component-wise arithemetic operation.
impl<'_, '_> Div<&'_ Vec4> for &'_ Vec4
[src]
type Output = Vec4
The resulting type after applying the /
operator.
fn div(self, rhs: &Vec4) -> Vec4
[src]
Component-wise arithemetic operation.
impl Div<f32> for Vec4
[src]
type Output = Vec4
The resulting type after applying the /
operator.
fn div(self, rhs: f32) -> Vec4
[src]
impl<'_> Div<&'_ f32> for Vec4
[src]
type Output = Vec4
The resulting type after applying the /
operator.
fn div(self, rhs: &f32) -> Vec4
[src]
impl<'_> Div<f32> for &'_ Vec4
[src]
type Output = Vec4
The resulting type after applying the /
operator.
fn div(self, rhs: f32) -> Vec4
[src]
impl<'_, '_> Div<&'_ f32> for &'_ Vec4
[src]
type Output = Vec4
The resulting type after applying the /
operator.
fn div(self, rhs: &f32) -> Vec4
[src]
impl Sub<Vec4> for Vec4
[src]
type Output = Vec4
The resulting type after applying the -
operator.
fn sub(self, rhs: Vec4) -> Vec4
[src]
Component-wise arithemetic operation.
impl<'_> Sub<&'_ Vec4> for Vec4
[src]
type Output = Vec4
The resulting type after applying the -
operator.
fn sub(self, rhs: &Vec4) -> Vec4
[src]
Component-wise arithemetic operation.
impl<'_> Sub<Vec4> for &'_ Vec4
[src]
type Output = Vec4
The resulting type after applying the -
operator.
fn sub(self, rhs: Vec4) -> Vec4
[src]
Component-wise arithemetic operation.
impl<'_, '_> Sub<&'_ Vec4> for &'_ Vec4
[src]
type Output = Vec4
The resulting type after applying the -
operator.
fn sub(self, rhs: &Vec4) -> Vec4
[src]
Component-wise arithemetic operation.
impl Add<Vec4> for Vec4
[src]
type Output = Vec4
The resulting type after applying the +
operator.
fn add(self, rhs: Vec4) -> Vec4
[src]
Component-wise arithemetic operation.
impl<'_> Add<&'_ Vec4> for Vec4
[src]
type Output = Vec4
The resulting type after applying the +
operator.
fn add(self, rhs: &Vec4) -> Vec4
[src]
Component-wise arithemetic operation.
impl<'_> Add<Vec4> for &'_ Vec4
[src]
type Output = Vec4
The resulting type after applying the +
operator.
fn add(self, rhs: Vec4) -> Vec4
[src]
Component-wise arithemetic operation.
impl<'_, '_> Add<&'_ Vec4> for &'_ Vec4
[src]
type Output = Vec4
The resulting type after applying the +
operator.
fn add(self, rhs: &Vec4) -> Vec4
[src]
Component-wise arithemetic operation.
impl Mul<Vec4> for Mat4
[src]
type Output = Vec4
The resulting type after applying the *
operator.
fn mul(self, rhs: Vec4) -> Vec4
[src]
Matrix-vector multiplication operation.
impl<'_> Mul<&'_ Vec4> for Mat4
[src]
type Output = Vec4
The resulting type after applying the *
operator.
fn mul(self, rhs: &Vec4) -> Vec4
[src]
Matrix-vector multiplication operation.
impl<'_> Mul<Vec4> for &'_ Mat4
[src]
type Output = Vec4
The resulting type after applying the *
operator.
fn mul(self, rhs: Vec4) -> Vec4
[src]
Matrix-vector multiplication operation.
impl<'_, '_> Mul<&'_ Vec4> for &'_ Mat4
[src]
type Output = Vec4
The resulting type after applying the *
operator.
fn mul(self, rhs: &Vec4) -> Vec4
[src]
Matrix-vector multiplication operation.
impl Mul<Vec4> for Vec4
[src]
type Output = Vec4
The resulting type after applying the *
operator.
fn mul(self, rhs: Vec4) -> Vec4
[src]
Component-wise arithemetic operation.
impl<'_> Mul<&'_ Vec4> for Vec4
[src]
type Output = Vec4
The resulting type after applying the *
operator.
fn mul(self, rhs: &Vec4) -> Vec4
[src]
Component-wise arithemetic operation.
impl<'_> Mul<Vec4> for &'_ Vec4
[src]
type Output = Vec4
The resulting type after applying the *
operator.
fn mul(self, rhs: Vec4) -> Vec4
[src]
Component-wise arithemetic operation.
impl<'_, '_> Mul<&'_ Vec4> for &'_ Vec4
[src]
type Output = Vec4
The resulting type after applying the *
operator.
fn mul(self, rhs: &Vec4) -> Vec4
[src]
Component-wise arithemetic operation.
impl Mul<f32> for Vec4
[src]
type Output = Vec4
The resulting type after applying the *
operator.
fn mul(self, rhs: f32) -> Vec4
[src]
impl Mul<Vec4> for f32
[src]
type Output = Vec4
The resulting type after applying the *
operator.
fn mul(self, rhs: Vec4) -> Vec4
[src]
impl<'_> Mul<&'_ f32> for Vec4
[src]
type Output = Vec4
The resulting type after applying the *
operator.
fn mul(self, rhs: &f32) -> Vec4
[src]
impl<'_> Mul<Vec4> for &'_ f32
[src]
type Output = Vec4
The resulting type after applying the *
operator.
fn mul(self, rhs: Vec4) -> Vec4
[src]
impl<'_> Mul<f32> for &'_ Vec4
[src]
type Output = Vec4
The resulting type after applying the *
operator.
fn mul(self, rhs: f32) -> Vec4
[src]
impl<'_> Mul<&'_ Vec4> for f32
[src]
type Output = Vec4
The resulting type after applying the *
operator.
fn mul(self, rhs: &Vec4) -> Vec4
[src]
impl<'_, '_> Mul<&'_ f32> for &'_ Vec4
[src]
type Output = Vec4
The resulting type after applying the *
operator.
fn mul(self, rhs: &f32) -> Vec4
[src]
impl<'_, '_> Mul<&'_ Vec4> for &'_ f32
[src]
type Output = Vec4
The resulting type after applying the *
operator.
fn mul(self, rhs: &Vec4) -> Vec4
[src]
impl Neg for Vec4
[src]
impl<'_> Neg for &'_ Vec4
[src]
impl AddAssign<Vec4> for Vec4
[src]
fn add_assign(&mut self, rhs: Vec4)
[src]
Component-wise arithmetic assignment operation.
impl<'_> AddAssign<&'_ Vec4> for Vec4
[src]
fn add_assign(&mut self, rhs: &Vec4)
[src]
Component-wise arithmetic assignment operation.
impl SubAssign<Vec4> for Vec4
[src]
fn sub_assign(&mut self, rhs: Vec4)
[src]
Component-wise arithmetic assignment operation.
impl<'_> SubAssign<&'_ Vec4> for Vec4
[src]
fn sub_assign(&mut self, rhs: &Vec4)
[src]
Component-wise arithmetic assignment operation.
impl MulAssign<Vec4> for Vec4
[src]
fn mul_assign(&mut self, rhs: Vec4)
[src]
Component-wise arithmetic assignment operation.
impl<'_> MulAssign<&'_ Vec4> for Vec4
[src]
fn mul_assign(&mut self, rhs: &Vec4)
[src]
Component-wise arithmetic assignment operation.
impl MulAssign<f32> for Vec4
[src]
fn mul_assign(&mut self, rhs: f32)
[src]
impl<'_> MulAssign<&'_ f32> for Vec4
[src]
fn mul_assign(&mut self, rhs: &f32)
[src]
impl DivAssign<Vec4> for Vec4
[src]
fn div_assign(&mut self, rhs: Vec4)
[src]
Component-wise arithmetic assignment operation.
impl<'_> DivAssign<&'_ Vec4> for Vec4
[src]
fn div_assign(&mut self, rhs: &Vec4)
[src]
Component-wise arithmetic assignment operation.
impl DivAssign<f32> for Vec4
[src]
fn div_assign(&mut self, rhs: f32)
[src]
impl<'_> DivAssign<&'_ f32> for Vec4
[src]
fn div_assign(&mut self, rhs: &f32)
[src]
impl Index<usize> for Vec4
[src]
impl IndexMut<usize> for Vec4
[src]
impl StructuralPartialEq for Vec4
[src]
Auto Trait Implementations
impl Send for Vec4
impl Sync for Vec4
impl Unpin for Vec4
impl UnwindSafe for Vec4
impl RefUnwindSafe for Vec4
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,