TVec3

Struct TVec3 

Source
#[repr(align(16))]
pub struct TVec3<T: Real> { /* private fields */ }
Expand description

A generic 3 component vector

Implementations§

Source§

impl<T: Real> TVec3<T>

Source

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

Constructs a new Vec3

Source

pub fn zero() -> Self

Return a vector with all zeroes

Source

pub fn one() -> Self

Return a vector with all ones

Source

pub fn up() -> Self

Return a unit vector that points in the up direction

Source

pub fn down() -> Self

Return a unit vector that points in the down direction

Source

pub fn right() -> Self

Return a unit vector that points in the right direction

Source

pub fn left() -> Self

Return a unit vector that points in the left direction

Source

pub fn forward() -> Self

Return a unit vector that points in the forward direction

Source

pub fn back() -> Self

Return a unit vector that points in the back direction

Trait Implementations§

Source§

impl<T: Real> Add<T> for TVec3<T>

Source§

type Output = TVec3<T>

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<T: Real> Add for TVec3<T>

Source§

type Output = TVec3<T>

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<T: Real> AddAssign<T> for TVec3<T>

Source§

fn add_assign(&mut self, rhs: T)

Performs the += operation. Read more
Source§

impl<T: Real> AddAssign for TVec3<T>

Source§

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

Performs the += operation. Read more
Source§

impl<T: Clone + Real> Clone for TVec3<T>

Source§

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

Returns a duplicate 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: Real> CrossProduct for TVec3<T>

Source§

fn cross(&self, rhs: &Self) -> Self

Produce the cross product of self and rhs Read more
Source§

impl<T: Debug + Real> Debug for TVec3<T>

Source§

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

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

impl<T: Real> Display for TVec3<T>

Source§

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

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

impl<T: Real> Div<T> for TVec3<T>

Source§

type Output = TVec3<T>

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl<T: Real> Div for TVec3<T>

Source§

type Output = TVec3<T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: TVec3<T>) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: Real> DivAssign<T> for TVec3<T>

Source§

fn div_assign(&mut self, rhs: T)

Performs the /= operation. Read more
Source§

impl<T: Real> DivAssign for TVec3<T>

Source§

fn div_assign(&mut self, rhs: TVec3<T>)

Performs the /= operation. Read more
Source§

impl<T: Real> DotProduct<T> for TVec3<T>

Source§

fn dot(&self, rhs: &Self) -> T

Produce the dot product of self and rhs
Source§

impl<T: Real> From<[T; 3]> for TVec3<T>

Source§

fn from(other: [T; 3]) -> Self

Take the array as a vector

Source§

impl<T: Real> From<(T, T, T)> for TVec3<T>

Source§

fn from(other: (T, T, T)) -> Self

Take the array as a vector

Source§

impl<T: Real> From<T> for TVec3<T>

Source§

fn from(other: T) -> Self

Converts to this type from the input type.
Source§

impl<T: Real> From<TVec2<T>> for TVec3<T>

Source§

fn from(other: TVec2<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Real> From<TVec3<T>> for TVec2<T>

Source§

fn from(other: TVec3<T>) -> Self

Take the xy components of a Vec3 and produce a Vec2

Source§

impl<T: Real> From<TVec3<T>> for TVec3P<T>

Source§

fn from(other: TVec3<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Real> From<TVec3<T>> for TVec4<T>

Source§

fn from(other: TVec3<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Real> From<TVec4<T>> for TVec3<T>

Source§

fn from(other: TVec4<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Real> Index<usize> for TVec3<T>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

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

impl<T: Real> IndexMut<usize> for TVec3<T>

Source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

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

impl<T: Real> Into<[T; 3]> for TVec3<T>

Source§

fn into(self) -> [T; 3]

Converts this type into the (usually inferred) input type.
Source§

impl<T: Real> Into<(T, T, T)> for TVec3<T>

Source§

fn into(self) -> (T, T, T)

Converts this type into the (usually inferred) input type.
Source§

impl<T: Real> IntoDegrees for TVec3<T>

Source§

fn into_degrees(self) -> Self

Consume self and return it after converting the internal elements from radians to degrees
Source§

impl<T: Real> IntoRadians for TVec3<T>

Source§

fn into_radians(self) -> Self

Consume self and return it after converting the internal elements from degrees to radians
Source§

impl<T: Real> IntoSTD140 for TVec3<T>

Source§

type Output = TVec3P<T>

Source§

fn into_std140(self) -> Self::Output

Source§

impl<T: Real> Length for TVec3<T>

Source§

type Output = T

Source§

fn length(&self) -> Self::Output

Source§

impl<T: Real> LengthSquared for TVec3<T>

Source§

type Output = T

Source§

fn length_squared(&self) -> Self::Output

Source§

impl<T: Real> Lerp<T> for TVec3<T>

Source§

fn lerp(&self, b: &Self, factor: T) -> Self

Return the result of interpolating between self and b with factor factor
Source§

impl<T: Real> Mul<T> for TVec3<T>

Source§

type Output = TVec3<T>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<T: Real> Mul<TVec3<T>> for TQuat<T>

Source§

type Output = TVec3<T>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<T: Real> Mul for TVec3<T>

Source§

type Output = TVec3<T>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<T: Real> MulAssign<T> for TVec3<T>

Source§

fn mul_assign(&mut self, rhs: T)

Performs the *= operation. Read more
Source§

impl<T: Real> MulAssign for TVec3<T>

Source§

fn mul_assign(&mut self, rhs: TVec3<T>)

Performs the *= operation. Read more
Source§

impl<T: Real> Neg for TVec3<T>

Source§

type Output = TVec3<T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<T: Real> Normalize for TVec3<T>

Source§

fn normalize(self) -> Self

Source§

impl<T: Real> NormalizeAssign for TVec3<T>

Source§

impl<T: Real> PartialEq for TVec3<T>

Source§

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

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

fn ne(&self, other: &TVec3<T>) -> bool

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

impl<T: Real> Sub<T> for TVec3<T>

Source§

type Output = TVec3<T>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<T: Real> Sub for TVec3<T>

Source§

type Output = TVec3<T>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<T: Real> SubAssign<T> for TVec3<T>

Source§

fn sub_assign(&mut self, rhs: T)

Performs the -= operation. Read more
Source§

impl<T: Real> SubAssign for TVec3<T>

Source§

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

Performs the -= operation. Read more
Source§

impl<T: Copy + Real> Copy for TVec3<T>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<T> UnwindSafe for TVec3<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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.