Struct freya_engine::prelude::V3

#[repr(C)]
pub struct V3 { pub x: f32, pub y: f32, pub z: f32, }

Fields§

§x: f32§y: f32§z: f32

Implementations§

§

impl V3

pub const fn new(x: f32, y: f32, z: f32) -> V3

pub fn dot(&self, b: &V3) -> f32

pub fn cross(&self, b: &V3) -> V3

pub fn normalize(&self) -> V3

pub fn length_squared(&self) -> f32

pub fn length(&self) -> f32

pub fn as_array(&self) -> &[f32; 3]

pub fn as_mut_array(&mut self) -> &mut [f32; 3]

Trait Implementations§

§

impl Add for V3

§

type Output = V3

The resulting type after applying the + operator.
§

fn add(self, v: V3) -> <V3 as Add>::Output

Performs the + operation. Read more
§

impl AddAssign for V3

§

fn add_assign(&mut self, v: V3)

Performs the += operation. Read more
§

impl Clone for V3

§

fn clone(&self) -> V3

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
§

impl Debug for V3

§

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

Formats the value using the given formatter. Read more
§

impl Default for V3

§

fn default() -> V3

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

impl Mul<V3> for &M44

§

type Output = V3

The resulting type after applying the * operator.
§

fn mul(self, v: V3) -> <&M44 as Mul<V3>>::Output

Performs the * operation. Read more
§

impl Mul<f32> for V3

§

type Output = V3

The resulting type after applying the * operator.
§

fn mul(self, s: f32) -> <V3 as Mul<f32>>::Output

Performs the * operation. Read more
§

impl Mul for V3

§

type Output = V3

The resulting type after applying the * operator.
§

fn mul(self, v: V3) -> <V3 as Mul>::Output

Performs the * operation. Read more
§

impl MulAssign<f32> for V3

§

fn mul_assign(&mut self, s: f32)

Performs the *= operation. Read more
§

impl MulAssign for V3

§

fn mul_assign(&mut self, v: V3)

Performs the *= operation. Read more
§

impl Neg for V3

§

type Output = V3

The resulting type after applying the - operator.
§

fn neg(self) -> <V3 as Neg>::Output

Performs the unary - operation. Read more
§

impl PartialEq for V3

§

fn eq(&self, other: &V3) -> 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.
§

impl Sub for V3

§

type Output = V3

The resulting type after applying the - operator.
§

fn sub(self, v: V3) -> <V3 as Sub>::Output

Performs the - operation. Read more
§

impl SubAssign for V3

§

fn sub_assign(&mut self, v: V3)

Performs the -= operation. Read more
§

impl Copy for V3

§

impl StructuralPartialEq for V3

Auto Trait Implementations§

§

impl Freeze for V3

§

impl RefUnwindSafe for V3

§

impl Send for V3

§

impl Sync for V3

§

impl Unpin for V3

§

impl UnwindSafe for V3

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> 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.

§

impl<N, T> NativeTransmutableWrapper<N> for T
where T: NativeTransmutable<N>,

§

fn wrap(native: N) -> T

§

fn unwrap(self) -> N

§

fn inner(&self) -> &N

§

fn inner_mut(&mut self) -> &mut N

source§

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

§

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>,

§

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>,

§

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.