[][src]Struct iomath::types::basic_types::TVector3

pub struct TVector3<T> {
    pub x: T,
    pub y: T,
    pub z: T,
}

Fields

x: Ty: Tz: T

Implementations

impl<T> TVector3<T> where
    T: Zero<T> + Copy
[src]

pub fn empty() -> Self[src]

Creates TVector3<type> whose x, y and z equal to zero

use iomath::vectors::Vector3;
 
let vector = Vector3::empty();
assert_eq!(vector, Vector3 { x: 0.0, y: 0.0, z: 0.0 });

pub fn new(x: T, y: T, z: T) -> Self[src]

Creates TVector3<type> with x, y and z

use iomath::vectors::Vector3;
 
let vector = Vector3::new(3.7, -1.3, 0.5);
assert_eq!(vector, Vector3 { x: 3.7, y: -1.3, z: 0.5 });

pub fn from_scalar(scalar: T) -> Self[src]

Creates TVector3<type> whose x, y and z equal to scalar

use iomath::vectors::Vector3;
 
let vector = Vector3::from_scalar(8.2);
assert_eq!(vector, Vector3::new(8.2, 8.2, 8.2));

pub fn from_value_vector(value: T, vector: TVector2<T>) -> Self[src]

Creates TVector3<type> whose x equals to value, y and z equal to TVector2<type>'s x and y

use iomath::vectors::{ Vector3, Vector2 };
 
let vector = Vector3::from_value_vector(-4.2, Vector2::new(7.3, 2.4));
assert_eq!(vector, Vector3::new(-4.2, 7.3, 2.4));

pub fn from_vector_value(vector: TVector2<T>, value: T) -> Self[src]

Creates TVector3<type> whose x and y equal to TVector2<type>'s x and y, z equals to value

use iomath::vectors::{ Vector3, Vector2 };
 
let vector = Vector3::from_vector_value(Vector2::new(7.3, 2.4), -4.2);
assert_eq!(vector, Vector3::new(7.3, 2.4, -4.2));

Trait Implementations

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

type Output = Self

The resulting type after applying the + operator.

impl<T> Add<TVector3<T>> for TVector3<T> where
    T: Add<Output = T>, 
[src]

type Output = Self

The resulting type after applying the + operator.

impl<T> AddAssign<T> for TVector3<T> where
    T: AddAssign + Copy
[src]

impl<T> AddAssign<TVector3<T>> for TVector3<T> where
    T: AddAssign
[src]

impl<T> BitAnd<T> for TVector3<T> where
    T: BitAnd<Output = T> + Copy
[src]

type Output = Self

The resulting type after applying the & operator.

impl<T> BitAnd<TVector3<T>> for TVector3<T> where
    T: BitAnd<Output = T>, 
[src]

type Output = Self

The resulting type after applying the & operator.

impl<T> BitAndAssign<T> for TVector3<T> where
    T: BitAndAssign + Copy
[src]

impl<T> BitAndAssign<TVector3<T>> for TVector3<T> where
    T: BitAndAssign
[src]

impl<T> BitOr<T> for TVector3<T> where
    T: BitOr<Output = T> + Copy
[src]

type Output = Self

The resulting type after applying the | operator.

impl<T> BitOr<TVector3<T>> for TVector3<T> where
    T: BitOr<Output = T>, 
[src]

type Output = Self

The resulting type after applying the | operator.

impl<T> BitOrAssign<T> for TVector3<T> where
    T: BitOrAssign + Copy
[src]

impl<T> BitOrAssign<TVector3<T>> for TVector3<T> where
    T: BitOrAssign
[src]

impl<T> BitXor<T> for TVector3<T> where
    T: BitXor<Output = T> + Copy
[src]

type Output = Self

The resulting type after applying the ^ operator.

impl<T> BitXor<TVector3<T>> for TVector3<T> where
    T: BitXor<Output = T>, 
[src]

type Output = Self

The resulting type after applying the ^ operator.

impl<T> BitXorAssign<T> for TVector3<T> where
    T: BitXorAssign + Copy
[src]

impl<T> BitXorAssign<TVector3<T>> for TVector3<T> where
    T: BitXorAssign
