Struct ami::Vec3 [−][src]
Single-precision 3D vector.
Fields
x: f32
y: f32
z: f32
Methods
impl Vec3
[src]
impl Vec3
pub fn new(x: f32, y: f32, z: f32) -> Vec3
[src]
pub fn new(x: f32, y: f32, z: f32) -> Vec3
Full constructor.
pub fn zero() -> Vec3
[src]
pub fn zero() -> Vec3
Zero constructor.
pub fn xy(self) -> Vec2
[src]
pub fn xy(self) -> Vec2
Returns the XY components of the vector.
impl Vec3
[src]
impl Vec3
impl Vec3
[src]
impl Vec3
pub fn dot(self, rhs: Vec3) -> f32
[src]
pub fn dot(self, rhs: Vec3) -> 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) -> Vec3
[src]
pub fn normalize(self) -> Vec3
impl Vec3
[src]
impl Vec3
Trait Implementations
impl Into<[f32; 3]> for Vec3
[src]
impl Into<[f32; 3]> for Vec3
impl ApproxEq for Vec3
[src]
impl ApproxEq for Vec3
type Epsilon = <Vector3<f32> as ApproxEq>::Epsilon
Used for specifying relative comparisons.
fn default_epsilon() -> <Vec3 as ApproxEq>::Epsilon
[src]
fn default_epsilon() -> <Vec3 as ApproxEq>::Epsilon
The default tolerance to use when testing values that are close together. Read more
fn default_max_relative() -> <Vec3 as ApproxEq>::Epsilon
[src]
fn default_max_relative() -> <Vec3 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: &Vec3,
epsilon: <Vec3 as ApproxEq>::Epsilon,
max_relative: <Vec3 as ApproxEq>::Epsilon
) -> bool
[src]
fn relative_eq(
&self,
other: &Vec3,
epsilon: <Vec3 as ApproxEq>::Epsilon,
max_relative: <Vec3 as ApproxEq>::Epsilon
) -> bool
A test for equality that uses a relative comparison if the values are far apart.
fn ulps_eq(
&self,
other: &Vec3,
epsilon: <Vec3 as ApproxEq>::Epsilon,
max_ulps: u32
) -> bool
[src]
fn ulps_eq(
&self,
other: &Vec3,
epsilon: <Vec3 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<Vec3> for Vec3
[src]
impl Add<Vec3> for Vec3
type Output = Vec3
The resulting type after applying the +
operator.
fn add(self, rhs: Vec3) -> <Vec3 as Add<Vec3>>::Output
[src]
fn add(self, rhs: Vec3) -> <Vec3 as Add<Vec3>>::Output
Performs the +
operation.
impl Sub<Vec3> for Vec3
[src]
impl Sub<Vec3> for Vec3
type Output = Vec3
The resulting type after applying the -
operator.
fn sub(self, rhs: Vec3) -> <Vec3 as Sub<Vec3>>::Output
[src]
fn sub(self, rhs: Vec3) -> <Vec3 as Sub<Vec3>>::Output
Performs the -
operation.
impl Display for Vec3
[src]
impl Display for Vec3
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 Clone for Vec3
[src]
impl Clone for Vec3
fn clone(&self) -> Vec3
[src]
fn clone(&self) -> Vec3
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 MulAssign<f32> for Vec3
[src]
impl MulAssign<f32> for Vec3
fn mul_assign(&mut self, rhs: f32)
[src]
fn mul_assign(&mut self, rhs: f32)
Performs the *=
operation.
impl Default for Vec3
[src]
impl Default for Vec3
impl Debug for Vec3
[src]
impl Debug for Vec3
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<Vec3> for Vec3
[src]
impl SubAssign<Vec3> for Vec3
fn sub_assign(&mut self, rhs: Vec3)
[src]
fn sub_assign(&mut self, rhs: Vec3)
Performs the -=
operation.
impl Mul<f32> for Vec3
[src]
impl Mul<f32> for Vec3
type Output = Vec3
The resulting type after applying the *
operator.
fn mul(self, arg: f32) -> <Vec3 as Mul<f32>>::Output
[src]
fn mul(self, arg: f32) -> <Vec3 as Mul<f32>>::Output
Performs the *
operation.
impl Mul<Vec3> for f32
[src]
impl Mul<Vec3> for f32
type Output = Vec3
The resulting type after applying the *
operator.
fn mul(self, arg: Vec3) -> <f32 as Mul<Vec3>>::Output
[src]
fn mul(self, arg: Vec3) -> <f32 as Mul<Vec3>>::Output
Performs the *
operation.
impl<'a> Mul<Vec3> for &'a Mat3
[src]
impl<'a> Mul<Vec3> for &'a Mat3
type Output = Vec3
The resulting type after applying the *
operator.
fn mul(self, rhs: Vec3) -> <&'a Mat3 as Mul<Vec3>>::Output
[src]
fn mul(self, rhs: Vec3) -> <&'a Mat3 as Mul<Vec3>>::Output
Performs the *
operation.
impl Mul<Vec3> for Mat3
[src]
impl Mul<Vec3> for Mat3
type Output = Vec3
The resulting type after applying the *
operator.
fn mul(self, rhs: Vec3) -> <Mat3 as Mul<Vec3>>::Output
[src]
fn mul(self, rhs: Vec3) -> <Mat3 as Mul<Vec3>>::Output
Performs the *
operation.
impl DivAssign<f32> for Vec3
[src]
impl DivAssign<f32> for Vec3
fn div_assign(&mut self, rhs: f32)
[src]
fn div_assign(&mut self, rhs: f32)
Performs the /=
operation.
impl Copy for Vec3
[src]
impl Copy for Vec3
impl AsRef<[f32; 3]> for Vec3
[src]
impl AsRef<[f32; 3]> for Vec3
impl PartialEq<Vec3> for Vec3
[src]
impl PartialEq<Vec3> for Vec3
fn eq(&self, other: &Vec3) -> bool
[src]
fn eq(&self, other: &Vec3) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Vec3) -> bool
[src]
fn ne(&self, other: &Vec3) -> bool
This method tests for !=
.
impl AddAssign<Vec3> for Vec3
[src]
impl AddAssign<Vec3> for Vec3
fn add_assign(&mut self, rhs: Vec3)
[src]
fn add_assign(&mut self, rhs: Vec3)
Performs the +=
operation.
impl From<f64> for Vec3
[src]
impl From<f64> for Vec3
impl From<DVec3> for Vec3
[src]
impl From<DVec3> for Vec3
impl From<Vec3> for DVec3
[src]
impl From<Vec3> for DVec3
impl<T> From<(T, f32)> for Vec3 where
T: Into<Vec2>,
[src]
impl<T> From<(T, f32)> for Vec3 where
T: Into<Vec2>,
impl From<f32> for Vec3
[src]
impl From<f32> for Vec3
impl From<[f32; 3]> for Vec3
[src]
impl From<[f32; 3]> for Vec3
impl Div<f32> for Vec3
[src]
impl Div<f32> for Vec3
type Output = Vec3
The resulting type after applying the /
operator.
fn div(self, arg: f32) -> <Vec3 as Div<f32>>::Output
[src]
fn div(self, arg: f32) -> <Vec3 as Div<f32>>::Output
Performs the /
operation.
impl Sub<Vec3> for BBox
[src]
impl Sub<Vec3> for BBox
type Output = BBox
The resulting type after applying the -
operator.
fn sub(self, other: Vec3) -> Self::Output
[src]
fn sub(self, other: Vec3) -> Self::Output
Performs the -
operation.
impl Add<Vec3> for BBox
[src]
impl Add<Vec3> for BBox