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


C++ Landscape::GetBoundingBox方法代码示例

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


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

示例1: ShowEditorLandscape

bool LandscapesController::ShowEditorLandscape(EditorLandscape *displayingLandscape)
{
	Landscape *landscape = EditorScene::GetLandscape(scene);
	if (!landscape)
    {
        Logger::Error("[LandscapesController::ShowEditorLandscape] Can be only one landscape");
        return false;
    }
	
    displayingLandscape->SetNestedLandscape(landscape);
    
    if(!landscapeRenderer)
    {
        renderedHeightmap = new EditorHeightmap(landscape->GetHeightmap());
        landscapeRenderer = new LandscapeRenderer(renderedHeightmap, landscape->GetBoundingBox());

        displayingLandscape->SetHeightmap(renderedHeightmap);
    }
    displayingLandscape->SetRenderer(landscapeRenderer);
	
	//TODO: remove SetWorldTransformPtr
	displayingLandscape->SetWorldTransformPtr(landscape->GetWorldTransformPtr());
	Entity* lanscapeNode = EditorScene::GetLandscapeNode(scene);
	
	lanscapeNode->RemoveComponent(Component::RENDER_COMPONENT);
	RenderComponent* component = new RenderComponent(displayingLandscape);
	lanscapeNode->AddComponent(component);

    currentLandscape = displayingLandscape;
    return true;
}
开发者ID:vilonosec,项目名称:dava.framework,代码行数:31,代码来源:LandscapesController.cpp

示例2: PreparePath

void Test::PreparePath()
{
	SettingsManager *settings = SettingsManager::Instance();

	int32 partX = settings->GetLandscapePartitioning().x;
	int32 partY = settings->GetLandscapePartitioning().y;
	
    Landscape *land = GetLandscape();
	AABBox3 boundingBox = land->GetBoundingBox();
	Vector3 min = boundingBox.min;
	Vector3 max = boundingBox.max;
	
	float32 landWidth = max.x - min.x;
	float32 landLength = max.y - min.y;
	
	Vector2 rectSize(landWidth / partX, landLength / partY);
	
	int32 x = 0;
	int32 xDir = 1;
	for(int32 y = 0; y < partY; ++y)
    {
		Rect curRect;
		for(int32 i = 0; i < partX; ++i, x += xDir)
        {
			Vector2 v;
			v.Set(min.x + x * rectSize.x, min.y + y * rectSize.y);
			curRect.SetPosition(v);
			curRect.SetSize(rectSize);
            rectSequence.push_back(curRect);
		}
		x -= xDir;
		xDir = -xDir;
	}
}
开发者ID:vilonosec,项目名称:dava.framework,代码行数:34,代码来源:Test.cpp

示例3: PrepareFpsStat

void Test::PrepareFpsStat()
{
	testData.Clear();
	fpsStatItem.rect = rectSequence[testData.GetItemCount()];

    Landscape *land = GetLandscape();
	AABBox3 boundingBox = land->GetBoundingBox();
	
	Vector2 landPos(boundingBox.min.x, boundingBox.min.y);
	Vector2 landSize((boundingBox.max - boundingBox.min).x,
					 (boundingBox.max - boundingBox.min).x);

	testData.SetLandscapeRect(Rect(landPos, landSize));
}
开发者ID:vilonosec,项目名称:dava.framework,代码行数:14,代码来源:Test.cpp


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