[][src]Struct rg3d_core::math::vec3::Vec3

pub struct Vec3 {
    pub x: f32,
    pub y: f32,
    pub z: f32,
}

Fields

x: f32y: f32z: f32

Methods

impl Vec3[src]

pub const ZERO: Self[src]

pub const UNIT: Self[src]

pub const RIGHT: Self[src]

pub const UP: Self[src]

pub const LOOK: Self[src]

pub fn new(x: f32, y: f32, z: f32) -> Self[src]

pub fn scale(&self, scalar: f32) -> Self[src]

pub fn sqr_len(&self) -> f32[src]

pub fn len(&self) -> f32[src]

pub fn dot(&self, b: &Self) -> f32[src]

pub fn cross(&self, b: &Self) -> Self[src]

pub fn normalized(&self) -> Option<Self>[src]

pub fn normalized_ex(&self) -> (Option<Self>, f32)[src]

Returns normalized vector and its original length. May fail if vector is degenerate.

pub fn normalized_unchecked(&self) -> Self[src]

pub fn lerp(&self, other: &Self, t: f32) -> Self[src]

pub fn distance(&self, other: &Self) -> f32[src]

pub fn sqr_distance(&self, other: &Self) -> f32[src]

pub fn is_same_direction_as(&self, other: &Self) -> bool[src]

pub fn min_value(&self) -> f32[src]

pub fn max_value(&self) -> f32[src]

pub fn follow(&mut self, other: &Self, fraction: f32)[src]

pub fn project(&self, normal: &Self) -> Self[src]

Trait Implementations

impl Add<Vec3> for Vec3[src]

type Output = Self

The resulting type after applying the + operator.

impl AddAssign<Vec3> for Vec3[src]

impl Clone for Vec3[src]

impl Copy for Vec3[src]

impl Debug for Vec3[src]

impl Default for Vec3[src]

impl FieldData for Vec3[src]

impl Index<usize> for Vec3[src]

type Output = f32

The returned type after indexing.

impl Mul<Vec3> for Vec3[src]

type Output = Self

The resulting type after applying the * operator.

impl Neg for Vec3[src]

type Output = Self

The resulting type after applying the - operator.

impl PartialEq<Vec3> for Vec3[src]

impl StructuralPartialEq for Vec3[src]

impl Sub<Vec3> for Vec3[src]

type Output = Self

The resulting type after applying the - operator.

impl SubAssign<Vec3> for Vec3[src]

Auto Trait Implementations

impl RefUnwindSafe for Vec3

impl Send for Vec3

impl Sync for Vec3

impl Unpin for Vec3

impl UnwindSafe for Vec3

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> Visit for T where
    T: FieldData + 'static, 
[src]