Struct Vector3

Source
#[repr(C)]
pub struct Vector3<T: Float> { pub x: T, pub y: T, pub z: T, }

Fields§

§x: T§y: T§z: T

Implementations§

Source§

impl<T: Float> Vector3<T>

Source

pub fn new(x: T, y: T, z: T) -> Vector3<T>

Source

pub fn dot(a: &Vector3<T>, b: &Vector3<T>) -> T

Source

pub fn length(v: &Vector3<T>) -> T

Source

pub fn normalize(v: &Vector3<T>) -> Vector3<T>

Source§

impl<T: Float> Vector3<T>

Source

pub fn cross(a: &Vector3<T>, b: &Vector3<T>) -> Vector3<T>

Trait Implementations§

Source§

impl<T> AbsDiffEq for Vector3<T>
where T::Epsilon: Copy, T: Float + AbsDiffEq,

Source§

type Epsilon = <T as AbsDiffEq>::Epsilon

Used for specifying relative comparisons.
Source§

fn default_epsilon() -> T::Epsilon

The default tolerance to use when testing values that are close together. Read more
Source§

fn abs_diff_eq(&self, other: &Self, epsilon: T::Epsilon) -> bool

A test for equality that uses the absolute difference to compute the approximate equality of two numbers.
Source§

fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool

The inverse of ApproxEq::abs_diff_eq.
Source§

impl<T: Float> Add for Vector3<T>

Source§

type Output = Vector3<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Vector3<T>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: Float> AddAssign for Vector3<T>

Source§

fn add_assign(&mut self, rhs: Vector3<T>)

Performs the += operation. Read more
Source§

impl<T: Clone + Float> Clone for Vector3<T>

Source§

fn clone(&self) -> Vector3<T>

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<T: Debug + Float> Debug for Vector3<T>

Source§

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

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

impl<T: Float> Mul<T> for Vector3<T>

Source§

type Output = Vector3<T>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<T: Float> Mul<Vector3<T>> for Matrix3<T>

Source§

type Output = Vector3<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<T>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: Float> MulAssign<T> for Vector3<T>

Source§

fn mul_assign(&mut self, rhs: T)

Performs the *= operation. Read more
Source§

impl<T: PartialEq + Float> PartialEq for Vector3<T>

Source§

fn eq(&self, other: &Vector3<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> RelativeEq for Vector3<T>
where T::Epsilon: Copy, T: Float + RelativeEq,

Source§

fn default_max_relative() -> T::Epsilon

The default relative tolerance for testing values that are far-apart. Read more
Source§

fn relative_eq( &self, other: &Self, epsilon: T::Epsilon, max_relative: T::Epsilon, ) -> bool

A test for equality that uses a relative comparison if the values are far apart.
Source§

fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool

The inverse of ApproxEq::relative_eq.
Source§

impl<T: Float> Sub for Vector3<T>

Source§

type Output = Vector3<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Vector3<T>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: Float> SubAssign for Vector3<T>

Source§

fn sub_assign(&mut self, rhs: Vector3<T>)

Performs the -= operation. Read more
Source§

impl<T> UlpsEq for Vector3<T>
where T::Epsilon: Copy, T: Float + UlpsEq,

Source§

fn default_max_ulps() -> u32

The default ULPs to tolerate when testing values that are far-apart. Read more
Source§

fn ulps_eq(&self, other: &Self, epsilon: T::Epsilon, max_ulps: u32) -> bool

A test for equality that uses units in the last place (ULP) if the values are far apart.
Source§

fn ulps_ne(&self, other: &Rhs, epsilon: Self::Epsilon, max_ulps: u32) -> bool

The inverse of ApproxEq::ulps_eq.
Source§

impl<T: Copy + Float> Copy for Vector3<T>

Source§

impl<T: Float> StructuralPartialEq for Vector3<T>

Auto Trait Implementations§

§

impl<T> Freeze for Vector3<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Vector3<T>
where T: RefUnwindSafe,

§

impl<T> Send for Vector3<T>
where T: Send,

§

impl<T> Sync for Vector3<T>
where T: Sync,

§

impl<T> Unpin for Vector3<T>
where T: Unpin,

§

impl<T> UnwindSafe for Vector3<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.