Logo Search packages:      
Sourcecode: earth3d version File versions  Download package

MapPart MapTileTreeNode::getSelectedNeighbor ( int  direction  ) 

get selected neighbor on higher or same level. If none is selected, it returns the deepest neighbor

Definition at line 278 of file mapTileTreeNode.cpp.

References getNeighbor().

Referenced by informNeighborNodes(), and regenerateHeightfield().

                                                          {
  MapPart mp = getNeighbor(direction);
  MapPart orig = mp;

  while(!mp.node->getSelectedForDrawing()) {
    mp.node = mp.node->getParent();
    mp.level++;
    mp.offset /=2;
    if (!mp.node) break;
  }

  if (mp.node) return(mp);
  return(orig);
}


Generated by  Doxygen 1.6.0   Back to index