Skip to main content

QVec3

Struct QVec3 

Source
pub struct QVec3<const L: i8, const M: i8, const T: i8, const I: i8, const K: i8, const N: i8, const J: i8>(/* private fields */);
Expand description

Three components of one dimension, stored in SI base units.

Implementations§

Source§

impl<const L: i8, const M: i8, const T: i8, const I: i8, const K: i8, const N: i8, const J: i8> QVec3<L, M, T, I, K, N, J>

Source

pub const ZERO: QVec3<L, M, T, I, K, N, J>

The zero vector, in whatever dimension this is.

Source

pub fn from_si(v: DVec3) -> QVec3<L, M, T, I, K, N, J>

Wrap a vector already in SI base units.

Source

pub fn to_si(self) -> DVec3

The components in SI base units.

Source

pub fn new( x: Qty<L, M, T, I, K, N, J>, y: Qty<L, M, T, I, K, N, J>, z: Qty<L, M, T, I, K, N, J>, ) -> QVec3<L, M, T, I, K, N, J>

From three quantities of the same dimension.

Source

pub fn splat(v: Qty<L, M, T, I, K, N, J>) -> QVec3<L, M, T, I, K, N, J>

The same quantity in all three components.

Source

pub fn x(self) -> Qty<L, M, T, I, K, N, J>

The x component, carrying the dimension with it.

Source

pub fn y(self) -> Qty<L, M, T, I, K, N, J>

The y component, carrying the dimension with it.

Source

pub fn z(self) -> Qty<L, M, T, I, K, N, J>

The z component, carrying the dimension with it.

Source

pub fn length(self) -> Qty<L, M, T, I, K, N, J>

Magnitude, which keeps the dimension.

Source

pub fn normalize(self) -> DVec3

Which way it points — a pure number, because a direction is a length over a length. Zero-length vectors give zero rather than a NaN.

Source

pub fn along(self, direction: DVec3) -> Qty<L, M, T, I, K, N, J>

The component along a unit direction. Projection does not change the dimension, which is why this one is expressible and dot is not.

Source

pub fn perpendicular_to(self, direction: DVec3) -> QVec3<L, M, T, I, K, N, J>

The part of this vector perpendicular to a unit direction.

Source

pub fn is_finite(self) -> bool

Whether every component is neither infinite nor NaN.

Source

pub fn lerp( self, other: QVec3<L, M, T, I, K, N, J>, t: f64, ) -> QVec3<L, M, T, I, K, N, J>

Straight-line interpolation, t = 0 here and t = 1 there.

Not clamped, so t outside the unit interval extrapolates. Useful for a strobe sampling between two recorded states, and wrong for anything that should not leave the segment.

Source§

impl QVec3<1, 0, 0, 0, 0, 0, 0>

Source

pub fn mm(x: f64, y: f64, z: f64) -> QVec3<1, 0, 0, 0, 0, 0, 0>

Millimetres.

Source

pub fn m(x: f64, y: f64, z: f64) -> QVec3<1, 0, 0, 0, 0, 0, 0>

Metres.

Source

pub fn in_mm(self) -> DVec3

As millimetres.

Source§

impl QVec3<1, 0, -1, 0, 0, 0, 0>

Source

pub fn mm_per_s(x: f64, y: f64, z: f64) -> QVec3<1, 0, -1, 0, 0, 0, 0>

Millimetres per second.

Source

pub fn m_per_s(x: f64, y: f64, z: f64) -> QVec3<1, 0, -1, 0, 0, 0, 0>

Metres per second.

Trait Implementations§

Source§

impl<const L: i8, const M: i8, const T: i8, const I: i8, const K: i8, const N: i8, const J: i8> Add for QVec3<L, M, T, I, K, N, J>

Source§

type Output = QVec3<L, M, T, I, K, N, J>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: QVec3<L, M, T, I, K, N, J>) -> QVec3<L, M, T, I, K, N, J>

Performs the + operation. Read more
Source§

impl<const L: i8, const M: i8, const T: i8, const I: i8, const K: i8, const N: i8, const J: i8> AddAssign for QVec3<L, M, T, I, K, N, J>

Source§

fn add_assign(&mut self, rhs: QVec3<L, M, T, I, K, N, J>)

Performs the += operation. Read more
Source§

impl<const L: i8, const M: i8, const T: i8, const I: i8, const K: i8, const N: i8, const J: i8> Clone for QVec3<L, M, T, I, K, N, J>

Source§

fn clone(&self) -> QVec3<L, M, T, I, K, N, J>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<const L: i8, const M: i8, const T: i8, const I: i8, const K: i8, const N: i8, const J: i8> Copy for QVec3<L, M, T, I, K, N, J>

Source§

impl<const L: i8, const M: i8, const T: i8, const I: i8, const K: i8, const N: i8, const J: i8> Debug for QVec3<L, M, T, I, K, N, J>

Source§

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

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

impl<const L: i8, const M: i8, const T: i8, const I: i8, const K: i8, const N: i8, const J: i8> Default for QVec3<L, M, T, I, K, N, J>

Source§

fn default() -> QVec3<L, M, T, I, K, N, J>

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

impl<'de, const L: i8, const M: i8, const T: i8, const I: i8, const K: i8, const N: i8, const J: i8> Deserialize<'de> for QVec3<L, M, T, I, K, N, J>

Source§

fn deserialize<D>( d: D, ) -> Result<QVec3<L, M, T, I, K, N, J>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Div<Qty<0, 0, 1, 0, 0, 0, 0>> for QVec3<1, 0, 0, 0, 0, 0, 0>

Source§

type Output = QVec3<1, 0, -1, 0, 0, 0, 0>

The resulting type after applying the / operator.
Source§

fn div(self, k: Qty<0, 0, 1, 0, 0, 0, 0>) -> QVec3<1, 0, -1, 0, 0, 0, 0>

Performs the / operation. Read more
Source§

impl Div<Qty<0, 0, 1, 0, 0, 0, 0>> for QVec3<1, 0, -1, 0, 0, 0, 0>

Source§

type Output = QVec3<1, 0, -2, 0, 0, 0, 0>

The resulting type after applying the / operator.
Source§

fn div(self, k: Qty<0, 0, 1, 0, 0, 0, 0>) -> QVec3<1, 0, -2, 0, 0, 0, 0>

Performs the / operation. Read more
Source§

impl Div<Qty<0, 0, 1, 0, 0, 0, 0>> for QVec3<1, 1, -1, 0, 0, 0, 0>

Source§

type Output = QVec3<1, 1, -2, 0, 0, 0, 0>

The resulting type after applying the / operator.
Source§

fn div(self, k: Qty<0, 0, 1, 0, 0, 0, 0>) -> QVec3<1, 1, -2, 0, 0, 0, 0>

Performs the / operation. Read more
Source§

impl Div<Qty<0, 1, 0, 0, 0, 0, 0>> for QVec3<1, 1, -1, 0, 0, 0, 0>

Source§

type Output = QVec3<1, 0, -1, 0, 0, 0, 0>

The resulting type after applying the / operator.
Source§

fn div(self, k: Qty<0, 1, 0, 0, 0, 0, 0>) -> QVec3<1, 0, -1, 0, 0, 0, 0>

Performs the / operation. Read more
Source§

impl Div<Qty<0, 1, 0, 0, 0, 0, 0>> for QVec3<1, 1, -2, 0, 0, 0, 0>

Source§

type Output = QVec3<1, 0, -2, 0, 0, 0, 0>

The resulting type after applying the / operator.
Source§

fn div(self, k: Qty<0, 1, 0, 0, 0, 0, 0>) -> QVec3<1, 0, -2, 0, 0, 0, 0>

