pub fn build(&mut self, objects: &[&(dyn Hittable + Sync)], method: BvhPartitionMethod) {
        let mut infos: Vec<_> = objects
            .iter()
            .enumerate()
            .map(|(index, object)| {
                let aabb = object.aabb();
                BvhObjectInfo {
                    index,
                    object: *object,
                    aabb,
                    centroid: aabb.centroid(),
                }
            })
            .collect();
        self.build_r(&mut infos, method);
    }
/// Build the BVH using a slice of objects and a partitioning method.

Build the BVH using a slice of objects and a partitioning method.
Build the BVH using a slice of objects and a partitioning method .
pub fn build(&mut self, objects: &[&(dyn Hittable + Sync)], method: BvhPartitionMethod) {
        let mut infos: Vec<_> = objects
            .iter()
            .enumerate()
            .map(|(index, object)| {
                let aabb = object.aabb();
                BvhObjectInfo {
                    index,
                    object: *object,
                    aabb,
                    centroid: aabb.centroid(),
                }
            })
            .collect();
        self.build_r(&mut infos, method);
    }
pub fn build ( & mut self , objects : & [ & ( dyn Hittable + Sync ) ] , method : BvhPartitionMethod ) { let mut infos : Vec < _ > = objects . iter ( ) . enumerate ( ) . map ( | ( index , object ) | { let aabb = object . aabb ( ) ; BvhObjectInfo { index , object : * object , aabb , centroid : aabb . centroid ( ) , } } ) . collect ( ) ; self . build_r ( & mut infos , method ) ; }
Build the BVH using a slice of objects and a partitioning method.
Build the BVH using a slice of objects and a partitioning method .
&mut self
objects
&[&(dyn Hittable + Sync)]
method
BvhPartitionMethod
&mut self
objects
&[&(dyn Hittable + Sync)]
method
BvhPartitionMethod