-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
in AABBTree.cpp at 144 row
float newParentNodeCost = 2.0f * combinedAabb.surfaceArea;
here why Multiply 2 ? because here only add combinedSurfaceArea oncetime for add new node.
And I think here should be
---------START------------
{
float newParentNodeCost = combinedAabb.surfaceArea;
float minimumPushDownCost = (combinedAabb.surfaceArea - treeNode.aabb.surfaceArea);
// use the costs to figure out whether to create a new parent here or descend
float costLeft;
float costRight;
if (leftNode.isLeaf())
{
costLeft = leafNode.aabb.merge(leftNode.aabb).surfaceArea + minimumPushDownCost;
}
else
{
AABB newLeftAabb = leafNode.aabb.merge(leftNode.aabb);
costLeft = (newLeftAabb.surfaceArea - leftNode.aabb.surfaceArea) + minimumPushDownCost;
}
if (rightNode.isLeaf())
{
costRight = leafNode.aabb.merge(rightNode.aabb).surfaceArea + minimumPushDownCost;
}
}
---------END------------
so compare cost and costLeft , can get the smallest Bounding box for all tree .
Metadata
Metadata
Assignees
Labels
No labels