evelight/quad_tree.cpp
void QTNode::Split()
{
    glm::vec2 center = mLimits.GetCenter();

    mChildren[NE] = new QTNode(AABB(center.x, center.y, mLimits.maxX, mLimits.maxY), this);
    mChildren[NW] = new QTNode(AABB(mLimits.minX, center.y, center.x, mLimits.maxY), this);
    mChildren[SW] = new QTNode(AABB(mLimits.minX, mLimits.minY, center.x, center.y), this);
    mChildren[SE] = new QTNode(AABB(center.x, mLimits.minY, mLimits.maxX, center.y), this);
}
/**
 * Allocates the 4 children nodes and their boundaries.
 */
Allocates the 4 children nodes and their boundaries.
Allocates the 4 children nodes and their boundaries .
void QTNode::Split()
{
    glm::vec2 center = mLimits.GetCenter();
    mChildren[NE] = new QTNode(AABB(center.x, center.y, mLimits.maxX, mLimits.maxY), this);
    mChildren[NW] = new QTNode(AABB(mLimits.minX, center.y, center.x, mLimits.maxY), this);
    mChildren[SW] = new QTNode(AABB(mLimits.minX, mLimits.minY, center.x, center.y), this);
    mChildren[SE] = new QTNode(AABB(center.x, mLimits.minY, mLimits.maxX, center.y), this);
}
void QTNode :: Split ( ) { glm :: vec2 center = mLimits . GetCenter ( ) ; mChildren [ NE ] = new QTNode ( AABB ( center . x , center . y , mLimits . maxX , mLimits . maxY ) , this ) ; mChildren [ NW ] = new QTNode ( AABB ( mLimits . minX , center . y , center . x , mLimits . maxY ) , this ) ; mChildren [ SW ] = new QTNode ( AABB ( mLimits . minX , mLimits . minY , center . x , center . y ) , this ) ; mChildren [ SE ] = new QTNode ( AABB ( center . x , mLimits . minY , mLimits . maxX , center . y ) , this ) ; }
Allocates the 4 children nodes and their boundaries.
Allocates the 4 children nodes and their boundaries .