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§
Source§impl 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<'_> ⓘ
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 Freeze for BSPNode
impl RefUnwindSafe for BSPNode
impl Send for BSPNode
impl Sync for BSPNode
impl Unpin for BSPNode
impl UnwindSafe for BSPNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more