[−][src]Struct libraymarcher::Vec3
A 3 dimensional vector of f64
Fields
x: f64
y: f64
z: f64
Implementations
impl Vec3
[src]
pub fn magnitude(self) -> f64
[src]
The Euclidean norm
pub fn dot(self, other: Vec3) -> f64
[src]
Dot product with another Vec3
pub fn normalized(self) -> Self
[src]
Normalize this Vec3 so that it has a magnitude of 1
Will panic with a div by zero if the self.magnitude() is zero
pub fn reflect(self, norm: Vec3) -> Self
[src]
Reflect this vector about a normal vec.
pub fn cross(self, other: Vec3) -> Self
[src]
Cross product with another Vec3
pub fn refract(self, norm: Vec3, eta: f64) -> Self
[src]
Simulate Snell's law refrection through a surface with normal vec.
eta is the relative index of refraction, ri1 / ri2
pub fn lerp(self, other: Vec3, t: f64) -> Self
[src]
Linearly interpolate between two Vec3 with an interpolation value t
Trait Implementations
impl Add<Vec3> for Vec3
[src]
type Output = Vec3
The resulting type after applying the +
operator.
fn add(self, rhs: Vec3) -> Self::Output
[src]
impl Add<f64> for Vec3
[src]
type Output = Vec3
The resulting type after applying the +
operator.
fn add(self, rhs: f64) -> Self::Output
[src]
impl Clone for Vec3
[src]
impl Color for Vec3
[src]
impl Copy for Vec3
[src]
impl Debug for Vec3
[src]
impl Default for Vec3
[src]
impl From<(f64, f64, f64)> for Vec3
[src]
impl From<(i32, i32, i32)> for Vec3
[src]
impl From<Vec3> for u32
[src]
impl From<f64> for Vec3
[src]
impl From<i32> for Vec3
[src]
impl Mul<Vec3> for f64
[src]
type Output = Vec3
The resulting type after applying the *
operator.
fn mul(self, rhs: Vec3) -> Self::Output
[src]
impl Mul<f64> for Vec3
[src]
type Output = Vec3
The resulting type after applying the *
operator.
fn mul(self, rhs: f64) -> Self::Output
[src]
impl Neg for Vec3
[src]
type Output = Vec3
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
impl PartialEq<Vec3> for Vec3
[src]
impl StructuralPartialEq for Vec3
[src]
impl Sub<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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,