From ad3fe46efeced9d25c4806b62d442fc31f2fcec4 Mon Sep 17 00:00:00 2001 From: "yang.yongquan" <3395816735@qq.com> Date: Fri, 10 Feb 2023 18:28:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E4=B8=80=E4=BA=9Bbu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/Renderer/Painting/BvhTree.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ArchitectureColoredPainting/src/Renderer/Painting/BvhTree.cpp b/ArchitectureColoredPainting/src/Renderer/Painting/BvhTree.cpp index e5760d6..3de220a 100644 --- a/ArchitectureColoredPainting/src/Renderer/Painting/BvhTree.cpp +++ b/ArchitectureColoredPainting/src/Renderer/Painting/BvhTree.cpp @@ -6,6 +6,9 @@ GLuint BvhTree::getBvhNodeNum() { void BvhTree::buildBvhTree(BvhTreeData initBound[], int len, GLuint transformParam) { tot = 0; transform = transformParam; + for (int i = 0; i < len; i++) { + initBound->bound = initBound->boundWithRotation(); + } root = subBvhTree(initBound, 0, len-1); } @@ -19,9 +22,9 @@ QVector4D BvhTree::Union(QVector4D a, QVector4D b) { } QVector4D BvhTree::calcBound(BvhTreeData initBound[], int l, int r) { - QVector4D res = initBound[l].boundWithRotation(); + QVector4D res = initBound[l].bound; for (int i = l + 1; i <= r; i++) { - res = Union(res, initBound[i].boundWithRotation()); + res = Union(res, initBound[i].bound); } return res; }