Trait VectorExt

Source
pub trait VectorExt {
    // Required methods
    fn size(self) -> f32;
    fn size_squared(self) -> f32;
    fn is_nearly_zero(self, tolerance: f32) -> bool;
    fn is_normalized(self) -> bool;
    fn get_safe_normal(self, tolerance: f32) -> Vector;
}
Expand description

Extension trait for Vector operations common in UE

Required Methods§

Source

fn size(self) -> f32

Get the size (magnitude) of the vector

Source

fn size_squared(self) -> f32

Get the squared size (magnitude squared) - faster than size()

Source

fn is_nearly_zero(self, tolerance: f32) -> bool

Check if the vector is nearly zero

Source

fn is_normalized(self) -> bool

Check if the vector is normalized (unit length)

Source

fn get_safe_normal(self, tolerance: f32) -> Vector

Get a normalized copy of the vector

Implementors§