本文整理汇总了C++中Pane::GetFBOSize方法的典型用法代码示例。如果您正苦于以下问题:C++ Pane::GetFBOSize方法的具体用法?C++ Pane::GetFBOSize怎么用?C++ Pane::GetFBOSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pane
的用法示例。
在下文中一共展示了Pane::GetFBOSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendMouseMotion
///@brief Override HMD gaze direction and Hydra mouse motion action for a limited
/// time after each mouse motion input event.
void PaneScene::SendMouseMotion(int x, int y)
{
if (m_bDraw == false)
return;
if (m_panes.empty())
return;
// Pass mouse events only to the first pane in the set(AntPane for DashboardScene)
std::vector<Pane*>::iterator it = m_panes.begin();
Pane* pP = *it;
if (pP == NULL)
return;
const glm::ivec2 fbsz = pP->GetFBOSize();
const glm::vec2 normPt(
static_cast<float>(x) / static_cast<float>(fbsz.x),
static_cast<float>(y) / static_cast<float>(fbsz.y));
pP->m_pointerCoords = normPt;
pP->m_cursorInPane = true;
pP->OnMouseMove(x, y);
m_mouseMotionCooldown.reset();
}
示例2: timestep
void PaneScene::timestep(double absTime, double dt)
{
if (m_bDraw == false)
return;
for (std::vector<Pane*>::iterator it = m_panes.begin();
it != m_panes.end();
++it)
{
Pane* pP = *it;
if (pP == NULL)
continue;
pP->timestep(absTime, dt);
if (pP->m_holdState.m_holding)
{
_SetHeldPanePositionAndOrientation(pP);
}
// Leave mouse alone for one second to resume HMD gaze controls.
if (m_mouseMotionCooldown.seconds() < 1.f)
continue;
pP->m_cursorInPane = false;
glm::vec2 hmdPt(0.0f);
float tHmd = 0.f;
const bool hmdInPane = _GetHmdViewRayIntersectionCoordinates(pP, hmdPt, tHmd);
if (hmdInPane)
{
pP->m_pointerCoords = hmdPt;
pP->m_cursorInPane = true;
}
#ifdef USE_SIXENSE
glm::vec2 fmPt(0.0f);
float tHydra = 0.f;
bool fmInPane = _GetFlyingMouseRightHandPaneRayIntersectionCoordinates(pP, fmPt, tHydra);
if (fmInPane)
{
pP->m_pointerCoords = fmPt;
pP->m_cursorInPane = true;
}
#endif
pP->m_tx.m_lock = !pP->m_cursorInPane;
{
const glm::ivec2 fbsz = pP->GetFBOSize();
const int mx = static_cast<int>( pP->m_pointerCoords.x * static_cast<float>(fbsz.x) );
const int my = static_cast<int>( pP->m_pointerCoords.y * static_cast<float>(fbsz.y) );
pP->OnMouseMove(mx, my);
#ifdef USE_SIXENSE
if (m_pFm->WasJustPressed(FlyingMouse::Right, SIXENSE_BUTTON_1))
{
pP->OnMouseClick(1, mx, my);
}
else if (m_pFm->WasJustReleased(FlyingMouse::Right, SIXENSE_BUTTON_1))
{
pP->OnMouseClick(0, mx, my);
}
#endif
}
}
}