[−][src]Struct tray_rust::linalg::normal::Normal
Normal is a standard 3 component normal but transforms as a normal normal when transformations are applied
Fields
x: f32
y: f32
z: f32
Methods
impl Normal
[src]
pub fn new(x: f32, y: f32, z: f32) -> Normal
[src]
Initialize the normal and set values for x, y, z
pub fn broadcast(x: f32) -> Normal
[src]
Initialize the normal with the same value of x, y, z
pub fn length_sqr(&self) -> f32
[src]
Compute the squared length of the normal
pub fn length(&self) -> f32
[src]
Compute the length of the normal
pub fn normalized(&self) -> Normal
[src]
Get a normalized copy of this normal
pub fn face_forward(&self, v: &Vector) -> Normal
[src]
Return a normal facing along the same direction as v
Trait Implementations
impl Clone for Normal
[src]
impl Copy for Normal
[src]
impl PartialEq<Normal> for Normal
[src]
impl PartialOrd<Normal> for Normal
[src]
fn partial_cmp(&self, other: &Normal) -> Option<Ordering>
[src]
fn lt(&self, other: &Normal) -> bool
[src]
fn le(&self, other: &Normal) -> bool
[src]
fn gt(&self, other: &Normal) -> bool
[src]
fn ge(&self, other: &Normal) -> bool
[src]
impl Debug for Normal
[src]
impl Div<Normal> for Normal
[src]
type Output = Normal
The resulting type after applying the /
operator.
fn div(self, rhs: Normal) -> Normal
[src]
Divide the normals components by the right hand side's components
impl Div<f32> for Normal
[src]
type Output = Normal
The resulting type after applying the /
operator.
fn div(self, rhs: f32) -> Normal
[src]
Divide the normals components by scalar
impl Sub<Normal> for Normal
[src]
type Output = Normal
The resulting type after applying the -
operator.
fn sub(self, rhs: Normal) -> Normal
[src]
Subtract two normals
impl Add<Normal> for Normal
[src]
type Output = Normal
The resulting type after applying the +
operator.
fn add(self, rhs: Normal) -> Normal
[src]
Add two normals together
impl Mul<Normal> for Normal
[src]
type Output = Normal
The resulting type after applying the *
operator.
fn mul(self, rhs: Normal) -> Normal
[src]
Multiply two normals
impl Mul<f32> for Normal
[src]
type Output = Normal
The resulting type after applying the *
operator.
fn mul(self, rhs: f32) -> Normal
[src]
Scale the normal by some value
impl Mul<Normal> for f32
[src]
type Output = Normal
The resulting type after applying the *
operator.
fn mul(self, rhs: Normal) -> Normal
[src]
Scale the normal by some value
impl Mul<Normal> for Transform
[src]
type Output = Normal
The resulting type after applying the *
operator.
fn mul(self, n: Normal) -> Normal
[src]
Multiply the normal by the transform to apply the transformation
impl Neg for Normal
[src]
type Output = Normal
The resulting type after applying the -
operator.
fn neg(self) -> Normal
[src]
Negate the normal
impl Index<usize> for Normal
[src]
type Output = f32
The returned type after indexing.
fn index(&self, i: usize) -> &f32
[src]
Access the normal by index
- 0 = x
- 1 = y
- 2 = z
impl IndexMut<usize> for Normal
[src]
impl StructuralPartialEq for Normal
[src]
Auto Trait Implementations
impl Send for Normal
impl Sync for Normal
impl Unpin for Normal
impl UnwindSafe for Normal
impl RefUnwindSafe for Normal
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Interpolate for T where
T: Add<T, Output = T> + Mul<f32, Output = T> + Copy,
[src]
T: Add<T, Output = T> + Mul<f32, Output = T> + Copy,