diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2022-08-29 23:11:29 +0200 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2022-08-29 23:11:29 +0200 |
| commit | 8b8b3c8aaa859ceff95e82e26b81410688613cd7 (patch) | |
| tree | 4cdac9321f34d5dc948fc16eb6a1c4953b98eded /src/bvh.cpp | |
| parent | ae0ea5fb65b0340eabf4e9e424ba79787600dc1b (diff) | |
Fix meshes attributes copy to arrays
Diffstat (limited to 'src/bvh.cpp')
| -rw-r--r-- | src/bvh.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bvh.cpp b/src/bvh.cpp index 9d0b4b8..a22cd5e 100644 --- a/src/bvh.cpp +++ b/src/bvh.cpp @@ -150,15 +150,15 @@ aabb bvh::compute_bounds(uint32_t begin, uint32_t end) { } void bvh::subdivide(uint32_t parent_id, uint32_t begin, uint32_t end) { - size_t count = end - begin; + const size_t count = end - begin; if (count == 1) { temp_nodes[parent_id] = std::move(leafs[begin]); return; } - auto left_id = ++next_node_id; - auto right_id = ++next_node_id; + const auto left_id = ++next_node_id; + const auto right_id = ++next_node_id; temp_nodes[parent_id].left_id = (int32_t)left_id; @@ -168,7 +168,7 @@ void bvh::subdivide(uint32_t parent_id, uint32_t begin, uint32_t end) { return; } - auto parent_bb = temp_nodes[parent_id].bounding_box; + const auto& parent_bb = temp_nodes[parent_id].bounding_box; int32_t split_axis = parent_bb.maximum_axis(); if (count <= 4) { |
