Struct ami::Vec4 [−][src]
Single-precision 4D vector.
Fields
x: f32
y: f32
z: f32
w: f32
Methods
impl Vec4
[src]
impl Vec4
pub fn new(x: f32, y: f32, z: f32, w: f32) -> Vec4
[src]
pub fn new(x: f32, y: f32, z: f32, w: f32) -> Vec4
Full constructor.
pub fn zero() -> Vec4
[src]
pub fn zero() -> Vec4
Zero constructor.
pub fn xy(self) -> Vec2
[src]
pub fn xy(self) -> Vec2
Returns the XY components of the vector.
pub fn xyz(self) -> Vec3
[src]
pub fn xyz(self) -> Vec3
Returns the XYZ components of the vector.
impl Vec4
[src]
impl Vec4
pub fn dot(self, rhs: Vec4) -> f32
[src]
pub fn dot(self, rhs: Vec4) -> f32
Returns the dot product of two vectors.
pub fn length(self) -> f32
[src]
pub fn length(self) -> f32
Returns the length (magnitude) of the vector.
pub fn squared_length(self) -> f32
[src]
pub fn squared_length(self) -> f32
Returns the squared length of the vector.
pub fn normalize(self) -> Vec4
[src]
pub fn normalize(self) -> Vec4
Trait Implementations
impl Into<[f32; 4]> for Vec4
[src]
impl Into<[f32; 4]> for Vec4
impl ApproxEq for Vec4
[src]
impl ApproxEq for Vec4
type Epsilon = <Vector4<f32> as ApproxEq>::Epsilon
Used for specifying relative comparisons.
fn default_epsilon() -> <Vec4 as ApproxEq>::Epsilon
[src]
fn default_epsilon() -> <Vec4 as ApproxEq>::Epsilon
The default tolerance to use when testing values that are close together. Read more
fn default_max_relative() -> <Vec4 as ApproxEq>::Epsilon
[src]
fn default_max_relative() -> <Vec4 as ApproxEq>::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
fn default_max_ulps() -> u32
[src]
fn default_max_ulps() -> u32
The default ULPs to tolerate when testing values that are far-apart. Read more
fn relative_eq(
&self,
other: &Vec4,
epsilon: <Vec4 as ApproxEq>::Epsilon,
max_relative: <Vec4 as ApproxEq>::Epsilon
) -> bool
[src]
fn relative_eq(
&self,
other: &Vec4,
epsilon: <Vec4 as ApproxEq>::Epsilon,
max_relative: <Vec4 as ApproxEq>::Epsilon
) -> bool
A test for equality that uses a relative comparison if the values are far apart.
fn ulps_eq(
&self,
other: &Vec4,
epsilon: <Vec4 as ApproxEq>::Epsilon,
max_ulps: u32
) -> bool
[src]
fn ulps_eq(
&self,
other: &Vec4,
epsilon: <Vec4 as ApproxEq>::Epsilon,
max_ulps: u32
) -> bool
A test for equality that uses units in the last place (ULP) if the values are far apart.
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
The inverse of ApproxEq::relative_eq
.
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
The inverse of ApproxEq::ulps_eq
.
impl Add<Vec4> for Vec4
[src]
impl Add<Vec4> for Vec4
type Output = Vec4
The resulting type after applying the +
operator.
fn add(self, rhs: Vec4) -> <Vec4 as Add<Vec4>>::Output
[src]
fn add(self, rhs: Vec4) -> <Vec4 as Add<Vec4>>::Output
Performs the +
operation.
impl Sub<Vec4> for Vec4
[src]
impl Sub<Vec4> for Vec4
type Output = Vec4
The resulting type after applying the -
operator.
fn sub(self, rhs: Vec4) -> <Vec4 as Sub<Vec4>>::Output
[src]
fn sub(self, rhs: Vec4) -> <Vec4 as Sub<Vec4>>::Output
Performs the -
operation.
impl Clone for Vec4
[src]
impl Clone for Vec4
fn clone(&self) -> Vec4
[src]
fn clone(&self) -> Vec4
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Display for Vec4
[src]
impl Display for Vec4
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl MulAssign<f32> for Vec4
[src]
impl MulAssign<f32> for Vec4
fn mul_assign(&mut self, rhs: f32)
[src]
fn mul_assign(&mut self, rhs: f32)
Performs the *=
operation.
impl Default for Vec4
[src]
impl Default for Vec4
impl Debug for Vec4
[src]
impl Debug for Vec4
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl SubAssign<Vec4> for Vec4
[src]
impl SubAssign<Vec4> for Vec4
fn sub_assign(&mut self, rhs: Vec4)
[src]
fn sub_assign(&mut self, rhs: Vec4)
Performs the -=
operation.
impl Mul<f32> for Vec4
[src]
impl Mul<f32> for Vec4
type Output = Vec4
The resulting type after applying the *
operator.
fn mul(self, arg: f32) -> <Vec4 as Mul<f32>>::Output
[src]
fn mul(self, arg: f32) -> <Vec4 as Mul<f32>>::Output
Performs the *
operation.
impl Mul<Vec4> for f32
[src]
impl Mul<Vec4> for f32
type Output = Vec4
The resulting type after applying the *
operator.
fn mul(self, arg: Vec4) -> <f32 as Mul<Vec4>>::Output
[src]
fn mul(self, arg: Vec4) -> <f32 as Mul<Vec4>>::Output
Performs the *
operation.
impl Mul<Vec4> for Mat4
[src]
impl Mul<Vec4> for Mat4
type Output = Vec4
The resulting type after applying the *
operator.
fn mul(self, rhs: Vec4) -> <Mat4 as Mul<Vec4>>::Output
[src]
fn mul(self, rhs: Vec4) -> <Mat4 as Mul<Vec4>>::Output
Performs the *
operation.
impl<'a> Mul<Vec4> for &'a Mat4
[src]
impl<'a> Mul<Vec4> for &'a Mat4
type Output = Vec4
The resulting type after applying the *
operator.
fn mul(self, rhs: Vec4) -> <&'a Mat4 as Mul<Vec4>>::Output
[src]
fn mul(self, rhs: Vec4) -> <&'a Mat4 as Mul<Vec4>>::Output
Performs the *
operation.
impl Copy for Vec4
[src]
impl Copy for Vec4
impl DivAssign<f32> for Vec4
[src]
impl DivAssign<f32> for Vec4
fn div_assign(&mut self, rhs: f32)
[src]
fn div_assign(&mut self, rhs: f32)
Performs the /=
operation.
impl AsRef<[f32; 4]> for Vec4
[src]
impl AsRef<[f32; 4]> for Vec4
impl PartialEq<Vec4> for Vec4
[src]
impl PartialEq<Vec4> for Vec4
fn eq(&self, other: &Vec4) -> bool
[src]
fn eq(&self, other: &Vec4) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Vec4) -> bool
[src]
fn ne(&self, other: &Vec4) -> bool
This method tests for !=
.
impl Div<f32> for Vec4
[src]
impl Div<f32> for Vec4
type Output = Vec4
The resulting type after applying the /
operator.
fn div(self, arg: f32) -> <Vec4 as Div<f32>>::Output
[src]
fn div(self, arg: f32) -> <Vec4 as Div<f32>>::Output
Performs the /
operation.
impl AddAssign<Vec4> for Vec4
[src]
impl AddAssign<Vec4> for Vec4
fn add_assign(&mut self, rhs: Vec4)
[src]
fn add_assign(&mut self, rhs: Vec4)
Performs the +=
operation.
impl From<f64> for Vec4
[src]
impl From<f64> for Vec4
impl From<DVec4> for Vec4
[src]
impl From<DVec4> for Vec4
impl<T> From<(T, f32, f32)> for Vec4 where
T: Into<Vec2>,
[src]
impl<T> From<(T, f32, f32)> for Vec4 where
T: Into<Vec2>,
impl From<f32> for Vec4
[src]
impl From<f32> for Vec4
impl From<Vec4> for DVec4
[src]
impl From<Vec4> for DVec4
impl<T> From<(T, f32)> for Vec4 where
T: Into<Vec3>,
[src]
impl<T> From<(T, f32)> for Vec4 where
T: Into<Vec3>,
impl From<[f32; 4]> for Vec4
[src]
impl From<[f32; 4]> for Vec4