| 636 | } |
| 637 | |
| 638 | void BoundingVolumeHierarchy::Build(const std::vector<int>& objectIds, const std::vector<BoundingBox>& aabbs, BvhBuildStrategy strategy) |
| 639 | { |
| 640 | // Reserve enough memory for optimally balanced tree. |
| 641 | _nodes.reserve((objectIds.size() * 2) - 1); |
| 642 | |
| 643 | // Build tree recursively. |
| 644 | Build(objectIds, aabbs, 0, (int)objectIds.size(), strategy); |
| 645 | _rootId = (int)_nodes.size() - 1; |
| 646 | |
| 647 | //Validate(); |
| 648 | } |
| 649 | |
| 650 | int BoundingVolumeHierarchy::Build(const std::vector<int>& objectIds, const std::vector<BoundingBox>& aabbs, int start, int end, BvhBuildStrategy strategy) |
| 651 | { |
nothing calls this directly
no test coverage detected