Performs the / operation. Read more
Source§

impl Div<Qty<0, 1, -1, 0, 0, 0, 0>> for QVec3<1, 1, -2, 0, 0, 0, 0>

Source§

type Output = QVec3<1, 0, -1, 0, 0, 0, 0>

The resulting type after applying the / operator.
Source§

fn div(self, k: Qty<0, 1, -1, 0, 0, 0, 0>) -> QVec3<1, 0, -1, 0, 0, 0, 0>

Performs the / operation. Read more
Source§

impl Div<Qty<0, 1, -2, 0, 0, 0, 0>> for QVec3<1, 1, -2, 0, 0, 0, 0>

Source§

type Output = QVec3<1, 0, 0, 0, 0, 0, 0>

The resulting type after applying the / operator.
Source§

fn div(self, k: Qty<0, 1, -2, 0, 0, 0, 0>) -> QVec3<1, 0, 0, 0, 0, 0, 0>

Performs the / operation. Read more
Source§

impl<const L: i8, const M: i8, const T: i8, const I: i8, const K: i8, const N: i8, const J: i8> Div<f64> for QVec3<L, M, T, I, K, N, J>

Source§

type Output = QVec3<L, M, T, I, K, N, J>

The resulting type after applying the / operator.
Source§

fn div(self, k: f64) -> QVec3<L, M, T, I, K, N, J>

Performs the / operation. Read more
Source§

impl Mul<QVec3<1, 0, 0, 0, 0, 0, 0>> for Qty<0, 1, -2, 0, 0, 0, 0>

Source§

type Output = QVec3<1, 1, -2, 0, 0, 0, 0>

The resulting type after applying the * operator.
Source§

fn mul(self, v: QVec3<1, 0, 0, 0, 0, 0, 0>) -> QVec3<1, 1, -2, 0, 0, 0, 0>

Performs the * operation. Read more
Source§

impl Mul<QVec3<1, 0, -1, 0, 0, 0, 0>> for Qty<0, 0, 1, 0, 0, 0, 0>

Source§

type Output = QVec3<1, 0, 0, 0, 0, 0, 0>

The resulting type after applying the * operator.
Source§

fn mul(self, v: QVec3<1, 0, -1, 0, 0, 0, 0>) -> QVec3<1, 0, 0, 0, 0, 0, 0>

Performs the * operation. Read more
Source§

impl Mul<QVec3<1, 0, -1, 0, 0, 0, 0>> for Qty<0, 1, 0, 0, 0, 0, 0>

Source§

type Output = QVec3<1, 1, -1, 0, 0, 0, 0>

The resulting type after applying the * operator.
Source§

fn mul(self, v: QVec3<1, 0, -1, 0, 0, 0, 0>) -> QVec3<1, 1, -1, 0, 0, 0, 0>

Performs the * operation. Read more
Source§

impl Mul<QVec3<1, 0, -1, 0, 0, 0, 0>> for Qty<0, 1, -1, 0, 0, 0, 0>

Source§

type Output = QVec3<1, 1, -2, 0, 0, 0, 0>

The resulting type after applying the * operator.
Source§

fn mul(self, v: QVec3<1, 0, -1, 0, 0, 0, 0>) -> QVec3<1, 1, -2, 0, 0, 0, 0>

Performs the * operation. Read more
Source§

impl Mul<QVec3<1, 0, -2, 0, 0, 0, 0>> for Qty<0, 0, 1, 0, 0, 0, 0>

Source§

type Output = QVec3<1, 0, -1, 0, 0, 0, 0>

The resulting type after applying the * operator.
Source§

fn mul(self, v: QVec3<1, 0, -2, 0, 0, 0, 0>) -> QVec3<1, 0, -1, 0, 0, 0, 0>

Performs the * operation. Read more
Source§

impl Mul<QVec3<1, 0, -2, 0, 0, 0, 0>> for Qty<0, 1, 0, 0, 0, 0, 0>

