Struct ami::Vector [−][src]
Single-precision 3D vector.
Fields
x: f32
y: f32
z: f32
Methods
impl Vector
[src]
impl Vector
pub fn new(x: f32, y: f32, z: f32) -> Self
[src]
pub fn new(x: f32, y: f32, z: f32) -> Self
Full constructor.
pub fn zero() -> Self
[src]
pub fn zero() -> Self
Zero constructor.
pub fn cross(self, rhs: Self) -> Self
[src]
pub fn cross(self, rhs: Self) -> Self
Returns the cross product of two vectors.
pub fn angle(self, rhs: Self) -> f32
[src]
pub fn angle(self, rhs: Self) -> f32
pub fn dot(self, rhs: Vector) -> f32
[src]
pub fn dot(self, rhs: Vector) -> 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) -> Vector
[src]
pub fn normalize(self) -> Vector
Trait Implementations
impl Sub<Vector> for BBox
[src]
impl Sub<Vector> for BBox
type Output = BBox
The resulting type after applying the -
operator.
fn sub(self, other: Vector) -> Self::Output
[src]
fn sub(self, other: Vector) -> Self::Output
Performs the -
operation.
impl Add<Vector> for BBox
[src]
impl Add<Vector> for BBox
type Output = BBox
The resulting type after applying the +
operator.
fn add(self, other: Vector) -> Self::Output
[src]
fn add(self, other: Vector) -> Self::Output
Performs the +
operation.
impl Clone for Vector
[src]
impl Clone for Vector
fn clone(&self) -> Vector
[src]
fn clone(&self) -> Vector
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 Copy for Vector
[src]
impl Copy for Vector
impl Debug for Vector
[src]
impl Debug for Vector
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for Vector
[src]
impl Default for Vector
impl PartialEq for Vector
[src]
impl PartialEq for Vector
fn eq(&self, other: &Vector) -> bool
[src]
fn eq(&self, other: &Vector) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Vector) -> bool
[src]
fn ne(&self, other: &Vector) -> bool
This method tests for !=
.
impl From<f32> for Vector
[src]
impl From<f32> for Vector
impl Display for Vector
[src]
impl Display for Vector
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Add<Vector> for Vector
[src]
impl Add<Vector> for Vector
type Output = Vector
The resulting type after applying the +
operator.
fn add(self, rhs: Vector) -> Self::Output
[src]
fn add(self, rhs: Vector) -> Self::Output
Performs the +
operation.
impl AddAssign<Vector> for Vector
[src]
impl AddAssign<Vector> for Vector
fn add_assign(&mut self, rhs: Vector)
[src]
fn add_assign(&mut self, rhs: Vector)
Performs the +=
operation.
impl Sub<Vector> for Vector
[src]
impl Sub<Vector> for Vector
type Output = Vector
The resulting type after applying the -
operator.
fn sub(self, rhs: Vector) -> Self::Output
[src]
fn sub(self, rhs: Vector) -> Self::Output
Performs the -
operation.
impl SubAssign<Vector> for Vector
[src]
impl SubAssign<Vector> for Vector
fn sub_assign(&mut self, rhs: Vector)
[src]
fn sub_assign(&mut self, rhs: Vector)
Performs the -=
operation.
impl Mul<Vector> for f32
[src]
impl Mul<Vector> for f32
type Output = Vector
The resulting type after applying the *
operator.
fn mul(self, arg: Vector) -> Self::Output
[src]
fn mul(self, arg: Vector) -> Self::Output
Performs the *
operation.
impl Mul<f32> for Vector
[src]
impl Mul<f32> for Vector
type Output = Vector
The resulting type after applying the *
operator.
fn mul(self, arg: f32) -> Self::Output
[src]
fn mul(self, arg: f32) -> Self::Output
Performs the *
operation.
impl MulAssign<f32> for Vector
[src]
impl MulAssign<f32> for Vector
fn mul_assign(&mut self, rhs: f32)
[src]
fn mul_assign(&mut self, rhs: f32)
Performs the *=
operation.
impl Div<f32> for Vector
[src]
impl Div<f32> for Vector
type Output = Vector
The resulting type after applying the /
operator.
fn div(self, arg: f32) -> Self::Output
[src]
fn div(self, arg: f32) -> Self::Output
Performs the /
operation.
impl DivAssign<f32> for Vector
[src]
impl DivAssign<f32> for Vector
fn div_assign(&mut self, rhs: f32)
[src]
fn div_assign(&mut self, rhs: f32)
Performs the /=
operation.
impl Neg for Vector
[src]
impl Neg for Vector
type Output = Vector
The resulting type after applying the -
operator.
fn neg(self) -> Vector
[src]
fn neg(self) -> Vector
Performs the unary -
operation.
impl AsRef<[f32; 3]> for Vector
[src]
impl AsRef<[f32; 3]> for Vector
impl From<[f32; 3]> for Vector
[src]
impl From<[f32; 3]> for Vector
impl Into<[f32; 3]> for Vector
[src]
impl Into<[f32; 3]> for Vector