Bvh2Converter

Struct Bvh2Converter 

Source
pub struct Bvh2Converter<'a> {
    pub bvh2: &'a Bvh2,
    pub nodes: Vec<CwBvhNode>,
    pub primitive_indices: Vec<u32>,
    pub decisions: Vec<Decision>,
    pub order_children_during_build: bool,
    pub include_exact_node_aabbs: bool,
    pub exact_node_aabbs: Option<Vec<Aabb>>,
    /* private fields */
}
Expand description

Convert a bvh2 to CwBvh

Fields§

§bvh2: &'a Bvh2§nodes: Vec<CwBvhNode>§primitive_indices: Vec<u32>§decisions: Vec<Decision>§order_children_during_build: bool§include_exact_node_aabbs: bool§exact_node_aabbs: Option<Vec<Aabb>>

Implementations§

Source§

impl<'a> Bvh2Converter<'a>

Source

pub fn new( bvh2: &'a Bvh2, order_children: bool, include_exact_node_aabbs: bool, ) -> Self

Initialize the Bvh2 to CwBvh converter.

Source

pub fn convert_to_cwbvh(&mut self)

Convert the bvh2 to CwBvh

Source

pub fn convert_to_cwbvh_impl( &mut self, node_index_bvh8: usize, node_index_bvh2: usize, )

Source

pub fn calculate_cost(&mut self, max_prims_per_leaf: u32)

Fill cost table for bvh2 -> bvh8 conversion

Source

pub fn calculate_cost_impl( &mut self, node_index: usize, max_prims_per_leaf: u32, _current_depth: i32, ) -> u32

Source

pub fn get_children( &mut self, node_index: usize, children: &mut [u32; 8], child_count: &mut u32, i: usize, )

Source

pub fn order_children( &mut self, node_index: usize, children: &mut [u32; 8], child_count: usize, )

Arrange child nodes in Morton order according to their centroids so that the order in which the intersected children are traversed can be determined by the ray octant.

Auto Trait Implementations§

§

impl<'a> Freeze for Bvh2Converter<'a>

§

impl<'a> RefUnwindSafe for Bvh2Converter<'a>

§

impl<'a> Send for Bvh2Converter<'a>

§

impl<'a> Sync for Bvh2Converter<'a>

§

impl<'a> Unpin for Bvh2Converter<'a>

§

impl<'a> UnwindSafe for Bvh2Converter<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.