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