1 #ifndef QUADTREE_REMOVED
6 Rect TransformToQuadChild(const Rect& src, QuadTreeNodeChildren child_type)
13 if (child_type == QTC_BOTTOM_LEFT || child_type == QTC_BOTTOM_RIGHT)
17 if (child_type == QTC_TOP_RIGHT || child_type == QTC_BOTTOM_RIGHT)
24 Rect TransformFromQuadChild(const Rect& src, QuadTreeNodeChildren child_type)
27 if (child_type == QTC_BOTTOM_LEFT || child_type == QTC_BOTTOM_RIGHT)
31 if (child_type == QTC_TOP_RIGHT || child_type == QTC_BOTTOM_RIGHT)
42 bool IntersectsQuadChild(const Rect& src, QuadTreeNodeChildren child_type)
45 Rect dst = TransformFromQuadChild(std, child_type);
46 if (src.x + src.w < dst.x) return false;
47 if (src.y + src.h < dst.y) return false;
48 if (src.x > dst.x + dst.w) return false;
49 if (src.y > dst.y + dst.h) return false;
50 Debug("%s is contained in %s\n", src.Str().c_str(), dst.Str().c_str());
54 bool ContainedInQuadChild(const Rect& src, QuadTreeNodeChildren child_type)
57 Rect dst = TransformFromQuadChild(std, child_type);
58 if (src.x < dst.x) return false;
59 if (src.y < dst.y) return false;
60 if (src.x + src.w > dst.x + dst.w) return false;
61 if (src.y + src.h > dst.y + dst.h) return false;
62 Debug("%s is contained in %s... \n", src.Str().c_str(), dst.Str().c_str());