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


C++ KeyedArchive::GetFloat方法代码示例

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


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

示例1: Deserialize

void LodComponent::Deserialize(KeyedArchive *archive, SceneFileV2 *sceneFile)
{
	if(NULL != archive)
	{
		if(archive->IsKeyExists("lc.flags")) flags = archive->GetUInt32("lc.flags");
		if(archive->IsKeyExists("lc.forceDistance")) forceDistance = archive->GetFloat("lc.forceDistance");
		if(archive->IsKeyExists("lc.forceDistanceSq")) forceDistanceSq = archive->GetFloat("lc.forceDistanceSq");
		if(archive->IsKeyExists("lc.forceLodLayer")) forceLodLayer = archive->GetInt32("lc.forceLodLayer");

		KeyedArchive *lodDistArch = archive->GetArchive("lc.loddist");
		if(NULL != lodDistArch)
		{
			for(uint32 i = 0; i < MAX_LOD_LAYERS; ++i)
			{
				KeyedArchive *lodDistValuesArch = lodDistArch->GetArchive(KeyedArchive::GenKeyFromIndex(i));
				if(NULL != lodDistValuesArch)
				{
					lodLayersArray[i].distance = lodDistValuesArch->GetFloat("ld.distance");
					lodLayersArray[i].nearDistance = lodDistValuesArch->GetFloat("ld.neardist");
					lodLayersArray[i].farDistance = lodDistValuesArch->GetFloat("ld.fardist");
					lodLayersArray[i].nearDistanceSq = lodDistValuesArch->GetFloat("ld.neardistsq");
					lodLayersArray[i].farDistanceSq = lodDistValuesArch->GetFloat("ld.fardistsq");
				}
			}
		}

		KeyedArchive *lodDataArch = archive->GetArchive("lc.loddata");
		if(NULL != lodDataArch)
		{
			for(uint32 i = 0; i < archive->GetUInt32("lc.loddatacount"); ++i)
			{
				KeyedArchive *lodDataValuesArch = lodDataArch->GetArchive(KeyedArchive::GenKeyFromIndex(i));
				if(NULL != lodDataValuesArch)
				{
					LodData data;

					if(lodDataValuesArch->IsKeyExists("layer")) data.layer = lodDataValuesArch->GetInt32("layer");
					if(lodDataValuesArch->IsKeyExists("isdummy")) data.isDummy = lodDataValuesArch->GetBool("isdummy");

					KeyedArchive *lodDataIndexesArch = lodDataValuesArch->GetArchive("indexes");
					if(NULL != lodDataIndexesArch)
					{
						for(uint32 j = 0; j < lodDataValuesArch->GetUInt32("indexescount"); ++j)
						{
							data.indexes.push_back(lodDataIndexesArch->GetInt32(KeyedArchive::GenKeyFromIndex(j)));
						}
					}

					lodLayers.push_back(data);
				}
			}
		}
	}

	flags |= NEED_UPDATE_AFTER_LOAD;
	Component::Deserialize(archive, sceneFile);
}
开发者ID:boyjimeking,项目名称:dava.framework,代码行数:57,代码来源:LodComponent.cpp


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