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


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

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


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

示例1: LoadResources

void LandscapeTestScreen::LoadResources()
{
#if 0
//    RenderManager::Instance()->EnableOutputDebugStatsEveryNFrame(30);
    RenderManager::Instance()->SetFPS(30.0);
	scene = new Scene();
    
	scene3dView = 0;
    scene3dView = new UI3DView(Rect(0, 0, 480, 320));
    //scene3dView->SetDebugDraw(true);
    scene3dView->SetScene(scene);
    scene3dView->SetInputEnabled(false);
    AddControl(scene3dView);
    
    camera = new Camera();
    scene->AddCamera(camera);
    camera->Setup(70.0f, 480.0f / 320.0f, 1.0f, 5000.0f); 
    scene->SetCurrentCamera(camera);
    camera->SetDebugFlags(SceneNode::DEBUG_DRAW_ALL);
    camera->SetUp(Vector3(0.0f, 0.0f, 1.0f));
    camera->SetPosition(Vector3(0.0f, 0.0f, 10.0f));
    scene->SetCurrentCamera(camera);
    scene->SetDebugFlags(SceneNode::DEBUG_DRAW_ALL);
 
    LandscapeNode * node = new LandscapeNode();
    AABBox3 box(Vector3(445.0f / 2.0f, 445.0f / 2.0f, 0), Vector3(-445.0f / 2.0f, -445.0f / 2.0f, 50.0f));
    
    //node->SetDebugFlags(LandscapeNode::DEBUG_DRAW_ALL);
#if 0
	node->BuildLandscapeFromHeightmapImage(LandscapeNode::RENDERING_MODE_DETAIL_SHADER, "~res:/Landscape/hmp2_1.png", box);
    
    Texture::EnableMipmapGeneration();
    node->SetTexture(LandscapeNode::TEXTURE_COLOR, "~res:/Landscape/diffuse_l2.png");
    node->SetTexture(LandscapeNode::TEXTURE_DETAIL, "~res:/Landscape/detail_gravel.png");
    Texture::DisableMipmapGeneration();

	
//     node->BuildLandscapeFromHeightmapImage(LandscapeNode::RENDERING_MODE_DETAIL_SHADER, "~res:/Landscape/hmp2_1.png", box);
//     
//     Texture::EnableMipmapGeneration();
//     node->SetTexture(LandscapeNode::TEXTURE_TEXTURE0, "~res:/Landscape/tex3.png");
//     node->SetTexture(LandscapeNode::TEXTURE_DETAIL, "~res:/Landscape/detail_gravel.png");
//     Texture::DisableMipmapGeneration();
#else
    node->BuildLandscapeFromHeightmapImage("~res:/Landscape/hmp2_1.png", box);
    
    Texture::EnableMipmapGeneration();
    node->SetTexture(LandscapeNode::TEXTURE_COLOR, "~res:/Landscape/diffuse.png");
    node->SetTexture(LandscapeNode::TEXTURE_TILE0, "~res:/Landscape/blend/d.png");
    node->SetTexture(LandscapeNode::TEXTURE_TILE1, "~res:/Landscape/blend/s.png");
    node->SetTexture(LandscapeNode::TEXTURE_TILE2, "~res:/Landscape/blend/d.png");
    node->SetTexture(LandscapeNode::TEXTURE_TILE3, "~res:/Landscape/blend/s.png");
    node->SetTexture(LandscapeNode::TEXTURE_TILE_MASK, "~res:/Landscape/blend/mask.png");
    Texture::DisableMipmapGeneration();
#endif
    
    node->SetName("landscapeNode");
    scene->AddNode(node);
    SafeRelease(node);
    
//    Sprite * sprite = Sprite::Create("~res:/Gfx/Billboards/billboards");
//    //sprite->SetPivotPoint(sprite->GetWidth() / 2.0f, sprite->GetHeight() / 2.0f);
//    SpriteNode * spriteNode = new SpriteNode(scene, sprite, 0, Vector2(0.1f, 0.1f), Vector2(sprite->GetWidth() / 2.0f, sprite->GetHeight() / 2.0f));
//    spriteNode->SetName("testSpriteNode");
//    spriteNode->SetLocalTransform(Matrix4::MakeTranslation(Vector3(0.f, 10.0f, 0.0f)));
//    spriteNode->SetDebugFlags(SceneNode::DEBUG_DRAW_ALL);
//    spriteNode->SetType(SpriteNode::TYPE_BILLBOARD);
//    scene->AddNode(spriteNode);

    
    SceneFile * file = new SceneFile();
    file->SetDebugLog(true);
    file->LoadScene("~res:/Scenes/level2/level2_445.sce", scene);
    scene->AddNode(scene->GetRootNode("~res:/Scenes/level2/level2_445.sce"));
    SafeRelease(file);

	inTouch = false;
    
	scene3dView = 0;
    scene3dView = new UI3DView(Rect(0, 0, 480, 320));
    scene3dView->SetInputEnabled(false);
    scene3dView->SetScene(scene);
    
    AddControl(scene3dView);
    
    viewXAngle = 0;
    viewYAngle = 0; 
    
	positionJoypad = new UIJoypad(Rect(0, 320 - 80, 80, 80));
    positionJoypad->GetBackground()->SetSprite("~res:/Gfx/Joypad/joypad", 0);
    positionJoypad->SetStickSprite("~res:/Gfx/Joypad/joypad", 1);
	AddControl(positionJoypad);

    angleJoypad = new UIJoypad(Rect(480 - 80, 320 - 80, 80, 80));
    angleJoypad->GetBackground()->SetSprite("~res:/Gfx/Joypad/joypad", 0);
    angleJoypad->SetStickSprite("~res:/Gfx/Joypad/joypad", 1);
	AddControl(angleJoypad);
#endif
}
开发者ID:abaradulkin,项目名称:dava.framework,代码行数:99,代码来源:LandscapeTestScreen.cpp


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