本文整理汇总了C++中Landscape::GetHeightmapPathname方法的典型用法代码示例。如果您正苦于以下问题:C++ Landscape::GetHeightmapPathname方法的具体用法?C++ Landscape::GetHeightmapPathname怎么用?C++ Landscape::GetHeightmapPathname使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Landscape
的用法示例。
在下文中一共展示了Landscape::GetHeightmapPathname方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SyncFoliageWithLandscape
void FoliageSystem::SyncFoliageWithLandscape()
{
if(landscapeEntity && foliageEntity)
{
Landscape* landscapeRO = GetLandscape(landscapeEntity);
VegetationRenderObject* vegetationRO = GetVegetation(foliageEntity);
vegetationRO->SetHeightmap(landscapeRO->GetHeightmap());
vegetationRO->SetHeightmapPath(landscapeRO->GetHeightmapPathname());
vegetationRO->SetWorldSize(Vector3(landscapeRO->GetLandscapeSize(),
landscapeRO->GetLandscapeSize(),
landscapeRO->GetLandscapeHeight()));
}
}
示例2: SaveScene
void SceneSaver::SaveScene(Scene *scene, const FilePath &fileName, Set<String> &errorLog)
{
DVASSERT(0 == texturesForSave.size())
String relativeFilename = fileName.GetRelativePathname(sceneUtils.dataSourceFolder);
sceneUtils.workingFolder = fileName.GetDirectory().GetRelativePathname(sceneUtils.dataSourceFolder);
FileSystem::Instance()->CreateDirectory(sceneUtils.dataFolder + sceneUtils.workingFolder, true);
scene->Update(0.1f);
FilePath oldPath = SceneValidator::Instance()->SetPathForChecking(sceneUtils.dataSourceFolder);
SceneValidator::Instance()->ValidateScene(scene, errorLog);
texturesForSave.clear();
SceneDataManager::EnumerateTextures(scene, texturesForSave);
CopyTextures(scene, errorLog);
ReleaseTextures();
Landscape *landscape = EditorScene::GetLandscape(scene);
if (landscape)
{
sceneUtils.CopyFile(landscape->GetHeightmapPathname(), errorLog);
}
CopyReferencedObject(scene, errorLog);
CopyEffects(scene, errorLog);
CopyCustomColorTexture(scene, fileName.GetDirectory(), errorLog);
//save scene to new place
FilePath tempSceneName = sceneUtils.dataSourceFolder + relativeFilename;
tempSceneName.ReplaceExtension(".saved.sc2");
SceneFileV2 * outFile = new SceneFileV2();
outFile->EnableSaveForGame(true);
outFile->EnableDebugLog(false);
outFile->SaveScene(tempSceneName, scene);
SafeRelease(outFile);
bool moved = FileSystem::Instance()->MoveFile(tempSceneName, sceneUtils.dataFolder + relativeFilename, true);
if(!moved)
{
errorLog.insert(Format("Can't move file %s", fileName.GetAbsolutePathname().c_str()));
}
SceneValidator::Instance()->SetPathForChecking(oldPath);
}
示例3: UpdateLandscapeHeightmap
void HeightmapModificationCommand::UpdateLandscapeHeightmap(String filename)
{
SceneData *activeScene = SceneDataManager::Instance()->SceneGetActive();
LandscapesController* landscapesController = activeScene->GetLandscapesController();
Landscape* landscapeNode = landscapesController->GetCurrentLandscape();
Heightmap* heightmap = new Heightmap();
heightmap->Load(filename);
landscapeNode->SetHeightmap(heightmap);
heightmap->Save(landscapeNode->GetHeightmapPathname());
SafeRelease(heightmap);
}