当前位置: 首页>>代码示例>>C++>>正文


C++ Tree::SetCircleSize方法代码示例

本文整理汇总了C++中Tree::SetCircleSize方法的典型用法代码示例。如果您正苦于以下问题:C++ Tree::SetCircleSize方法的具体用法?C++ Tree::SetCircleSize怎么用?C++ Tree::SetCircleSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tree的用法示例。


在下文中一共展示了Tree::SetCircleSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: LoadScene

	bool SceneManager::LoadScene( string file_name )
	{
		cout<<"=========Loading Scene Config================"<<endl;
		ofxXmlSettings file;
		if(!file.loadFile(file_name))
		{
			cout<<"Cannot load "<<file_name<<endl;
			return false;
		}
		if(!file.tagExists("LevelIndex"))
		{
			cout<<"Cannot find LevelIndex"<<endl;
			return false;
		}

        ReadColorSet(file);
        
		file.pushTag("LevelIndex");
		for(size_t i =0; i < file.getNumTags("Level"); ++i)
		{
			vector<string> group_name;
			for(size_t i =0; i < file.getNumTags("Group"); ++i)
			{
				file.pushTag("Group",i);
				string name = file.getValue("Name","NONE");
				group_name.push_back(name);
				file.popTag();
			}
			level_index_.push_back(group_name);
		}
		file.popTag();

		SceneType scene;

		for(size_t i =0; i < file.getNumTags("Group"); ++i)
		{
			file.pushTag("Group",i);
			string name = file.getValue("Name","NONE");
			//if(name == group_name[i])
			{
				string type = file.getValue("Type","NONE");
				if(type == "Flower")
				{
					vector<Flower*> group_model;
					if(file.tagExists("GroupObj"))
					{
						file.pushTag("GroupObj");
						for(size_t j =0; j < file.getNumTags("Model"); ++j)
						{
							file.pushTag("Model",j);
							string url = file.getValue("ObjURL", "NA");
							ofVec3f pos;
							file.pushTag("Position");
							pos.set(file.getValue("X",0), file.getValue("Y",0), file.getValue("Z",0));
							file.popTag();
							float rotation = file.getValue("Rotation",0);
							float max_scale = file.getValue("MaxScale",0.1);
							float scale_speed = file.getValue("ScaleSpeed", 0.01);
							float staying_time = file.getValue("StayingTime", 1);
							float holding_time = file.getValue("HoldingTime", 1);
							float circle_size = file.getValue("CircleSize", 200);
							file.pushTag("CircleColor");
							ofColor color;
							color.set(file.getValue("R",255), file.getValue("G",255), file.getValue("B",255), file.getValue("A",255));
							file.popTag();
							file.pushTag("ModelColor");
							ofColor mcolor;
							mcolor.set(file.getValue("R",255), file.getValue("G",255), file.getValue("B",255), file.getValue("A",255));
							file.popTag();


							bool falling = file.getValue("FallingEnable", false);
							float pitch = file.getValue("Pitch", 1.0f);

							Flower* flower = new Flower();
							flower->loadModel(url);
							flower->setPosition(pos.x,pos.y,pos.z);
							flower->setRotation(0,180,1,0,0);
							flower->setRotation(1,rotation,0,0,1);
							flower->SetMaxScale(max_scale);
							flower->SetScaleSpeed(scale_speed);
							flower->staying_time_ = staying_time + ofRandom(-3, 3);
							flower->holding_time_ = holding_time;
							flower->SetCircleSize(circle_size);
							flower->SetCircleColor(color);
							flower->SetColor(mcolor);
							flower->SetFalling(falling);
							flower->SetPitch(pitch);
							flower->Enable(false);
							group_model.push_back(flower);
							file.popTag();
						}
						file.popTag();

						float group_staying_time= file.getValue("StayingTime",1);

						Group flower_group(name, group_staying_time, group_model, Group::LEAF);
						scene.push_back(flower_group);
					}
				}
//.........这里部分代码省略.........
开发者ID:vanish87,项目名称:Jungle-of,代码行数:101,代码来源:SceneManager.cpp


注:本文中的Tree::SetCircleSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。