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; }