示例#1
0
void ATOM_OctreeNode::createChildren (void) const 
{
  getOrCreateChild (ATOM_OctreeNode::PXPYPZ);
  getOrCreateChild (ATOM_OctreeNode::PXPYNZ);
  getOrCreateChild (ATOM_OctreeNode::PXNYPZ);
  getOrCreateChild (ATOM_OctreeNode::PXNYNZ);
  getOrCreateChild (ATOM_OctreeNode::NXPYPZ);
  getOrCreateChild (ATOM_OctreeNode::NXPYNZ);
  getOrCreateChild (ATOM_OctreeNode::NXNYPZ);
  getOrCreateChild (ATOM_OctreeNode::NXNYNZ);
}
示例#2
0
文件: Diamond.cpp 项目: 2php/osgearth
void
Diamond::seed( Level maxLevel )
{
    if ( maxLevel > _level )
    {
        for( ChildIndex c = 0; c < _childValence; ++c )
        {
            getOrCreateChild( c )->seed( maxLevel );
        }
    }
}
示例#3
0
文件: Diamond.cpp 项目: 2php/osgearth
void
Diamond::split()
{
    // mark as split, and mark the primitive set as needing a refesh:
    _isSplit = true;

    if ( _hasGeometry )
    {
        // for geometry diamonds, a split means we must regenerate this diamond
        // AND its quadtree ancestor.
        this->dirty();
        _a[QUADTREE]->dirty();
    }
    else
    {
        // for intermediate diamonds, splitting means we must rebuild each immediate parent.
        _a[PARENT_L]->dirty();
        _a[PARENT_R]->dirty();
    }

    _queuedForSplit = false;

    // check to see whether any of our neighbors are split. If a neighbor is also
    // split, spawn a common child.
    for( ChildIndex c = 0; c < _childValence; ++c )
    {
        // debugging assertion:
        if ( _c[c].valid() )
        {
            OE_WARN << "ILLEGAL STATE: diamond just split but has kids!" << std::endl;
        }

        Diamond* d0 = getNeighbor( c );
        if ( d0 && d0->_isSplit )
        {
            getOrCreateChild( c );
        }
    }
}