typedef std::map<std::string, osg::observer_ptr<osg::StateSet> > BuildingStateSetMap;
static BuildingStateSetMap statesetmap;
+static int numBuildings;
void addBuildingToLeafGeode(Geode* geode, const SGBuildingBin::Building& building)
{
BOOST_FOREACH(bin, buildings)
{
+ numBuildings = numBuildings + bin->getNumBuildings();
+ SG_LOG(SG_TERRAIN, SG_DEBUG, "Total random buildings generated: " << numBuildings);
ref_ptr<Effect> effect;
EffectMap::iterator iter = buildingEffectMap.find(bin->texture);
BuildingTransformer(transInv));
quadbuilding.buildQuadTree(rotatedBuildings.begin(), rotatedBuildings.end());
- ref_ptr<Group> group = quadbuilding.getRoot();
-
+ ref_ptr<Group> group = quadbuilding.getRoot();
mt->addChild(group);
- delete bin;
- }
+ delete bin;
+ }
buildings.clear();
for (l = triangle_buildings.begin(); l != triangle_buildings.end(); ++l) {
bin->insert(*l);
}
+
+ triangle_buildings.clear();
}
- SG_LOG(SG_INPUT, SG_DEBUG, "Random Buildings: " << bin->getNumBuildings());
- SG_LOG(SG_INPUT, SG_DEBUG, " Dropped due to mask: " << mask_dropped);
- SG_LOG(SG_INPUT, SG_DEBUG, " Dropped due to triangle edge: " << triangle_dropped);
- SG_LOG(SG_INPUT, SG_DEBUG, " Dropped due to random object: " << random_dropped);
- SG_LOG(SG_INPUT, SG_DEBUG, " Dropped due to other building: " << building_dropped);
+ SG_LOG(SG_TERRAIN, SG_DEBUG, "Random Buildings: " << bin->getNumBuildings());
+ SG_LOG(SG_TERRAIN, SG_DEBUG, " Dropped due to mask: " << mask_dropped);
+ SG_LOG(SG_TERRAIN, SG_DEBUG, " Dropped due to triangle edge: " << triangle_dropped);
+ SG_LOG(SG_TERRAIN, SG_DEBUG, " Dropped due to random object: " << random_dropped);
+ SG_LOG(SG_TERRAIN, SG_DEBUG, " Dropped due to other building: " << building_dropped);
}
}