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]

Creates a new instances.

Returns the length of the vector

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]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T> Vector<T> for Vec3<T> where
    T: Copy
[src]

Returns the given value as a Vec3

impl<T> From<[T; 3]> for Vec3<T> where
    T: Copy
[src]

Performs the conversion.

impl From<Vec3<f32>> for [f32; 3]
[src]

Performs the conversion.

impl From<Vec3<f64>> for [f64; 3]
[src]

Performs the conversion.

impl<T> From<(T, T, T)> for Vec3<T>
[src]

Performs the conversion.

impl From<Vec3<f32>> for (f32, f32, f32)
[src]

Performs the conversion.

impl From<Vec3<f64>> for (f64, f64, f64)
[src]

Performs the conversion.

impl<T> Default for Vec3<T> where
    T: Float
[src]

Returns the "default value" for a type. Read more

impl<T> Neg for Vec3<T> where
    T: Float
[src]

The resulting type after applying the - operator.

Performs the unary - operation.

impl<T> Add for Vec3<T> where
    T: Float
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl<T> AddAssign for Vec3<T> where
    T: Float
[src]

Performs the += operation.

impl<T> Sub for Vec3<T> where
    T: Float
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl<T> SubAssign for Vec3<T> where
    T: Float
[src]

Performs the -= operation.

impl<T> Mul<Vec3<T>> for Vec3<T> where
    T: Float
[src]

The resulting type after applying the * operator.

Multiplies individual vector components with those of the given vector.

impl<T> MulAssign<Vec3<T>> for Vec3<T> where
    T: Float
[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]

The resulting type after applying the * operator.

Multiplies the vector with given scalar operand.

impl<T> MulAssign<T> for Vec3<T> where
    T: Float
[src]

Mutates the vector by multiplying it with the scalar operand.

impl<T> Div<Vec3<T>> for Vec3<T> where
    T: Float
[src]

The resulting type after applying the / operator.

Divides individual vector components with those of the given vector.

impl<T> DivAssign<Vec3<T>> for Vec3<T> where
    T: Float
[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]

The resulting type after applying the / operator.

Divides the vector by given scalar operand.

impl<T> DivAssign<T> for Vec3<T> where
    T: Float
[src]

Mutates the vector by dividing it by given scalar.

impl Mul<Vec3<f32>> for f32
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<Vec3<f64>> for f64
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl AsUniform for Vec3<f32>
[src]

impl AsUniform for Vec3<f64>
[src]

impl<T> Debug for Vec3<T> where
    T: Debug
[src]

Formats the value using the given formatter. Read more

impl<T> Mul<Vec3<T>> for Mat4<T> where
    T: Float
[src]

The resulting type after applying the * operator.

Multiplies the matrix with given vector operand using 1 as w-component of the vector.

Auto Trait Implementations

impl<T> Send for Vec3<T> where
    T: Send

impl<T> Sync for Vec3<T> where
    T: Sync