本文整理汇总了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;
}
示例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;
}
}
示例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));
}