Debug problems
This commit is contained in:
parent
0a9748a1b7
commit
479cf89e8d
5 changed files with 18 additions and 7 deletions
|
|
@ -30,7 +30,8 @@ AttributeBegin
|
|||
"rgb tex1" [.1 .1 .1] "rgb tex2" [.8 .8 .8]
|
||||
Material "diffuse" "texture reflectance" "checks"
|
||||
Translate 0 0 -1
|
||||
Shape "bilinearmesh"
|
||||
Shape "trianglemesh"
|
||||
"integer indices" [ 0 1 2 1 3 2 ]
|
||||
"point3 P" [ -20 -20 0 20 -20 0 -20 20 0 20 20 0 ]
|
||||
"point2 uv" [ 0 0 1 0 1 1 0 1 ]
|
||||
AttributeEnd
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ impl<T: BvhData> Bvh<T> {
|
|||
unreachable!()
|
||||
};
|
||||
|
||||
if count <= min {
|
||||
if count <= Index::max(1, min) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -86,6 +86,9 @@ impl<T: BvhData> Bvh<T> {
|
|||
let left_aabb = data.get_aabb_range(start..(start + mid));
|
||||
let right_aabb = data.get_aabb_range((start + mid)..(start + count));
|
||||
|
||||
assert!(aabb.contains_aabb(left_aabb));
|
||||
assert!(aabb.contains_aabb(right_aabb));
|
||||
|
||||
let i = bvh.len() as Index;
|
||||
bvh[node] = Node::Inner {
|
||||
left: i,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue