本文整理汇总了C++中Viewport::SetCamera方法的典型用法代码示例。如果您正苦于以下问题:C++ Viewport::SetCamera方法的具体用法?C++ Viewport::SetCamera怎么用?C++ Viewport::SetCamera使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Viewport
的用法示例。
在下文中一共展示了Viewport::SetCamera方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddCamera
Viewport* Target::AddCamera( Camera* pCamera, U32 uiZOrder /*= 0*/, Real x /*= 0.0f*/, Real y /*= 0.0f*/, Real w /*= 0.0f*/, Real h /*= 0.0f*/ ){
if(pCamera == NULL)
return NULL;
pCamera->AddPhaseFlag(m_PhaseOpt.flag);
ViewportMap::iterator i = m_mapViewport.find(uiZOrder);
if(i!=m_mapViewport.end()){
SAF_D(i->second);
}
Viewport* pVP = new Viewport(w,h,x,y);
pVP->SetTarget(this);
pVP->SetCamera(pCamera);
m_mapViewport[uiZOrder] = pVP;
return pVP;
}
示例2: main
int main ()
{
printf ("Results of scene_input_self_remove_test:\n");
try
{
Scene scene;
OrthoCamera::Pointer camera = OrthoCamera::Create ();
camera->SetLeft (0);
camera->SetRight (100);
camera->SetTop (0);
camera->SetBottom (-100);
camera->SetZNear (-1);
camera->SetZFar (1);
camera->Translate (0.0f, 0.0f, 1.0f);
camera->BindToScene (scene);
zone = InputZone::Create ();
additional_zone = InputZone::Create ();
zone->SetName ("zone1");
zone->Translate (50.0f, -50.0f, 0.0f);
zone->SetScale (10.0f, 10.0f, 1.0f);
zone->RegisterNotificationHandler (&input_notify);
zone->BindToScene (scene);
additional_zone->SetName ("zone2");
additional_zone->RegisterNotificationHandler (&input_notify);
additional_zone->BindToScene (scene);
Screen screen;
Viewport viewport;
viewport.SetCamera (camera.get ());
viewport.SetArea (100, 100, 800, 800);
screen.SetArea (0, 0, 1000, 1000);
screen.Attach (viewport);
SceneInputManager manager;
manager.SetScreen (&screen);
manager.SetTouchSize (2.0f, InputTransformSpace_Camera);
manager.ProcessEvent ("CursorX axis 0");
manager.ProcessEvent ("CursorY axis 0");
manager.ProcessEvent ("Mouse0 down");
manager.ProcessEvent ("Mouse0 up");
printf ("exit\n");
fflush (stdout);
}
catch (std::exception& e)
{
printf ("%s\n", e.what ());
}
return 0;
}