Source§

type Output = QVec3<1, 1, -2, 0, 0, 0, 0>

The resulting type after applying the * operator.
Source§

fn mul(self, v: QVec3<1, 0, -2, 0, 0, 0, 0>) -> QVec3<1, 1, -2, 0, 0, 0, 0>

Performs the * operation. Read more
Source§

impl Mul<QVec3<1, 1, -2, 0, 0, 0, 0>> for Qty<0, 0, 1, 0, 0, 0, 0>

Source§

type Output = QVec3<1, 1, -1, 0, 0, 0, 0>

The resulting type after applying the * operator.
Source§

fn mul(self, v: QVec3<1, 1, -2, 0, 0, 0, 0>) -> QVec3<1, 1, -1, 0, 0, 0, 0>

Performs the * operation. Read more
Source§

impl Mul<Qty<0, 0, 1, 0, 0, 0, 0>> for QVec3<1, 0, -1, 0, 0, 0, 0>

Source§

type Output = QVec3<1, 0, 0, 0, 0, 0, 0>

The resulting type after applying the * operator.
Source§

fn mul(self, k: Qty<0, 0, 1, 0, 0, 0, 0>) -> QVec3<1, 0, 0, 0, 0, 0, 0>

Performs the * operation. Read more
Source§

impl Mul<Qty<0, 0, 1, 0, 0, 0, 0>> for QVec3<1, 0, -2, 0, 0, 0, 0>

Source§

type Output = QVec3<1, 0, -1, 0, 0, 0, 0>

The resulting type after applying the * operator.
Source§

fn mul(self, k: Qty<0, 0, 1, 0, 0, 0, 0>) -> QVec3<1, 0, -1, 0, 0, 0, 0>

Performs the * operation. Read more
Source§

impl Mul<Qty<0, 0, 1, 0, 0, 0, 0>> for QVec3<1, 1, -2, 0, 0, 0, 0>

Source§

type Output = QVec3<1, 1, -1, 0, 0, 0, 0>

The resulting type after applying the * operator.
Source§

fn mul(self, k: Qty<0, 0, 1, 0, 0, 0, 0>) -> QVec3<1, 1, -1, 0, 0, 0, 0>

Performs the * operation. Read more
Source§

impl Mul<Qty<0, 1, 0, 0, 0, 0, 0>> for QVec3<1, 0, -1, 0, 0, 0, 0>

Source§

type Output = QVec3<1, 1, -1, 0, 0, 0, 0>

The resulting type after applying the * operator.
Source§

fn mul(self, k: Qty<0, 1, 0, 0, 0, 0, 0>) -> QVec3<1, 1, -1, 0, 0, 0, 0>

Performs the * operation. Read more
Source§

impl Mul<Qty<0, 1, 0, 0, 0, 0, 0>> for QVec3<1, 0, -2, 0, 0, 0, 0>

Source§

type Output = QVec3<1, 1, -2, 0, 0, 0, 0>

The resulting type after applying the * operator.
Source§

fn mul(self, k: Qty<0, 1, 0, 0, 0, 0, 0>) -> QVec3<1, 1, -2, 0, 0, 0, 0>

Performs the * operation. Read more
Source§

impl Mul<Qty<0, 1, -1, 0, 0, 0, 0>> for QVec3<1, 0, -1, 0, 0, 0, 0>

Source§

type Output = QVec3<1, 1, -2, 0, 0, 0, 0>

The resulting type after applying the * operator.
Source§

fn mul(self, k: Qty<0, 1, -1, 0, 0, 0, 0>) -> QVec3<1, 1, -2, 0, 0, 0, 0>

Performs the * operation. Read more
Source§

impl Mul<Qty<0, 1, -2, 0, 0, 0, 0>> for QVec3<1, 0, 0, 0, 0, 0, 0>

Source§

