[][src]Struct ezcgmath::vector::Vector3

#[repr(C)]pub struct Vector3 {
    pub x: Scalar,
    pub y: Scalar,
    pub z: Scalar,
}

A 3-dimensional vector

Fields

x: Scalary: Scalarz: Scalar

Implementations

impl Vector3[src]

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

Creates a new instance of a Vector3 with values (x, y, z).

pub const fn unit_x() -> Self[src]

Returns a vector of (1.0, 0.0, 0.0).

pub const fn unit_y() -> Self[src]

Returns a vector of (0.0, 1.0, 0.0).

pub const fn unit_z() -> Self[src]

Returns a vector of (0.0, 0.0, 1.0).

pub fn dot(&self, rhs: &Vector3) -> Scalar[src]

Returns the dot product of the vector with the vector 'rhs'.

pub fn cross(&self, rhs: &Vector3) -> Vector3[src]

Returns the cross product of the vector with the vector 'rhs'.

pub fn length(&mut self) -> Scalar[src]

The length of the vector.

pub fn normalize(&mut self)[src]

Normalizes the vector to a length of one.

Trait Implementations

impl AbsDiffEq<Vector3> for Vector3[src]

type Epsilon = Scalar

Used for specifying relative comparisons.

impl Add<Vector3> for Vector3[src]

type Output = Self

The resulting type after applying the + operator.

impl AddAssign<Vector3> for Vector3[src]

impl Clone for Vector3[src]

impl Copy for Vector3[src]

impl Debug for Vector3[src]

impl Default for Vector3[src]

impl Div<f32> for Vector3[src]

type Output = Self

The resulting type after applying the / operator.

impl DivAssign<f32> for Vector3[src]

impl From<Vector3> for Vector4[src]

impl From<Vector4> for Vector3[src]

impl Mul<Matrix3x3> for Vector3[src]

type Output = Vector3

The resulting type after applying the * operator.

impl Mul<Matrix4x4> for Vector3[src]

type Output = Vector3

The resulting type after applying the * operator.

impl Mul<Quaternion> for Vector3[src]

type Output = Vector3

The resulting type after applying the * operator.

impl Mul<f32> for Vector3[src]

type Output = Self

The resulting type after applying the * operator.

impl MulAssign<Matrix3x3> for Vector3[src]

impl MulAssign<Matrix4x4> for Vector3[src]

impl MulAssign<Quaternion> for Vector3[src]

impl MulAssign<f32> for Vector3[src]

impl Neg for Vector3[src]

type Output = Self

The resulting type after applying the - operator.

impl PartialEq<Vector3> for Vector3[src]

impl RelativeEq<Vector3> for Vector3[src]

impl StructuralPartialEq for Vector3[src]

impl Sub<Vector3> for Vector3[src]

type Output = Self

The resulting type after applying the - operator.

impl SubAssign<Vector3> for Vector3[src]

impl UlpsEq<Vector3> for Vector3[src]

Auto Trait Implementations

impl RefUnwindSafe for Vector3

impl Send for Vector3

impl Sync for Vector3

impl Unpin for Vector3

impl UnwindSafe for Vector3

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.