Struct bsp_pathfinding::BSPNode
source · [−]pub struct BSPNode { /* private fields */ }
Expand description
Represents a single node in the binary tree. The node constitutes of a splitting plane and children behind and in front of the plane.
A node can be double planar, which means that the partitioning plane contains two faces with opposite facing normals.
Implementations
sourceimpl BSPNode
impl BSPNode
sourcepub fn from_faces(
nodes: &mut SlotMap<NodeIndex, BSPNode>,
faces: &[Face],
depth: usize
) -> Option<NodeIndex>
pub fn from_faces(
nodes: &mut SlotMap<NodeIndex, BSPNode>,
faces: &[Face],
depth: usize
) -> Option<NodeIndex>
Creates a new BSPNode and inserts it into nodes. Returns None if there were not faces to create a node from
pub fn get_side(&self, point: Vec2) -> Side
pub fn descendants(
index: NodeIndex,
nodes: &SlotMap<NodeIndex, BSPNode>
) -> Descendants<'_>ⓘNotable traits for Descendants<'a>impl<'a> Iterator for Descendants<'a> type Item = (NodeIndex, &'a BSPNode);
sourcepub fn clip(
index: NodeIndex,
nodes: &SlotMap<NodeIndex, BSPNode>,
portal: ClippedFace,
root_side: Side
) -> Vec<ClippedFace>
pub fn clip(
index: NodeIndex,
nodes: &SlotMap<NodeIndex, BSPNode>,
portal: ClippedFace,
root_side: Side
) -> Vec<ClippedFace>
Clips a face by the BSP faces and returns several smaller faces
pub fn generate_portals(
index: NodeIndex,
nodes: &SlotMap<NodeIndex, BSPNode>,
clipping_planes: &Vector<Face>,
result: &mut impl Extend<ClippedFace>
)
pub fn is_leaf(&self) -> bool
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for BSPNode
impl Send for BSPNode
impl Sync for BSPNode
impl Unpin for BSPNode
impl UnwindSafe for BSPNode
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