Add generalized bvh for pbrt
This commit is contained in:
parent
807168f787
commit
6403aabc11
5 changed files with 360 additions and 43 deletions
|
|
@ -49,6 +49,14 @@ impl AABB {
|
|||
self.max
|
||||
}
|
||||
|
||||
pub fn center(self) -> Pos3 {
|
||||
Pos3::new(
|
||||
(self.min.x + self.max.x) * 0.5,
|
||||
(self.min.y + self.max.y) * 0.5,
|
||||
(self.min.z + self.max.z) * 0.5,
|
||||
)
|
||||
}
|
||||
|
||||
pub fn contains_point(self, pos: Pos3) -> bool {
|
||||
self.min.x <= pos.x
|
||||
&& pos.x <= self.max.x
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue