Beispiel #1
0
int BaseObj::NumChildren()
{
   if (_init_children == false)
    {
      InitChildren();
      _init_children = true;
    }
   return _numChildren; 
}
Beispiel #2
0
Tile::Tile(int n, float roughness, int num_lod)
    : lod_(0),
      size_((1 << n) + 1),
      num_lod_(num_lod),
      index_buffer_(NULL),
      parent_(NULL) {
  vertices_ = new Vector[size_*size_];
  Init(roughness);
  InitChildren(roughness, NULL, NULL);
}
// When the quad-tree manager is initialized, it instantiates the entire possible tree to avoid having to do a bunch of 
// time wasting news and deletes during runtime.
void QuadTreeManager::InitQuadTree(float left, float right, float top, float bottom, unsigned int maxDepth, unsigned int maxPerNode, RenderShape outlineTemplate)
{
	_maxPerNode = maxPerNode;
	_maxDepth = maxDepth;
	_outlineTemplate = outlineTemplate;
	_quadTree.resize(GetDepthIndex(maxDepth));
	_quadTree[0] = InitNode(0, 0, 0, left, right, top, bottom);
	int maxI = GetDepthIndex(maxDepth - 1);
	for (int i = 0; i < maxI; ++i)
	{
		InitChildren(i);
	}
}
Beispiel #4
0
Tile::Tile(Tile *parent, Tile::Direction direction, float roughness,
           Tile *north, Tile *west)
    : lod_(parent->lod_ + 1),
      size_(parent->size_),
      num_lod_(parent->num_lod_ - 1),
      index_buffer_(NULL),
      direction_(direction),
      parent_(parent) {
  vertices_ = new Vector[size_*size_];
  InitFromParent();
  Refine(2, roughness);
  FixEdges(north, west);
  InitChildren(roughness, north, west);
}
TSysInfoWindow::TSysInfoWindow( PTWindowsObject aParent, LPSTR aTitle ) :
	TDialog( aParent, aTitle )
{
	InitChildren();
	GetSysInformation();
}
Beispiel #6
0
void BaseObj::UpdateChildren()
{
   DeleteChildren();
   InitChildren();
   _init_children = true;
}