void RenderTerrainNode::mergeIntoBounds( long x, long y, const Vector3& pos ) { if (pointIntersectsNode(x, y)) { m_aabb.merge(pos); if (!isLeaf()) { for (int i = 0; i < 4; ++i) { m_children[i]->mergeIntoBounds(x, y, pos); } } } }
//--------------------------------------------------------------------- void TerrainQuadTreeNode::mergeIntoBounds(long x, long y, const VEC3& pos) { if (pointIntersectsNode(x, y)) { VEC3 localPos = pos - mLocalCentre; mAABB.Merge(localPos); mBoundingRadius = std::max(mBoundingRadius, localPos.GetLength()); if (!isLeaf()) { for (int i = 0; i < 4; ++i) mChildren[i]->mergeIntoBounds(x, y, pos); } } }