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


C++ LandscapeNode::SetFogDensity方法代码示例

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


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

示例1: OnFloatPropertyChanged

void LandscapePropertyControl::OnFloatPropertyChanged(PropertyList *forList, const String &forKey, float newValue)
{
    if("property.landscape.size" == forKey || "property.landscape.height" == forKey)
    {
        LandscapeNode *landscape = dynamic_cast<LandscapeNode*> (currentSceneNode);
        
        Vector3 size(
                     propertyList->GetFloatPropertyValue("property.landscape.size"),
                     propertyList->GetFloatPropertyValue("property.landscape.size"),
                     propertyList->GetFloatPropertyValue("property.landscape.height"));
        AABBox3 bbox;
        bbox.AddPoint(Vector3(-size.x/2.f, -size.y/2.f, 0.f));
        bbox.AddPoint(Vector3(size.x/2.f, size.y/2.f, size.z));
        
        
        String heightMap = propertyList->GetFilepathPropertyValue("property.landscape.heightmap");
        if(EditorSettings::IsValidPath(heightMap) && heightMap.length())
        {
            landscape->BuildLandscapeFromHeightmapImage(heightMap, bbox);
        }
    }
    if ("property.landscape.texture0.tilex" == forKey || "property.landscape.texture0.tiley" == forKey)
    {
        LandscapeNode *landscape = dynamic_cast<LandscapeNode*> (currentSceneNode);
        Vector2 tiling(propertyList->GetFloatPropertyValue("property.landscape.texture0.tilex"),
                       propertyList->GetFloatPropertyValue("property.landscape.texture0.tiley"));
        landscape->SetTextureTiling(LandscapeNode::TEXTURE_TILE0, tiling);
    }
    if ("property.landscape.texture1.tilex" == forKey || "property.landscape.texture1.tiley" == forKey)
    {
        LandscapeNode *landscape = dynamic_cast<LandscapeNode*> (currentSceneNode);
        Vector2 tiling(propertyList->GetFloatPropertyValue("property.landscape.texture1.tilex"),
                       propertyList->GetFloatPropertyValue("property.landscape.texture1.tiley"));
        landscape->SetTextureTiling(LandscapeNode::TEXTURE_TILE1, tiling);
    }
	if ("property.landscape.texture2.tilex" == forKey || "property.landscape.texture2.tiley" == forKey)
	{
		LandscapeNode *landscape = dynamic_cast<LandscapeNode*> (currentSceneNode);
		Vector2 tiling(propertyList->GetFloatPropertyValue("property.landscape.texture2.tilex"),
			propertyList->GetFloatPropertyValue("property.landscape.texture2.tiley"));
		landscape->SetTextureTiling(LandscapeNode::TEXTURE_TILE2, tiling);
	}
	if ("property.landscape.texture3.tilex" == forKey || "property.landscape.texture3.tiley" == forKey)
	{
		LandscapeNode *landscape = dynamic_cast<LandscapeNode*> (currentSceneNode);
		Vector2 tiling(propertyList->GetFloatPropertyValue("property.landscape.texture3.tilex"),
			propertyList->GetFloatPropertyValue("property.landscape.texture3.tiley"));
		landscape->SetTextureTiling(LandscapeNode::TEXTURE_TILE3, tiling);
	}
    
    if ("property.material.dencity" == forKey)
    {
		LandscapeNode *landscape = dynamic_cast<LandscapeNode*> (currentSceneNode);
        landscape->SetFogDensity(newValue);
    }

    NodesPropertyControl::OnFloatPropertyChanged(forList, forKey, newValue);
}
开发者ID:,项目名称:,代码行数:58,代码来源:

示例2: SetupFog

void MaterialEditor::SetupFog(bool enabled, float32 dencity, const DAVA::Color &newColor)
{
    for(int32 i = 0; i < (int32)materials.size(); ++i)
    {
        materials[i]->SetFog(enabled);
        materials[i]->SetFogDensity(dencity);
        materials[i]->SetFogColor(newColor);
    }
    
    if(workingScene)
    {
        EditorScene *editorScene = dynamic_cast<EditorScene *>(workingScene);
        if(editorScene)
        {
            LandscapeNode *landscape = editorScene->GetLandscape(editorScene);
            if (landscape)
            {
                landscape->SetFog(enabled);
                landscape->SetFogDensity(dencity);
                landscape->SetFogColor(newColor);
            }
        }
    }
}
开发者ID:abaradulkin,项目名称:dava.framework,代码行数:24,代码来源:MaterialEditor.cpp

示例3: OnFloatPropertyChanged

void LandscapePropertyControl::OnFloatPropertyChanged(PropertyList *forList, const String &forKey, float newValue)
{
    if("property.landscape.size" == forKey || "property.landscape.height" == forKey)
    {
		LandscapeNode *landscape = GetLandscape();
		if (landscape)
		{
			Vector3 size(
						 propertyList->GetFloatPropertyValue("property.landscape.size"),
						 propertyList->GetFloatPropertyValue("property.landscape.size"),
						 propertyList->GetFloatPropertyValue("property.landscape.height"));
			AABBox3 bbox;
			bbox.AddPoint(Vector3(-size.x/2.f, -size.y/2.f, 0.f));
			bbox.AddPoint(Vector3(size.x/2.f, size.y/2.f, size.z));
			
			Set<String> errorsLog;
			String heightMap = propertyList->GetFilepathPropertyValue("property.landscape.heightmap");
			if(SceneValidator::Instance()->ValidateHeightmapPathname(heightMap, errorsLog) && heightMap.length())
			{
				landscape->BuildLandscapeFromHeightmapImage(heightMap, bbox);
			}
        }
    }
    if ("property.landscape.texture0.tilex" == forKey || "property.landscape.texture0.tiley" == forKey)
    {
		LandscapeNode *landscape = GetLandscape();
		if (landscape)
		{
			Vector2 tiling(propertyList->GetFloatPropertyValue("property.landscape.texture0.tilex"),
						   propertyList->GetFloatPropertyValue("property.landscape.texture0.tiley"));
			landscape->SetTextureTiling(LandscapeNode::TEXTURE_TILE0, tiling);
		}
    }
    if ("property.landscape.texture1.tilex" == forKey || "property.landscape.texture1.tiley" == forKey)
    {
		LandscapeNode *landscape = GetLandscape();
		if (landscape)
		{
			Vector2 tiling(propertyList->GetFloatPropertyValue("property.landscape.texture1.tilex"),
						   propertyList->GetFloatPropertyValue("property.landscape.texture1.tiley"));
			landscape->SetTextureTiling(LandscapeNode::TEXTURE_TILE1, tiling);
		}
    }
	if ("property.landscape.texture2.tilex" == forKey || "property.landscape.texture2.tiley" == forKey)
	{
		LandscapeNode *landscape = GetLandscape();
		if (landscape)
		{
			Vector2 tiling(propertyList->GetFloatPropertyValue("property.landscape.texture2.tilex"),
				propertyList->GetFloatPropertyValue("property.landscape.texture2.tiley"));
			landscape->SetTextureTiling(LandscapeNode::TEXTURE_TILE2, tiling);
		}
	}
	if ("property.landscape.texture3.tilex" == forKey || "property.landscape.texture3.tiley" == forKey)
	{
		LandscapeNode *landscape = GetLandscape();
		if (landscape)
		{
			Vector2 tiling(propertyList->GetFloatPropertyValue("property.landscape.texture3.tilex"),
				propertyList->GetFloatPropertyValue("property.landscape.texture3.tiley"));
			landscape->SetTextureTiling(LandscapeNode::TEXTURE_TILE3, tiling);
		}
	}
    
    if ("property.material.dencity" == forKey)
    {
		LandscapeNode *landscape = GetLandscape();
		if (landscape)
			landscape->SetFogDensity(newValue);
    }

    NodesPropertyControl::OnFloatPropertyChanged(forList, forKey, newValue);
}
开发者ID:abaradulkin,项目名称:dava.framework,代码行数:73,代码来源:LandscapePropertyControl.cpp


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