vec3

Struct vec3 

Source
pub struct vec3<T>(pub T, pub T, pub T);

Tuple Fields§

§0: T§1: T§2: T

Implementations§

Source§

impl<T> vec3<T>

Source

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

Source

pub fn x(&self) -> &T

Source

pub fn y(&self) -> &T

Source

pub fn z(&self) -> &T

Source

pub fn xy(&self) -> (&T, &T)

Source

pub fn yx(&self) -> (&T, &T)

Source

pub fn xz(&self) -> (&T, &T)

Source

pub fn zx(&self) -> (&T, &T)

Source

pub fn yz(&self) -> (&T, &T)

Source

pub fn zy(&self) -> (&T, &T)

Source

pub fn xyz(&self) -> (&T, &T, &T)

Source

pub fn zxy(&self) -> (&T, &T, &T)

Source

pub fn yzx(&self) -> (&T, &T, &T)

Source

pub fn yxz(&self) -> (&T, &T, &T)

Source

pub fn zyx(&self) -> (&T, &T, &T)

Source

pub fn xzy(&self) -> (&T, &T, &T)

Source

pub fn r(&self) -> &T

Source

pub fn g(&self) -> &T

Source

pub fn b(&self) -> &T

Source

pub fn rg(&self) -> (&T, &T)

Source

pub fn gr(&self) -> (&T, &T)

Source

pub fn rb(&self) -> (&T, &T)

Source

pub fn br(&self) -> (&T, &T)

Source

pub fn rgb(&self) -> (&T, &T, &T)

Source

pub fn brg(&self) -> (&T, &T, &T)

Source

pub fn gbr(&self) -> (&T, &T, &T)

Source

pub fn grb(&self) -> (&T, &T, &T)

Source

pub fn bgr(&self) -> (&T, &T, &T)

Source

pub fn rbg(&self) -> (&T, &T, &T)

Trait Implementations§

Source§

impl<T: Add<Output = T>> Add for vec3<T>

Source§

type Output = vec3<T>

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<T: AddAssign> AddAssign for vec3<T>

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl<T: TBytes + Clone> Clone for vec3<T>

Source§

fn clone(&self) -> Self

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: TBytes + Debug> Debug for vec3<T>

Source§

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

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

impl<T: Div<Output = T>> Div for vec3<T>

Source§

type Output = vec3<T>

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl<T: DivAssign> DivAssign for vec3<T>

Source§

fn div_assign(&mut self, rhs: Self)

Performs the /= operation. Read more
Source§

impl<T: Clone> From<(&T, &T, &T)> for vec3<T>

Source§

fn from(value: (&T, &T, &T)) -> Self

Converts to this type from the input type.
Source§

impl<T> From<(T, T, T)> for vec3<T>

Source§

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

Converts to this type from the input type.
Source§

impl<T: Clone> From<T> for vec3<T>

Source§

fn from(value: T) -> Self

Converts to this type from the input type.
Source§

impl<T: Mul<Output = T>> Mul for vec3<T>

Source§

type Output = vec3<T>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<T: MulAssign> MulAssign for vec3<T>

Source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
Source§

impl<T: Sub<Output = T>> Sub for vec3<T>

Source§

type Output = vec3<T>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<T: SubAssign> SubAssign for vec3<T>

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl<T> TBytes for vec3<T>
where T: TBytes,

Source§

fn size(&self) -> usize

Source§

fn to_bytes(&self) -> Vec<u8>

Source§

fn from_bytes(bytes: &mut Vec<u8>) -> Option<Self>

Source§

fn from_bytes_ref(buffer: &[u8]) -> Option<Self>
where Self: Sized,

Source§

impl<T: TBytes + Copy> Copy for vec3<T>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<T> UnwindSafe for vec3<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<!> for T

Source§

fn from(t: !) -> T

Converts to this type from the input type.
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.