type Output = QVec3<1, 1, -2, 0, 0, 0, 0>

The resulting type after applying the * operator.
Source§

fn mul(self, k: Qty<0, 1, -2, 0, 0, 0, 0>) -> QVec3<1, 1, -2, 0, 0, 0, 0>

Performs the * operation. Read more
Source§

impl<const L: i8, const M: i8, const T: i8, const I: i8, const K: i8, const N: i8, const J: i8> Mul<f64> for QVec3<L, M, T, I, K, N, J>

Source§

type Output = QVec3<L, M, T, I, K, N, J>

The resulting type after applying the * operator.
Source§

fn mul(self, k: f64) -> QVec3<L, M, T, I, K, N, J>

Performs the * operation. Read more
Source§

impl<const L: i8, const M: i8, const T: i8, const I: i8, const K: i8, const N: i8, const J: i8> Neg for QVec3<L, M, T, I, K, N, J>

Source§

type Output = QVec3<L, M, T, I, K, N, J>

The resulting type after applying the - operator.
Source§

fn neg(self) -> QVec3<L, M, T, I, K, N, J>

Performs the unary - operation. Read more
Source§

impl<const L: i8, const M: i8, const T: i8, const I: i8, const K: i8, const N: i8, const J: i8> PartialEq for QVec3<L, M, T, I, K, N, J>

Source§

fn eq(&self, other: &QVec3<L, M, T, I, K, N, J>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<const L: i8, const M: i8, const T: i8, const I: i8, const K: i8, const N: i8, const J: i8> Serialize for QVec3<L, M, T, I, K, N, J>

Source§

fn serialize<S>( &self, s: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<const L: i8, const M: i8, const T: i8, const I: i8, const K: i8, const N: i8, const J: i8> StructuralPartialEq for QVec3<L, M, T, I, K, N, J>

Source§

impl<const L: i8, const M: i8, const T: i8, const I: i8, const K: i8, const N: i8, const J: i8> Sub for QVec3<L, M, T, I, K, N, J>

Source§

type Output = QVec3<L, M, T, I, K, N, J>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: QVec3<L, M, T, I, K, N, J>) -> QVec3<L, M, T, I, K, N, J>

Performs the - operation. Read more
Source§

impl<const L: i8, const M: i8, const T: i8, const I: i8, const K: i8, const N: i8, const J: i8> SubAssign for QVec3<L, M, T, I, K, N, J>

Source§

fn sub_assign(&mut self, rhs: QVec3<L, M, T, I, K, N, J>)

Performs the -= operation. Read more

Auto Trait Implementations§

§

impl<const L: i8, const M: i8, const T: i8, const I: i8, const K: i8, const N: i8, const J: i8> Freeze for QVec3<L, M, T, I, K, N, J>

§

impl<const L: i8, const M: i8, const T: i8, const I: i8, const K: i8, const N: i8, const J: i8> RefUnwindSafe for QVec3<L, M, T, I, K, N, J>

§

impl<const L: i8, const M: i8, const T: i8, const I: i8, const K: i8, const N: i8, const J: i8> Send for QVec3<L, M, T, I, K, N, J>

§

impl<const L: i8, const M: i8, const T: i8, const I: i8, const K: i8, const N: i8, const J: i8> Sync for QVec3<L, M, T, I, K, N, J>

§

impl<const L: i8, const M: i8, const T: i8, const I: i8, const K: i8, const N: i8, const J: i8> Unpin for QVec3<L, M, T, I, K, N, J>

§

impl<const L: i8, const M: i8, const T: i8, const I: i8, const K: i8, const N: i8, const J: i8> UnsafeUnpin for QVec3<L, M, T, I, K, N, J>

§

impl<const L: i8, const M: i8, const T: i8, const I: i8, const K: i8, const N: i8, const J: i8> UnwindSafe for QVec3<L, M, T, I, K, N, J>

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.