MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / Build

Method Build

TombEngine/Specific/Structures/BoundingVolumeHierarchy.cpp:638–648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 5

GetAabbAreaFunction · 0.85
reserveMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected