예제 #1
0
void LolSceneSwitch::ChangeScene(State state)
{
	StateScenes scene = settings.scenes[state];
	if (scene.useMaps)
	{
		switch (currentMap)
		{
			case Map::SUMMONERS_RIFT:
				SetScene(scene.mapScenes.summonersRift);
				break;
			case Map::CRYSTAL_SCAR:
				SetScene(scene.mapScenes.crystalScar);
				break;
			case Map::TWISTED_TREELINE:
				SetScene(scene.mapScenes.twistedTreeline);
				break;
			case Map::HOWLING_ABYSS:
				SetScene(scene.mapScenes.howlingAbyss);
				break;
		}
	}
	else
	{
		SetScene(scene.single);
	}
}
void ScenePreviewControl::RecreateScene()
{
    if(editorScene)
    {
        SetScene(NULL);
        cameraController->SetScene(NULL);
        
        SafeRelease(editorScene);
    }
    
    editorScene = new Scene();
    SetScene(editorScene);
    cameraController->SetScene(editorScene);
}
예제 #3
0
BOOL KSceneObjectEditorDoc::OnOpenDocument(LPCTSTR lpszPathName) 
{
	MFCFramework::KSceneEditorApp* pApp = (MFCFramework::KSceneEditorApp*) AfxGetApp();
	if (pApp)
	{
		//(by dengzhihui 2006年7月6日 11:33:35
		//MFCFramework::CMainFrame* pMainFrame = (MFCFramework::CMainFrame*) pApp->m_pMainWnd;
		//)

		IEKG3DScene* pScene = NULL;
		g_pEngineManager->NewOneScene(SCENETYPE_OBJECTEDITOR, (IKG3DScene **)&pScene);//by dengzhihui Refactor 2006年11月6日
		SetScene(pScene);
		g_pEngineManager->SetFocusScene(pScene);//by dengzhihui Refactor 2006年11月6日
	}
	TCHAR str[256];
	wsprintf(str,"%s",lpszPathName);

	IEKG3DSceneObjectEditor* pObjEditor = NULL;
	m_lpScene->GetSceneObjectEditor(&pObjEditor);
	_ASSERTE(pObjEditor);
    IEKG3DSceneObjectEditor* lpObjectEdit = pObjEditor;//(KG3DSceneObjectEditor*)m_lpScene;
    lpObjectEdit->OpenObject((LPSTR)lpszPathName);
	//if(!m_lpObjectEditorScene->m_lpObject)
	//{
	//	if(FAILED(m_lpObjectEditorScene->LoadbjectFromFile(str)))
	//	{
	//		MessageBox(NULL,str,"打开文件失败",0);		
	//	}
	//}
	
	return TRUE;
}
예제 #4
0
OBSBasicTransform::OBSBasicTransform(OBSBasic *parent)
	: QDialog (parent),
	  ui      (new Ui::OBSBasicTransform),
	  main    (parent)
{
	ui->setupUi(this);

	HookWidget(ui->positionX,    DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->positionY,    DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->rotation,     DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->sizeX,        DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->sizeY,        DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->align,        COMBO_CHANGED,   SLOT(OnControlChanged()));
	HookWidget(ui->boundsType,   COMBO_CHANGED,   SLOT(OnBoundsType(int)));
	HookWidget(ui->boundsAlign,  COMBO_CHANGED,   SLOT(OnControlChanged()));
	HookWidget(ui->boundsWidth,  DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->boundsHeight, DSCROLL_CHANGED, SLOT(OnControlChanged()));

	OBSScene curScene = main->GetCurrentScene();
	SetScene(curScene);
	SetItem(FindASelectedItem(curScene));

	channelChangedSignal.Connect(obs_get_signal_handler(), "channel_change",
			OBSChannelChanged, this);
}
예제 #5
0
void App::Update(){
  // FPS=SEC/timer.GetElapsedTime();
  SPEED_FACTOR=(float)timer.GetElapsedTime()/SEC;
  timer.Start();
  scene->Update();
  if(STATUS!=1){
    switch(scene_number){
      case 0:
        SetScene(1);
        break;
      case 1:
        SetScene(0);
        break;
    }
  }
  wait(TARGET_FRAME_TIME-timer.GetElapsedTime());
}
예제 #6
0
void App::Resize(int w, int h, int dpi){
  WIDTH=w;
  HEIGHT=h;
  SCALE = w*dpi/(1000.0*90);
  g_setup(w,h);

  if(scene_number<0){
    SetScene(0);
  }
}
예제 #7
0
	/*
	=====================
	GameControl::Go
	=====================
	*/
	void GameControl::Go(Scene *s, WinStyle::CreationData data, bool commandline) {
		try {
			winData = data;
			winData.Prepare();

			renderWindow = new RenderWindow();
			renderWindow->SetupWindow(data);

#if defined(_DEBUG) && defined(WIN32)
			if (commandline) {
				ConsoleReader::Begin();
			}
#endif /* _DEBUG && WIN32 */
			
			printf("\n[PIM-version %s]\n", PIM_VERSION);
			printf("[OpenGL-version %s]\n\n", glGetString(GL_VERSION));

			Input::InstantiateSingleton();
			ShaderManager::InstantiateSingleton();
			AudioManager::InstantiateSingleton();

			SetScene(s);
			SceneTransition();

			GameLoop();

		} catch (exception &e) {
			PimWarning(e.what(), "Exception Caught");
		} catch (string &s) {
			PimWarning(s.c_str(), "Exception Caught");
		} catch (...) {
			PimWarning("Anonymous exception caught.\nNo information available.",
					   "Exception thrown");
		}

		// Clean up the scene
		if (scene) {
			delete scene;
		}

		ClearDeleteQueue();

		Input::ClearSingleton();
		ShaderManager::ClearSingleton();
		AudioManager::ClearSingleton();

#if defined(_DEBUG) && defined(WIN32)
		if (commandline) {
			ConsoleReader::ShutDown();
		}
#endif /* _DEBUG && WIN32 */

		renderWindow->KillWindow();
	}
예제 #8
0
void KSceneObjectEditorDoc::OnCloseDocument() 
{
	// TODO: Add your specialized code here and/or call the base class
	IEKG3DScene* pScene = GetScene();

	if (pScene)
	{
		g_pEngineManager->RemoveScene(pScene);//by dengzhihui Refactor 2006年11月6日
		SetScene(NULL);
	}
	
	CDocument::OnCloseDocument();
}
void ScanLineZBufferCore::Run()
{
	// 设置场景
	SetScene();
	// 投影模型到屏幕
	ProjectModelToScene();
	// 建立分类多边形表和分类边表
	BuildPolygonAndEdgeTable();
	// ScanLineZbuffer核心算法
	ScanLineZBufferAlgorithm();
	// 绘制
	DrawFrame();
}
예제 #10
0
void Application::Exit(const bool ignoreExitStep)
{
	switch(m_currentSceneName)
	{
		case SceneEnum::Scene_MainMenu :
			if(!ignoreExitStep)
				m_window->close();
		break;
		default:
			SetScene(SceneEnum::Scene_MainMenu, true);
		break;

	}
}
예제 #11
0
파일: API.cpp 프로젝트: Aslai/OBS
    virtual bool SetSceneCollection(CTSTR lpCollection, CTSTR lpScene)
    {
        assert(lpCollection && *lpCollection);

        if (!lpCollection || !*lpCollection)
            return false;

        bool success = App->SetSceneCollection(lpCollection);
        if (lpScene != NULL && success)
        {
            SetScene(lpScene, true);
        }

        return success;
    }
void Character::SetInputControlled(bool IsControlled)
{
	if(IsControlled)
	{
		if(!IsSceneDependency())
		{
			SetScene(DX::Time::SceneManager::AddToUpdate(*this));
			GetScene()->AddToInputControlled(*this);
		}
		m_oInputControlled.bActivated = true;
	}
	else
	{
		m_oInputControlled.bActivated = false;
		if(!IsSceneDependency())
		{
			if(GetScene())
			{
				GetScene()->RemoveToUpdate(this);
				SetScene(NULL);
			}
		}
	}
}
예제 #13
0
BOOL KSceneDataFlowEditorDoc::OnNewDocument()
{

	HRESULT hrRetCode = NULL;
	IEKG3DScene* pScene = NULL;

	if (!CDocument::OnNewDocument())
		return FALSE;

	{
		IEKG3DScene* pScene = NULL;
		g_pEngineManager->NewOneScene(SCENETYPE_DATAFLOWEDITOR,(IKG3DScene**)&pScene);//by dengzhihui Refactor 2006年11月6日
		if(!pScene)
		{
			MessageBox(NULL,"创建场景失败","失败",0);
			return false;
		}
		if ( FAILED( pScene->LoadFromFile("",0,0) ) )
		{
			SAFE_RELEASE( pScene );
			MessageBox(NULL,"创建场景失败","失败",0);
			return FALSE;
		}

		g_pEngineManager->SetFocusScene(pScene);//by dengzhihui Refactor 2006年11月6日
		SetScene(pScene);
	}
	//建立连接
	//pScene = GetScene();
	//KGLOG_PROCESS_ERROR(pScene);

	//hrRetCode = pScene->GetSceneSceneEditor(&pEditor);
	//KGLOG_COM_PROCESS_ERROR(hrRetCode);

	//(by dengzhihui 2006年8月4日 11:34:00
	SetModifiedFlag();
	//)
	return TRUE;
//
//Exit0:
//
//	return FALSE;
//
//	if (!CDocument::OnNewDocument())
//		return FALSE;
//	return TRUE;
}
// ***************** ScenePreviewControl *************** //
ScenePreviewControl::ScenePreviewControl(const Rect & rect)
    :   UI3DView(rect)
{
    needSetCamera = false;
    sceCamera = false;
    rootNode = NULL;
    
    editorScene = new Scene();

    // Camera setup
    cameraController = new PreviewCameraController();
    cameraController->SetRadius(10.f);
    cameraController->SetControlHeight((int32)rect.dy);
    
    SetScene(editorScene);
    cameraController->SetScene(editorScene);
}
예제 #15
0
void Application::Init(bool fullscreen)
{
	sf::VideoMode mode;
	mode.width = 800;
	mode.height = 600;
	mode.bitsPerPixel = 32;

	m_window = new sf::RenderWindow(mode,
		"AI Sandbox",
		sf::Style::Titlebar || sf::Style::Close);

	m_window->setFramerateLimit(60);

	m_inputPauseTime = 0.f;

	m_currentSceneName = SceneEnum::Scene_Invalid;

	SetScene(SceneEnum::Scene_Loading);
}
예제 #16
0
파일: Main.cpp 프로젝트: mholtkamp/vakz
int main()
{
    //SetFullScreen(1);
    SetWindowSize(1366, 768);
    Initialize();

    LevelEditor* pEditor = new LevelEditor();
    pEditor->Initialize();
    SetScene(&pEditor->m_scene);

    while ((GetStatus() & VAKZ_QUIT) == 0)
    {
        Update();

        pEditor->HandleInput();
        Render();
    }

    delete pEditor;
    pEditor = 0;

    exit(0);
}
OBSBasicTransform::OBSBasicTransform(OBSBasic *parent)
	: QDialog (parent),
	  ui      (new Ui::OBSBasicTransform),
	  main    (parent)
{
	ui->setupUi(this);

	HookWidget(ui->positionX,    DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->positionY,    DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->rotation,     DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->sizeX,        DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->sizeY,        DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->align,        COMBO_CHANGED,   SLOT(OnControlChanged()));
	HookWidget(ui->boundsType,   COMBO_CHANGED,   SLOT(OnBoundsType(int)));
	HookWidget(ui->boundsAlign,  COMBO_CHANGED,   SLOT(OnControlChanged()));
	HookWidget(ui->boundsWidth,  DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->boundsHeight, DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->cropLeft,     ISCROLL_CHANGED, SLOT(OnCropChanged()));
	HookWidget(ui->cropRight,    ISCROLL_CHANGED, SLOT(OnCropChanged()));
	HookWidget(ui->cropTop,      ISCROLL_CHANGED, SLOT(OnCropChanged()));
	HookWidget(ui->cropBottom,   ISCROLL_CHANGED, SLOT(OnCropChanged()));

	connect(ui->buttonBox->button(QDialogButtonBox::Reset),
		SIGNAL(clicked()), this, SLOT(on_resetButton_clicked()));
	connect(ui->buttonBox,
		SIGNAL(rejected()), this, SLOT(close()));

	installEventFilter(CreateShortcutFilter());

	OBSScene curScene = main->GetCurrentScene();
	SetScene(curScene);
	SetItem(FindASelectedItem(curScene));

	channelChangedSignal.Connect(obs_get_signal_handler(), "channel_change",
			OBSChannelChanged, this);
}
예제 #18
0
bool MeshViewer::OpenMesh(const char* f)
{
	if (OpenMesh::IO::read_mesh(m_Mesh,f)){
		txMesh::ConstVertexIter 
			v_it(m_Mesh.vertices_begin()),
			v_end(m_Mesh.vertices_end());
		txMesh::Point bbMin, bbMax;
		bbMin = bbMax = m_Mesh.point(v_it);
		for (; v_it!=v_end; ++v_it) {
			bbMin.minimize(m_Mesh.point(v_it));
			bbMax.maximize(m_Mesh.point(v_it));
		}
		SetScene( (Vec3f)(bbMin+bbMax)*0.5, 0.5*(bbMin-bbMax).norm());

		m_Mesh.update_normals();

		UpdateFaceIndices();

		return true;
	}

	std::cerr << "read error\n";
	return false;
}
예제 #19
0
void CSceneManager::Init()
{
	SceneIdx = 1;
	SetScene(1);
}
예제 #20
0
void CreateNodesDialog::CreateNode(ResourceEditor::eNodeType nodeType)
{
    SafeRelease(sceneNode);

    SceneData *activeScene = SceneDataManager::Instance()->SceneGetActive();
    EditorScene * editorScene = activeScene->GetScene();
	scene = editorScene;

    switch (nodeType) 
    {
        case ResourceEditor::NODE_LANDSCAPE:
            SetHeader(LocalizedString(ResourceEditor::CREATE_NODE_LANDSCAPE));
            sceneNode = new Entity();
            sceneNode->AddComponent(ScopedPtr<RenderComponent> (new RenderComponent(ScopedPtr<Landscape>(new Landscape()))));
            sceneNode->SetName(ResourceEditor::LANDSCAPE_NODE_NAME);
            break;

        case ResourceEditor::NODE_LIGHT:
        {
            SetHeader(LocalizedString(ResourceEditor::CREATE_NODE_LIGHT));
            
            //sceneNode = //EditorLightNode::CreateSceneAndEditorLight();
            sceneNode = new Entity();
            sceneNode->AddComponent(ScopedPtr<LightComponent> (new LightComponent(ScopedPtr<Light>(new Light))));
            sceneNode->SetName(ResourceEditor::LIGHT_NODE_NAME);
            break;
        }

        case ResourceEditor::NODE_SERVICE_NODE:
        {
            SetHeader(LocalizedString(ResourceEditor::CREATE_NODE_SERVICE));
            sceneNode = new Entity();
            KeyedArchive *customProperties = sceneNode->GetCustomProperties();
            customProperties->SetBool(ResourceEditor::EDITOR_IS_LOCKED, true);
            sceneNode->SetName(ResourceEditor::SERVICE_NODE_NAME);
            break;
        }

        case ResourceEditor::NODE_CAMERA:
        {
            SetHeader(LocalizedString(ResourceEditor::CREATE_NODE_CAMERA));
            sceneNode = new Entity();
            
            Camera * camera = new Camera();
            camera->SetUp(Vector3(0.0f, 0.0f, 1.0f));
            sceneNode->AddComponent(ScopedPtr<CameraComponent> (new CameraComponent(camera)));
            sceneNode->SetName(ResourceEditor::CAMERA_NODE_NAME);
            SafeRelease(camera);
        }break;

		case ResourceEditor::NODE_IMPOSTER:
			SetHeader(LocalizedString(ResourceEditor::CREATE_NODE_IMPOSTER));
			sceneNode = new ImposterNode();
			sceneNode->SetName(ResourceEditor::IMPOSTER_NODE_NAME);
			break;

		case ResourceEditor::NODE_PARTICLE_EMITTER:
		{
			SetHeader(LocalizedString(ResourceEditor::CREATE_NODE_PARTICLE_EMITTER));
			sceneNode = new Entity();
			sceneNode->SetName(ResourceEditor::PARTICLE_EMITTER_NODE_NAME);

			ParticleEmitter3D* newEmitter = new ParticleEmitter3D();

			RenderComponent * renderComponent = new RenderComponent();
			renderComponent->SetRenderObject(newEmitter);
			sceneNode->AddComponent(renderComponent);
            
            newEmitter->Release();
			renderComponent->Release();

			break;
		}

		case ResourceEditor::NODE_USER_NODE:
        {
			SetHeader(LocalizedString(ResourceEditor::CREATE_NODE_USER));
			sceneNode = new Entity();
			sceneNode->SetName(ResourceEditor::USER_NODE_NAME);
			sceneNode->AddComponent(ScopedPtr<UserComponent> (new UserComponent()));
			break;
        }

		case ResourceEditor::NODE_SWITCH_NODE:
		{
			SetHeader(LocalizedString(ResourceEditor::CREATE_NODE_SWITCH));
            sceneNode = new Entity();
			sceneNode->SetName(ResourceEditor::SWITCH_NODE_NAME);
            sceneNode->AddComponent(ScopedPtr<SwitchComponent> (new SwitchComponent()));
            
			KeyedArchive *customProperties = sceneNode->GetCustomProperties();
			customProperties->SetBool(Entity::SCENE_NODE_IS_SOLID_PROPERTY_NAME, false);
		}
			break;


		case ResourceEditor::NODE_PARTICLE_EFFECT:
		{
			SetHeader(ResourceEditor::CREATE_NODE_PARTICLE_EFFECT);

			sceneNode = new Entity();
			sceneNode->AddComponent(ScopedPtr<ParticleEffectComponent> (new ParticleEffectComponent()));
			sceneNode->SetName(ResourceEditor::PARTICLE_EFFECT_NODE_NAME);

			break;
		}

		case ResourceEditor::NODE_SKYBOX:
		{
			SetHeader(L"SkyBox");
			
			//TODO: add skybox creation code here
			break;
		}

        default:
            break;
    }

	propertyList = PropertyControlCreator::Instance()->CreateControlForNode(sceneNode, propertyRect, true);
    SafeRetain(propertyList);
	AddControl(propertyList);

	SetScene(editorScene);
    
    propertyList->ReadFrom(sceneNode);
}
예제 #21
0
SceneNode::SceneNode( SceneManager* scene, const String& name )
	: Node(name)
{
	SetScene(scene);
}
예제 #22
0
파일: Node.cpp 프로젝트: acremean/urho3d
void Node::ResetScene()
{
    SetID(0);
    SetScene(0);
    SetOwner(0);
}
예제 #23
0
int main (int argc, char* argv[])
{
	TLN_Init (640,480,0,0,1);
	TLN_CreateWindow (NULL, CWF_VSYNC);
	TLN_EnableBlur (true);
	TLN_SetLoadPath ("cycles");	

	palette = TLN_CreatePalette (256);
	palette_int = TLN_CreatePalette (256);
	SetScene (pos);

	while (TLN_ProcessWindow ())
	{
		if (TLN_GetInput (INPUT_LEFT))
		{
			if (dec == false)
			{
				dec = true;
				pos = (pos - 1 + MAX_SCENE) % MAX_SCENE;
				SetScene (pos);
			}
		}
		else
			dec = false;

		if (TLN_GetInput (INPUT_RIGHT))
		{
			if (inc == false)
			{
				inc = true;
				pos = (pos + 1) % MAX_SCENE;
				SetScene (pos);
			}
		}
		else
			inc = false;

		/* update palette */
		if (!(frame & 0x01))
		{
			TLN_Palette pal1, pal2;
			int t = frame % MAX_TIME;
			int idx1 = FindTimeIndex (t);
			int idx2 = (idx1 + 1) % maxpal;
			int t1 = palettes[idx1].time;
			int t2 = palettes[idx2].time;

			if (t1 > t2)
			{
				t2 += MAX_TIME;
				if (t < t1)
					t += MAX_TIME;
			}

			t -= t1;
			t2 -= t1;

			pal1 = palettes[idx1].palette;
			pal2 = palettes[idx2].palette;
			TLN_MixPalettes (pal1, pal2, palette_int, t*255/t2); /* rescale t2 to 255 */
			SetPalette (idx1);
		}

		TLN_DrawFrame (frame);
		
		frame++;
	}

	TLN_DeleteBitmap (background);
	TLN_DeletePalette (palette);
	TLN_DeletePalette (palette_int);
	TLN_DeleteWindow ();
	TLN_Deinit ();
	return 0;
}
void CreateNodesDialog::CreateNode(ResourceEditor::eNodeType nodeType)
{
    SafeRelease(sceneNode);

    SceneData *activeScene = SceneDataManager::Instance()->SceneGetActive();
    EditorScene * editorScene = activeScene->GetScene();
	scene = editorScene;

    switch (nodeType) 
    {
        case ResourceEditor::NODE_LANDSCAPE:
            SetHeader(LocalizedString(L"createnode.landscape"));
            sceneNode = new Entity();
            sceneNode->AddComponent(new RenderComponent(ScopedPtr<Landscape>(new Landscape())));
            sceneNode->SetName("Landscape");
            break;

        case ResourceEditor::NODE_LIGHT:
        {
            SetHeader(LocalizedString(L"createnode.light"));
            
            //sceneNode = //EditorLightNode::CreateSceneAndEditorLight();
            sceneNode = new Entity();
            sceneNode->AddComponent(new LightComponent(ScopedPtr<Light>(new Light)));
            sceneNode->SetName("Light");
            break;
        }

        case ResourceEditor::NODE_SERVICE_NODE:
        {
            SetHeader(LocalizedString(L"createnode.servicenode"));
            sceneNode = new Entity();
            KeyedArchive *customProperties = sceneNode->GetCustomProperties();
            customProperties->SetBool("editor.isLocked", true);
            sceneNode->SetName("Servicenode");
            break;
        }

        case ResourceEditor::NODE_CAMERA:
        {
            SetHeader(LocalizedString(L"createnode.camera"));
            sceneNode = new Entity();
            
            Camera * camera = new Camera();
            camera->SetUp(Vector3(0.0f, 0.0f, 1.0f));
            sceneNode->AddComponent(new CameraComponent(camera));
            sceneNode->SetName("Camera");
            SafeRelease(camera);
        }break;

		case ResourceEditor::NODE_IMPOSTER:
			SetHeader(LocalizedString(L"createnode.imposter"));
			sceneNode = new ImposterNode();
			sceneNode->SetName("Imposter");
			break;

		case ResourceEditor::NODE_PARTICLE_EMITTER:
		{
			SetHeader(LocalizedString(L"createnode.particleemitter"));
			sceneNode = new Entity();
			sceneNode->SetName("Particle Emitter");

			ParticleEmitter3D* newEmitter = new ParticleEmitter3D();

			RenderComponent * renderComponent = new RenderComponent();
			renderComponent->SetRenderObject(newEmitter);
			sceneNode->AddComponent(renderComponent);
            
            newEmitter->Release();

			break;
		}

		case ResourceEditor::NODE_USER_NODE:
        {
			SetHeader(LocalizedString(L"createnode.usernode"));
			sceneNode = new Entity();
			sceneNode->SetName("UserNode");
			sceneNode->AddComponent(new UserComponent());
			break;
        }

		case ResourceEditor::NODE_SWITCH_NODE:
		{
			SetHeader(LocalizedString(L"createnode.switchnode"));
            sceneNode = new Entity();
			sceneNode->SetName("SwitchNode");
            sceneNode->AddComponent(new SwitchComponent());
            
			KeyedArchive *customProperties = sceneNode->GetCustomProperties();
			customProperties->SetBool(Entity::SCENE_NODE_IS_SOLID_PROPERTY_NAME, false);
		}
			break;


		case ResourceEditor::NODE_PARTICLE_EFFECT:
		{
			SetHeader(L"Particle Effect");

			sceneNode = new Entity();
			ParticleEffectComponent* newEffectComponent = new ParticleEffectComponent();
			sceneNode->AddComponent(newEffectComponent);
			sceneNode->SetName("Particle Effect");

			break;
		}

        default:
            break;
    }

	propertyList = PropertyControlCreator::Instance()->CreateControlForNode(sceneNode, propertyRect, true);
    SafeRetain(propertyList);
	AddControl(propertyList);

	SetScene(editorScene);
    
    propertyList->ReadFrom(sceneNode);
}
예제 #25
0
void CreateNodesDialog::CreateNode(ResourceEditor::eNodeType nodeType)
{
    SafeRelease(sceneNode);

	SceneEditorScreenMain * screen = (SceneEditorScreenMain*)UIScreenManager::Instance()->GetScreen(SCREEN_SCENE_EDITOR_MAIN);
	EditorScene * editorScene = screen->FindCurrentBody()->bodyControl->GetScene();
	scene = editorScene;

    switch (nodeType) 
    {
        case ResourceEditor::NODE_LANDSCAPE:
            SetHeader(LocalizedString(L"createnode.landscape"));
            sceneNode = new LandscapeNode();
            sceneNode->SetName("Landscape");
            break;

        case ResourceEditor::NODE_LIGHT:
        {
            SetHeader(LocalizedString(L"createnode.light"));
            
            sceneNode = EditorLightNode::CreateSceneAndEditorLight();
            sceneNode->SetName("Light");
            break;
        }

        case ResourceEditor::NODE_SERVICE_NODE:
        {
            SetHeader(LocalizedString(L"createnode.servicenode"));
            sceneNode = new SceneNode();
            KeyedArchive *customProperties = sceneNode->GetCustomProperties();
            customProperties->SetBool("editor.isLocked", true);
            sceneNode->SetName("Servicenode");
            break;
        }

        case ResourceEditor::NODE_BOX:
            SetHeader(LocalizedString(L"createnode.box"));
            sceneNode = new CubeNode();
            sceneNode->SetName("Cube");
            break;

        case ResourceEditor::NODE_SPHERE:
            SetHeader(LocalizedString(L"createnode.sphere"));
            sceneNode = new SphereNode();
            sceneNode->SetName("Sphere");
            break;

        case ResourceEditor::NODE_CAMERA:
            SetHeader(LocalizedString(L"createnode.camera"));
            sceneNode = new Camera();
            ((Camera *)sceneNode)->SetUp(Vector3(0.0f, 0.0f, 1.0f));
            sceneNode->SetName("Camera");
            break;

		case ResourceEditor::NODE_IMPOSTER:
			SetHeader(LocalizedString(L"createnode.imposter"));
			sceneNode = new ImposterNode();
			sceneNode->SetName("Imposter");
			break;

		case ResourceEditor::NODE_PARTICLE_EMITTER:
		{
			SetHeader(LocalizedString(L"createnode.particleemitter"));
			ParticleEmitterNode * node = new ParticleEmitterNode();
			node->LoadFromYaml("~res:/Particles/sparkles.yaml");

			sceneNode = node;
		}
			break;

		case ResourceEditor::NODE_USER_NODE:
			SetHeader(LocalizedString(L"createnode.usernode"));
			sceneNode = new UserNode();
			sceneNode->SetName("UserNode");
			break;

            
        default:
            break;
    }

	propertyList = PropertyControlCreator::Instance()->CreateControlForNode(sceneNode, propertyRect, true);
    SafeRetain(propertyList);
	AddControl(propertyList);

	SetScene(editorScene);
    
    propertyList->ReadFrom(sceneNode);
}