Struct bsp_pathfinding::Face
source · [−]Expand description
A two dimensional face of two vertices. Uses counterclockwise winding order to calculate a normal
Fields
vertices: [Vec2; 2]
Implementations
sourceimpl Face
impl Face
pub fn new(vertices: [Vec2; 2]) -> Self
pub fn length(&self) -> f32
pub fn length_squared(&self) -> f32
pub fn into_tuple(&self) -> (Vec2, Vec2)
sourcepub fn transform_3d(&self, transform: Mat4) -> Self
pub fn transform_3d(&self, transform: Mat4) -> Self
Transforms the face using 3d space using xz plane
sourcepub fn side_of(&self, p: Vec2, normal: Vec2) -> Side
pub fn side_of(&self, p: Vec2, normal: Vec2) -> Side
Returns the side self is in respect to a point and normal
sourcepub fn adjacent(&self, other: Face) -> bool
pub fn adjacent(&self, other: Face) -> bool
Returns true if the face is touching the other face
pub fn midpoint(&self) -> Vec2
pub fn contains_point(&self, p: Vec2) -> bool
pub fn dir(&self) -> Vec2
Trait Implementations
sourceimpl<'a> IntoIterator for Face
impl<'a> IntoIterator for Face
sourceimpl<'a> IntoIterator for &'a Face
impl<'a> IntoIterator for &'a Face
impl Copy for Face
impl StructuralPartialEq for Face
Auto Trait Implementations
impl RefUnwindSafe for Face
impl Send for Face
impl Sync for Face
impl Unpin for Face
impl UnwindSafe for Face
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more