pub struct FlatBvhNode {
pub aabb: Aabb,
pub left_first: u32,
pub count: u32,
}Expand description
A single node in the linearised (flat) BVH representation.
Layout:
- If
count == 0this is an internal node.- The left child is always at index
node_idx + 1(i.e. stored immediately after the parent in DFS pre-order). left_firstholds the index of the right child.
- The left child is always at index
- If
count > 0this is a leaf;left_firstis the start index into the accompanying primitive-index slice andcountis the number of entries.
Fields§
§aabb: AabbBounding box of this node.
left_first: u32Right-child index (internal) or first-primitive index (leaf).
count: u320 for internal nodes; number of primitives for leaf nodes.
Trait Implementations§
Source§impl Clone for FlatBvhNode
impl Clone for FlatBvhNode
Source§fn clone(&self) -> FlatBvhNode
fn clone(&self) -> FlatBvhNode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FlatBvhNode
impl RefUnwindSafe for FlatBvhNode
impl Send for FlatBvhNode
impl Sync for FlatBvhNode
impl Unpin for FlatBvhNode
impl UnsafeUnpin for FlatBvhNode
impl UnwindSafe for FlatBvhNode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more