Created
October 28, 2008 04:33
-
-
Save bdonlan/20298 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StaticQuadTree_Impl::StaticQuadTree_Impl( | |
const std::vector<std::pair<Region, void *> > ®ions | |
) | |
{ | |
typedef std::pair<Region, void *> VP; | |
Region worldRegion; | |
if (regions.size()) | |
worldRegion = regions[0].first; | |
std::for_each(regions.begin(), regions.end(), | |
( var(worldRegion) = | |
bind(Region::minContainsBoth, var(worldRegion), bind(&VP::first, _1)) | |
)); | |
root = divisions.construct(worldRegion); | |
std::for_each(regions.begin(), regions.end(), | |
bind(&StaticQuadTree_Impl::placeRegion, | |
this, | |
root, | |
bind(&VP::first, _1), | |
bind(&VP::second, _1), | |
true | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment