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


C++ CEngine类代码示例

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


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

示例1: graphics

DWORD WINAPI graphics(LPVOID Param)
{
	Params* params = (Params*)Param;
	CEngine* engine = (params->engine);
	
	float index = 0.0f;
	
	engine->SetPerspective(D3DX_PI/4,1.0f,100.0f);
	D3DXMatrixLookAtLH(&(engine->matView),
                   &D3DXVECTOR3 (0.0f, 0.0f, -10.0f),    // eye
                   &D3DXVECTOR3 (0.0f, 0.0f, 0.0f),    // at
                   &D3DXVECTOR3 (0.0f, 1.0f, 0.0f));    // up
	engine->d3ddev->SetTransform(D3DTS_VIEW, &(engine->matView));


	while (params->notQuit) {
		engine->Clear();
		engine->Begin();
		
	    

		for(list<CObject*>::iterator it = params->scene->lstChilds.begin(); it != params->scene->lstChilds.end(); ++it)
		{
			(*it)->update();
			//cout << "posX: " << (*it)->vehicle.getPos().x << "posY: " << (*it)->vehicle->getPos().y << "posZ: " << (*it)->vehicle->getPos().z << endl;
		}
		engine->End();
	}
	return 0;
}
开发者ID:vdelgadov,项目名称:itcvideogame,代码行数:30,代码来源:Graphics.cpp

示例2: CameraMove

void CUsingControllersView::OnMouseMove(UINT nFlags, CPoint point)
{
	if (m_MouseNavigation)
	{
	Ogre::Vector3 CameraMove(0.0, 0.0, 0.0);

	CameraMove[0] = -(m_MousePosition.x - point.x);
	CameraMove[1] = m_MousePosition.y - point.y;

	CEngine * Engine = ((CUsingControllersApp*)AfxGetApp())->m_Engine;
	if (Engine == NULL)
		return;
	Ogre::Root *Root = Engine->GetRoot();
	if (m_Camera == NULL)
		return;
	Ogre::Vector3 OldPosition = m_Camera->getPosition();
	m_Camera->moveRelative(CameraMove);
		
	m_MousePosition = point;

	Root->renderOneFrame();
	}

	CView::OnMouseMove(nFlags, point);
}
开发者ID:southerlies,项目名称:OGRE-3D-1.7-Application-Development-Cookbook-Code,代码行数:25,代码来源:UsingControllersView.cpp

示例3: CameraMove

void COrbitViewView::OnMouseMove(UINT nFlags, CPoint point)
{
	Ogre::Vector3 CameraMove(0.0, 0.0, 0.0);

	CEngine * Engine = ((COrbitViewApp*)AfxGetApp())->m_Engine;
	if (Engine == NULL)
	  return;
	Ogre::Root *Root = Engine->GetRoot();
	if (m_Camera == NULL)
	  return;

	if (m_MouseNavigation)
	{
	if (m_Orbit)
	{
		Ogre::SceneNode* CameraNode = m_SceneManager->getSceneNode("CameraNode");
		CameraMove[1] = m_MousePosition.y - point.y;
		m_Camera->moveRelative(CameraMove);
		CameraNode->yaw(Ogre::Radian(0.01 * (m_MousePosition.x - point.x)));
	}
	else
	{
		CameraMove[0] = -(m_MousePosition.x - point.x);
		CameraMove[1] = m_MousePosition.y - point.y;
		m_Camera->moveRelative(CameraMove);
	}

		m_MousePosition = point;
		Root->renderOneFrame();
	}

	CView::OnMouseMove(nFlags, point);
}
开发者ID:southerlies,项目名称:OGRE-3D-1.7-Application-Development-Cookbook-Code,代码行数:33,代码来源:OrbitViewView.cpp

示例4: F2

void F2()
{
  wstring input_path = L"./Scripts/1.essay";
  ifstream ifs(input_path);

  try
  {
    CEngine engine;

    if (ifs.good())
    {
      auto c = engine.Run(ifs);
      auto context = engine.GetContext();

      auto a = context.GetVariable(L"Business.a").IsAvailable();

      for (int i = 0; i < context.GetSyntaxVector().size(); i++)
      {
        auto syntax = context.GetSyntax(i);
      }
    }
  }
  catch (CException& e)
  {
    auto r = e.ToString();
  }
}
开发者ID:ArcaneSoftware,项目名称:Dominion,代码行数:27,代码来源:Main.cpp

示例5: main

int main(int argc, char *argv[])
{
	CEngine *Engine = CEngine::Instance();
	Engine->SetProgramName("Color lines");
	Engine->SetStateHandler<CCustomStateHandler>();
	Engine->Run(argc, argv);
	return EXIT_SUCCESS;
}
开发者ID:rotanov,项目名称:deku2d-engine,代码行数:8,代码来源:main.cpp

示例6: OnTimer

void CUsingControllersView::OnTimer(UINT_PTR nIDEvent)
{
	CEngine *Engine = ((CUsingControllersApp*)AfxGetApp())->m_Engine;
	Ogre::Root *Root = Engine->GetRoot();
    Root->renderOneFrame();

	CView::OnTimer(nIDEvent);
}
开发者ID:southerlies,项目名称:OGRE-3D-1.7-Application-Development-Cookbook-Code,代码行数:8,代码来源:UsingControllersView.cpp

示例7: OnTimer

void COrbitViewView::OnTimer(UINT_PTR nIDEvent)
{
	m_WalkAnimation->addTime(0.001);

	CEngine *Engine = ((COrbitViewApp*)AfxGetApp())->m_Engine;
	Ogre::Root *Root = Engine->GetRoot();
    Root->renderOneFrame();

	CView::OnTimer(nIDEvent);
}
开发者ID:southerlies,项目名称:OGRE-3D-1.7-Application-Development-Cookbook-Code,代码行数:10,代码来源:OrbitViewView.cpp

示例8: OnTimer

void CLinkedAnimationView::OnTimer(UINT_PTR nIDEvent)
{
	CEngine *Engine = ((CLinkedAnimationApp*)AfxGetApp())->m_Engine;
	Ogre::Root *Root = Engine->GetRoot();

	m_AnimationState1->addTime(0.01);
	m_AnimationState2->addTime(0.01);

	Root->renderOneFrame();
	CView::OnTimer(nIDEvent);
}
开发者ID:southerlies,项目名称:OGRE-3D-1.7-Application-Development-Cookbook-Code,代码行数:11,代码来源:LinkedAnimationView.cpp

示例9: OnTimer

void CBlendingAnimationsView::OnTimer(UINT_PTR nIDEvent)
{
	CEngine *Engine = ((CBlendingAnimationsApp*)AfxGetApp())->m_Engine;			
	Ogre::Root *Root = Engine->GetRoot();
	Ogre::SceneNode *RobotNode = Root->getSceneManager("Walking")->getSceneNode("Robot");

	Ogre::Entity *RobotEntity = Root->getSceneManager("Walking")->getEntity("Robot");
	Ogre::Skeleton *Skeleton = RobotEntity->getSkeleton();

	if (m_WeightDlg->m_IsAverage)
	{
		Skeleton->setBlendMode(Ogre::SkeletonAnimationBlendMode::ANIMBLEND_AVERAGE);
	}
	else
	{
		Skeleton->setBlendMode(Ogre::SkeletonAnimationBlendMode::ANIMBLEND_CUMULATIVE);
	}

	double WalkWeight;
	double SlumpWeight;

	switch(nIDEvent)
	{
	case 1:
	
		WalkWeight = m_WeightDlg->m_WalkWeight.GetPos() / 10.0;
		SlumpWeight = m_WeightDlg->m_SlumpWeight.GetPos() / 10.0;

		m_WalkAnimation->setWeight(WalkWeight);
		m_SlumpAnimation->setWeight(SlumpWeight);
		
		m_WalkAnimation->addTime(0.01);
		m_SlumpAnimation->addTime(0.01);

		break;
	
	case 2:

		m_WalkAnimation->addTime(0.01);

	break;

	case 3:
		
		m_SlumpAnimation->addTime(0.01);

		break;
	}

	Root->renderOneFrame();
	CView::OnTimer(nIDEvent);
}
开发者ID:southerlies,项目名称:OGRE-3D-1.7-Application-Development-Cookbook-Code,代码行数:52,代码来源:BlendingAnimationsView.cpp

示例10: OnTimer

void CSceletalAnimationView::OnTimer(UINT_PTR nIDEvent)
{
	CEngine *Engine = ((CSceletalAnimationApp*)AfxGetApp())->m_Engine;		
	Ogre::Root *Root = Engine->GetRoot();
	Ogre::SceneManager *SceneManager = Root->getSceneManager("Animation");
	Ogre::Entity *Entity = SceneManager->getEntity("Animation");
	Ogre::Skeleton *Skeleton = Entity->getSkeleton();

	m_AnimationState->addTime(0.1);
	Root->renderOneFrame();

	CView::OnTimer(nIDEvent);
}
开发者ID:southerlies,项目名称:OGRE-3D-1.7-Application-Development-Cookbook-Code,代码行数:13,代码来源:SceletalAnimationView.cpp

示例11: GetEngSubsystems

//------------------------------------------------------------------------
//  Get engines system
//------------------------------------------------------------------------
void CFuiProbe::GetEngSubsystems()
{ std::vector<CEngine *>engs;           // List of engines
  veh->eng.GetAllEngines(engs);
  std::vector<CEngine*>::iterator si;
  for (si = engs.begin(); si != engs.end(); si++)
  { CEngine   *eng = (*si);
    AddSubsystem(eng);
    CDependent *dp1 = eng->GetPart(1);
    if (dp1) AddSubsystem(dp1);
    CDependent *dp2 = eng->GetPart(2);
    if (dp2) AddSubsystem(dp2);
  }
  engs.clear();
  return;
}
开发者ID:FlySimvol,项目名称:FlyLegacy,代码行数:18,代码来源:WindowProbe.cpp

示例12: main

int main( int argc, char* args[] )
{
    CEngine* engine = new CEngine( 640, 480, "Evolution-Simulator" );
    CRenderer& renderer = *engine->getRenderer();
    CGame* game = new CGame( engine );

    game->start();
    while ( game->running ) {
        game->update();
    }
    
    delete engine;
    delete game;
    SDL_Quit();

    return 0;
}
开发者ID:stanthesoupking,项目名称:Evolution-Simulator,代码行数:17,代码来源:main.cpp

示例13: CameraMove

BOOL CSceneEditorView::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
{
	// TODO: Add your message handler code here and/or call default
	Ogre::Vector3 CameraMove(0.0, 0.0, 0.0);

	CameraMove[2] = 1 * zDelta;

	CEngine * Engine = ((CSceneEditorApp*)AfxGetApp())->m_Engine;
	if (Engine == NULL)
		return false;
	Ogre::Root *Root = Engine->GetRoot();
	if (m_Camera == NULL)
		return false;
	m_Camera->moveRelative(CameraMove);

	return CView::OnMouseWheel(nFlags, zDelta, pt);
}
开发者ID:ajinkyapisal,项目名称:DSimulator,代码行数:17,代码来源:SceneEditorView.cpp

示例14: CameraMove

BOOL CTransparentMaterialView::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
{
	Ogre::Vector3 CameraMove(0.0, 0.0, 0.0);

	CameraMove[2] = 0.1 * zDelta;

	CEngine * Engine = ((CTransparentMaterialApp*)AfxGetApp())->m_Engine;
	if (Engine == NULL)
		return false;
	Ogre::Root *Root = Engine->GetRoot();
	if (m_Camera == NULL)
		return false;
	m_Camera->moveRelative(CameraMove);

	Root->renderOneFrame();
	return CView::OnMouseWheel(nFlags, zDelta, pt);
}
开发者ID:southerlies,项目名称:OGRE-3D-1.7-Application-Development-Cookbook-Code,代码行数:17,代码来源:TransparentMaterialView.cpp

示例15: OnBnClickedSunAction

void CSunControlDlg::OnBnClickedSunAction()
{
	CMainFrame *MainFrame = (CMainFrame *)((CWeatherControlApp*)AfxGetApp())->GetMainWnd();
	CWeatherControlView *View = (CWeatherControlView *)MainFrame->GetActiveView();
  	CEngine *Engine = ((CWeatherControlApp*)AfxGetApp())->m_Engine;
	Ogre::Root *Root = Engine->GetRoot();

	View->m_Sun->setVisible(!View->m_Sun->getVisible());

	if (View->m_Sun->getVisible())
	{
		m_Action.SetWindowTextA("Stop");
		View->SetTimer(ID_SUN_TIMER, 1, 0);
	}
	else
	{
		m_Action.SetWindowTextA("Start");
		View->KillTimer(ID_SUN_TIMER);
	}

	Root->renderOneFrame();
}
开发者ID:southerlies,项目名称:OGRE-3D-1.7-Application-Development-Cookbook-Code,代码行数:22,代码来源:SunControlDlg.cpp


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