Struct micromath::vector::Vector3d

source ·
pub struct Vector3d<C: Component> {
    pub x: C,
    pub y: C,
    pub z: C,
}
Available on crate feature vector only.
Expand description

3-dimensional vector

Fields§

§x: C

X component

§y: C

Y component

§z: C

Z component

Implementations§

source§

impl<C> Vector3d<C>where C: Component,

source

pub fn to_array(&self) -> [C; 3]

Return a 3-element array containing the coordinates

Trait Implementations§

source§

impl<C> Add for Vector3d<C>where C: Component,

§

type Output = Vector3d<C>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Self) -> Self

Performs the + operation. Read more
source§

impl<C> AddAssign for Vector3d<C>where C: Component,

source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
source§

impl<C: Clone + Component> Clone for Vector3d<C>

source§

fn clone(&self) -> Vector3d<C>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<C: Debug + Component> Debug for Vector3d<C>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<C: Default + Component> Default for Vector3d<C>

source§

fn default() -> Vector3d<C>

Returns the “default value” for a type. Read more
source§

impl<C> From<(C, C, C)> for Vector3d<C>where C: Component,

source§

fn from(vector: (C, C, C)) -> Self

Converts to this type from the input type.
source§

impl<C> From<Vector3d<C>> for Quaternionwhere C: Component + Into<f32>,

source§

fn from(v: Vector3d<C>) -> Quaternion

Converts to this type from the input type.
source§

impl From<Vector3d<F32>> for F32x3

source§

fn from(vector: Vector3d<F32>) -> F32x3

Converts to this type from the input type.
source§

impl From<Vector3d<i16>> for F32x3

source§

fn from(vector: I16x3) -> F32x3

Converts to this type from the input type.
source§

impl From<Vector3d<i8>> for F32x3

source§

fn from(vector: I8x3) -> F32x3

Converts to this type from the input type.
source§

impl From<Vector3d<u16>> for F32x3

source§

fn from(vector: U16x3) -> F32x3

Converts to this type from the input type.
source§

impl From<Vector3d<u8>> for F32x3

source§

fn from(vector: U8x3) -> F32x3

Converts to this type from the input type.
source§

impl<C> FromIterator<C> for Vector3d<C>where C: Component,

source§

fn from_iter<T>(into_iter: T) -> Selfwhere T: IntoIterator<Item = C>,

Creates a value from an iterator. Read more
source§

impl<C> Index<usize> for Vector3d<C>where C: Component,

§

type Output = C

The returned type after indexing.
source§

fn index(&self, i: usize) -> &C

Performs the indexing (container[index]) operation. Read more
source§

impl<C> Mul<C> for Vector3d<C>where C: Component,

Multiply vector by a scalar component

§

type Output = Vector3d<C>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: C) -> Self

Performs the * operation. Read more
source§

impl<C> Mul<Vector3d<C>> for Quaternionwhere C: Component + Into<f32>,

§

type Output = Vector3d<f32>

The resulting type after applying the * operator.
source§

fn mul(self, v: Vector3d<C>) -> F32x3

Performs the * operation. Read more
source§

impl<C> Mul for Vector3d<C>where C: Component,

Compute the cross product of two vectors

§

type Output = Vector3d<C>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Self) -> Self

Performs the * operation. Read more
source§

impl<C> MulAssign<C> for Vector3d<C>where C: Component,

source§

fn mul_assign(&mut self, rhs: C)

Performs the *= operation. Read more
source§

impl<C: PartialEq + Component> PartialEq for Vector3d<C>

source§

fn eq(&self, other: &Vector3d<C>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<C> Sub for Vector3d<C>where C: Component,

§

type Output = Vector3d<C>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Self) -> Self

Performs the - operation. Read more
source§

impl<C> SubAssign for Vector3d<C>where C: Component,

source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
source§

impl<C> Vector<C> for Vector3d<C>where C: Component,

source§

const AXES: usize = 3usize

Number of axes
source§

fn get(self, index: usize) -> Option<C>

Get the component value for a particular index
source§

fn dot(self, rhs: Self) -> C

Compute the dot product of two vectors
source§

fn from_slice(slice: &[C]) -> Self

Instantiate a vector from a slice of components. Read more
source§

fn iter(&self) -> Iter<'_, Self, C>

Iterate over the components of this vector
source§

impl<C: Copy + Component> Copy for Vector3d<C>

source§

impl<C: Component> StructuralPartialEq for Vector3d<C>

Auto Trait Implementations§

§

impl<C> RefUnwindSafe for Vector3d<C>where C: RefUnwindSafe,

§

impl<C> Send for Vector3d<C>

§

impl<C> Sync for Vector3d<C>

§

impl<C> Unpin for Vector3d<C>where C: Unpin,

§

impl<C> UnwindSafe for Vector3d<C>where C: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.