修改了一些bug
parent
39aa4a5902
commit
ad3fe46efe
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue