code: function _quadSubdivide(index, quad) {
      var next = quad.level + 1,
          subw = Math.round(quad.bounds.width / 2),
          subh = Math.round(quad.bounds.height / 2),
          qx = Math.round(quad.bounds.x),
          qy = Math.round(quad.bounds.y),
          x,
          y;
  
      switch (index) {
        case 0:
          x = qx;
          y = qy;
          break;
        case 1:
          x = qx + subw;
          y = qy;
          break;
        case 2:
          x = qx;
          y = qy + subh;
          break;
        case 3:
          x = qx + subw;
          y = qy + subh;
          break;
      }
  
      return _quadTree(
        {x: x, y: y, width: subw, height: subh},
        next,
        quad.maxElements,
        quad.maxLevel
      );
    }
docs: Subdivide a quad by creating a node at a precise index. The function does
  not generate all four nodes not to potentially create unused nodes.
  
  @param  {integer}  index The index of the node to create.
  @param  {object}   quad  The quad object to subdivide.
  @return {object}         A new quad representing the node created.