Struct rs_pbrt::accelerators::kdtreeaccel::KdTreeAccel
source · [−]pub struct KdTreeAccel {
pub isect_cost: i32,
pub traversal_cost: i32,
pub max_prims: i32,
pub empty_bonus: Float,
pub primitives: Vec<Arc<Primitive>>,
pub primitive_indices: Vec<i32>,
pub nodes: Vec<KdAccelNode>,
pub n_alloced_nodes: i32,
pub next_free_node: i32,
pub bounds: Bounds3f,
}
Fields
isect_cost: i32
traversal_cost: i32
max_prims: i32
empty_bonus: Float
primitives: Vec<Arc<Primitive>>
primitive_indices: Vec<i32>
nodes: Vec<KdAccelNode>
n_alloced_nodes: i32
next_free_node: i32
bounds: Bounds3f
Implementations
sourceimpl KdTreeAccel
impl KdTreeAccel
pub fn new(
p: Vec<Arc<Primitive>>,
isect_cost: i32,
traversal_cost: i32,
empty_bonus: Float,
max_prims: i32,
max_depth: i32
) -> Self
pub fn create(prims: Vec<Arc<Primitive>>, ps: &ParamSet) -> Primitive
pub fn build_tree(
&mut self,
node_num: i32,
node_bounds: &Bounds3f,
all_prim_bounds: &[Bounds3f],
prim_nums: &[usize],
n_primitives: usize,
depth: i32,
edges: &mut [Vec<BoundEdge>; 3],
prims0: &mut [usize],
prims1: &mut [usize],
bad_refines: i32
)
pub fn world_bound(&self) -> Bounds3f
pub fn intersect(&self, ray: &Ray, isect: &mut SurfaceInteraction<'_>) -> bool
pub fn intersect_p(&self, ray: &Ray) -> bool
pub fn get_material(&self) -> Option<Arc<Material>>
pub fn get_area_light(&self) -> Option<Arc<Light>>
Auto Trait Implementations
impl !RefUnwindSafe for KdTreeAccel
impl Send for KdTreeAccel
impl Sync for KdTreeAccel
impl Unpin for KdTreeAccel
impl !UnwindSafe for KdTreeAccel
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more