fn follow_branch_grow(&mut self, i: usize, bbox: BBox<i64>, p: Vec3<i64>) ->
		(usize, BBox<i64>)
	{
		assert!(self.nodes[i].is_branch());
		let ch = Node::which_child(bbox.center, p);
		let j = self.nodes[i].child[ch] as usize;
		let bb = Node::child_bbox(ch, bbox);
		if j > 0 {
			(j - 1, bb)
		} else {
			let k = self.new_leaf();
			self.nodes[i].child[ch] = k as u32;
			(k - 1, bb)
		}
	}
/// Follow a branch or grow a leaf node
Follow a branch or grow a leaf node
Follow a branch or grow a leaf node
fn follow_branch_grow(&mut self, i: usize, bbox: BBox<i64>, p: Vec3<i64>) ->
		(usize, BBox<i64>)
	{
		assert!(self.nodes[i].is_branch());
		let ch = Node::which_child(bbox.center, p);
		let j = self.nodes[i].child[ch] as usize;
		let bb = Node::child_bbox(ch, bbox);
		if j > 0 {
			(j - 1, bb)
		} else {
			let k = self.new_leaf();
			self.nodes[i].child[ch] = k as u32;
			(k - 1, bb)
		}
	}
fn follow_branch_grow ( & mut self , i : usize , bbox : BBox < i64 > , p : Vec3 < i64 > ) -> ( usize , BBox < i64 > ) { assert ! ( self nodes [ i ] is_branch ( ) ) ; let ch = Node :: which_child ( bbox . center , p ) ; let j = self . nodes [ i ] . child [ ch ] as usize ; let bb = Node :: child_bbox ( ch , bbox ) ; if j > 0 { ( j - 1 , bb ) } else { let k = self . new_leaf ( ) ; self . nodes [ i ] . child [ ch ] = k as u32 ; ( k - 1 , bb ) } }
Follow a branch or grow a leaf node
Follow a branch or grow a leaf node
&mut self
i
usize
bbox
BBox<i64>
p
Vec3<i64>