Struct ami::Vec3 [] [src]

pub struct Vec3<T: Copy + Clone> {
    pub x: T,
    pub y: T,
    pub z: T,
}

3-dimensional vector

Fields

X coordinate

Y coordinate

Z coordinate

Methods

impl<T> Vec3<T> where
    T: Copy + Clone
[src]

[src]

Create a new Vec3

[src]

Get the magnitude of a Vec3

impl Vec3<f32>
[src]

[src]

Multiply matrix onto Vec3 (as directional vector)

[src]

Create a zero Vec3

[src]

Find the midpoint between two Vec3

[src]

Calculate the distance squared between two Vec3

[src]

The recipricol (inverse) of the vector.

[src]

Calculate the dot product of two Vec3s

[src]

Normalize a Vec3

[src]

Calculate angle between 2 Vec3's

Trait Implementations

impl<T: Clone + Copy + Clone> Clone for Vec3<T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: Copy + Copy + Clone> Copy for Vec3<T>
[src]

impl<T: PartialEq + Copy + Clone> PartialEq for Vec3<T>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

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

[src]

Formats the value using the given formatter.

impl<T> Add for Vec3<T> where
    T: Add<Output = T> + Copy + Clone
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl<T> Sub for Vec3<T> where
    T: Sub<Output = T> + Copy + Clone
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl<T> Mul<T> for Vec3<T> where
    T: Mul<Output = T> + Copy + Clone
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<T> Div<T> for Vec3<T> where
    T: Div<Output = T> + Copy + Clone
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<T> Neg for Vec3<T> where
    T: Neg<Output = T> + Copy + Clone
[src]

The resulting type after applying the - operator.

[src]

Performs the unary - operation.

impl From<Vec3<f32>> for Vec3<i64>
[src]

[src]

Performs the conversion.

impl From<Vec3<f32>> for Vec3<i32>
[src]

[src]

Performs the conversion.

impl From<Vec3<i64>> for Vec3<f32>
[src]

[src]

Performs the conversion.

impl From<Vec3<i32>> for Vec3<f32>
[src]

[src]

Performs the conversion.

impl Pos for Vec3<f32>
[src]

[src]

Position as float

[src]

Position as int

impl Pos for Vec3<i32>
[src]

[src]

Position as int

[src]

Position as float