From 8b8b3c8aaa859ceff95e82e26b81410688613cd7 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Mon, 29 Aug 2022 23:11:29 +0200 Subject: Fix meshes attributes copy to arrays --- src/bvh.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/bvh.cpp') 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) { -- cgit v1.3