INNER CODE UNIT · C++
size
novelrt/NovelRT · Maths/QuadTree.cpp:18
GeoVector2F size = GetBounds().size / 2;
GeoVector2F position = GetBounds().position;
_children[TOP_LEFT] =
std::make_unique<QuadTree>(GeoBounds(position + (size * TOP_LEFT_SCALE), size, 0), weak_from_this());
_children[TOP_RIGHT] =
std::make_unique<QuadTree>(GeoBounds(position + (size * TOP_RIGHT_SCALE), size, 0), weak_from_this());
_children[BOTTOM_LEFT] =
std::make_unique<QuadTree>(GeoBounds(position + (size * BOTTOM_LEFT_SCALE), size, 0), weak_from_this());
_children[BOTTOM_RIGHT] =
std::make_unique<QuadTree>(GeoBounds(position + (size * BOTTOM_RIGHT_SCALE), size, 0), weak_from_this());
for (size_t i = 0; i < GetPointCount(); i++)
{
auto point = GetPoint(i);
auto result = TryInsert(point);
assert(result);