Struct radiant_utils::maths::Vec3
[−]
[src]
pub struct Vec3<T = f32>(pub T, pub T, pub T);
A 3-dimensional vector.
Methods
impl<T> Vec3<T> where
T: Float, [src]
T: Float,
pub fn new() -> Vec3<T>[src]
Creates a new instances.
pub fn len(&self) -> T[src]
Returns the length of the vector
pub fn dot(&self, other: &Vec3<T>) -> T[src]
Returns the dot-product of the vectors.
Trait Implementations
impl<T: Copy> Copy for Vec3<T>[src]
impl<T: Clone> Clone for Vec3<T>[src]
fn clone(&self) -> Vec3<T>[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl<T> Vector<T> for Vec3<T> where
T: Copy, [src]
T: Copy,
impl<T> From<[T; 3]> for Vec3<T> where
T: Copy, [src]
T: Copy,
impl From<Vec3<f32>> for [f32; 3][src]
impl From<Vec3<f64>> for [f64; 3][src]
impl<T> From<(T, T, T)> for Vec3<T>[src]
impl From<Vec3<f32>> for (f32, f32, f32)[src]
impl From<Vec3<f64>> for (f64, f64, f64)[src]
impl<T> Default for Vec3<T> where
T: Float, [src]
T: Float,
impl<T> Neg for Vec3<T> where
T: Float, [src]
T: Float,
type Output = Vec3<T>
The resulting type after applying the - operator.
fn neg(self) -> Vec3<T>[src]
Performs the unary - operation.
impl<T> Add for Vec3<T> where
T: Float, [src]
T: Float,
type Output = Vec3<T>
The resulting type after applying the + operator.
fn add(self, other: Vec3<T>) -> Vec3<T>[src]
Performs the + operation.
impl<T> AddAssign for Vec3<T> where
T: Float, [src]
T: Float,
fn add_assign(&mut self, other: Vec3<T>)[src]
Performs the += operation.
impl<T> Sub for Vec3<T> where
T: Float, [src]
T: Float,
type Output = Vec3<T>
The resulting type after applying the - operator.
fn sub(self, other: Vec3<T>) -> Vec3<T>[src]
Performs the - operation.
impl<T> SubAssign for Vec3<T> where
T: Float, [src]
T: Float,
fn sub_assign(&mut self, other: Vec3<T>)[src]
Performs the -= operation.
impl<T> Mul<Vec3<T>> for Vec3<T> where
T: Float, [src]
T: Float,
type Output = Vec3<T>
The resulting type after applying the * operator.
fn mul(self, other: Vec3<T>) -> Vec3<T>[src]
Multiplies individual vector components with those of the given vector.
impl<T> MulAssign<Vec3<T>> for Vec3<T> where
T: Float, [src]
T: Float,
fn mul_assign(&mut self, other: Vec3<T>)[src]
Mutates the vector by multiplying its components with those of the given vector.
impl<T> Mul<T> for Vec3<T> where
T: Float, [src]
T: Float,
type Output = Vec3<T>
The resulting type after applying the * operator.
fn mul(self, other: T) -> Vec3<T>[src]
Multiplies the vector with given scalar operand.
impl<T> MulAssign<T> for Vec3<T> where
T: Float, [src]
T: Float,
fn mul_assign(&mut self, other: T)[src]
Mutates the vector by multiplying it with the scalar operand.
impl<T> Div<Vec3<T>> for Vec3<T> where
T: Float, [src]
T: Float,
type Output = Vec3<T>
The resulting type after applying the / operator.
fn div(self, other: Vec3<T>) -> Vec3<T>[src]
Divides individual vector components with those of the given vector.
impl<T> DivAssign<Vec3<T>> for Vec3<T> where
T: Float, [src]
T: Float,
fn div_assign(&mut self, other: Vec3<T>)[src]
Mutates the vector by dividing its components with those of the given vector.
impl<T> Div<T> for Vec3<T> where
T: Float, [src]
T: Float,
type Output = Vec3<T>
The resulting type after applying the / operator.
fn div(self, other: T) -> Vec3<T>[src]
Divides the vector by given scalar operand.
impl<T> DivAssign<T> for Vec3<T> where
T: Float, [src]
T: Float,
fn div_assign(&mut self, other: T)[src]
Mutates the vector by dividing it by given scalar.
impl Mul<Vec3<f32>> for f32[src]
type Output = Vec3<f32>
The resulting type after applying the * operator.
fn mul(self, other: Vec3<f32>) -> Vec3<f32>[src]
Performs the * operation.
impl Mul<Vec3<f64>> for f64[src]
type Output = Vec3<f64>
The resulting type after applying the * operator.
fn mul(self, other: Vec3<f64>) -> Vec3<f64>[src]
Performs the * operation.
impl AsUniform for Vec3<f32>[src]
fn as_uniform(&self) -> Uniform[src]
impl AsUniform for Vec3<f64>[src]
fn as_uniform(&self) -> Uniform[src]
impl<T> Debug for Vec3<T> where
T: Debug, [src]
T: Debug,
fn fmt(&self, f: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl<T> Mul<Vec3<T>> for Mat4<T> where
T: Float, [src]
T: Float,