[src]

impl<T> Clone for TVector3<T> where
    T: Copy
[src]

impl<T> Copy for TVector3<T> where
    T: Copy
[src]

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

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

type Output = Self

The resulting type after applying the / operator.

impl<T> Div<TVector3<T>> for TVector3<T> where
    T: Div<Output = T>, 
[src]

type Output = Self

The resulting type after applying the / operator.

impl<T> DivAssign<T> for TVector3<T> where
    T: DivAssign + Copy
[src]

impl<T> DivAssign<TVector3<T>> for TVector3<T> where
    T: DivAssign
[src]

impl<T> From<TQuaternion<T>> for TVector3<T>[src]

impl<T> From<TVector2<T>> for TVector3<T> where
    T: Zero<T>, 
[src]

impl<T> From<TVector3<T>> for TVector2<T>[src]

impl<T> From<TVector3<T>> for TVector4<T> where
    T: Zero<T>, 
[src]

impl<T> From<TVector4<T>> for TVector3<T>[src]

impl<T> Index<usize> for TVector3<T>[src]

type Output = T

The returned type after indexing.

impl<T> IndexMut<usize> for TVector3<T>[src]

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

type Output = Self

The resulting type after applying the * operator.

impl<T> Mul<TVector3<T>> for TVector3<T> where
    T: Mul<Output = T>, 
[src]

type Output = Self

The resulting type after applying the * operator.

impl<T> MulAssign<T> for TVector3<T> where
    T: MulAssign + Copy
[src]

impl<T> MulAssign<TVector3<T>> for TVector3<T> where
    T: MulAssign
[src]

impl<T> Neg for TVector3<T> where
    T: Neg<Output = T>, 
[src]

type Output = Self

The resulting type after applying the - operator.

impl<T> PartialEq<TVector3<T>> for TVector3<T> where
    T: PartialEq
[src]

impl<T> Rem<T> for TVector3<T> where
    T: Rem<Output = T> + Copy
[src]

type Output = Self

The resulting type after applying the % operator.

impl<T> Rem<TVector3<T>> for TVector3<T> where
    T: Rem<Output = T>, 
[src]

type Output = Self

The resulting type after applying the % operator.

impl<T> RemAssign<T> for TVector3<T> where
    T: RemAssign + Copy
[src]

impl<T> RemAssign<TVector3<T>> for TVector3<T> where
    T: RemAssign
[src]

impl<T> Shl<T> for TVector3<T> where
    T: Shl<Output = T> + Copy
[src]

type Output = Self

The resulting type after applying the << operator.

impl<T> Shl<TVector3<T>> for TVector3<T> where
    T: Shl<Output = T>, 
[src]

type Output = Self

The resulting type after applying the << operator.

impl<T> ShlAssign<T> for TVector3<T> where
    T: ShlAssign + Copy
[src]

impl<T> ShlAssign<TVector3<T>> for TVector3<T> where
    T: ShlAssign
[src]

impl<T> Shr<T> for TVector3<T> where
    T: Shr<Output = T> + Copy
[src]

type Output = Self

The resulting type after applying the >> operator.

impl<T> Shr<TVector3<T>> for TVector3<T> where
    T: Shr<Output = T>, 
[src]

type Output = Self

The resulting type after applying the >> operator.

impl<T> ShrAssign<T> for TVector3<T> where
    T: ShrAssign + Copy
[src]

impl<T> ShrAssign<TVector3<T>> for TVector3<T> where
    T: ShrAssign
[src]

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

type Output = Self

The resulting type after applying the - operator.

impl<T> Sub<TVector3<T>> for TVector3<T> where
    T: Sub<Output = T>, 
[src]

type Output = Self

The resulting type after applying the - operator.

impl<T> SubAssign<T> for TVector3<T> where
    T: SubAssign + Copy
[src]

impl<T> SubAssign<TVector3<T>> for TVector3<T> where
    T: SubAssign
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for TVector3<T> where
    T: RefUnwindSafe

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

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

impl<T> Unpin for TVector3<T> where
    T: Unpin

impl<T> UnwindSafe for TVector3<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.