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


C++ Pane::GetFBOSize方法代码示例

本文整理汇总了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();
}
开发者ID:chansonyan,项目名称:RiftRay,代码行数:25,代码来源:PaneScene.cpp

示例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
        }
    }
}
开发者ID:chansonyan,项目名称:RiftRay,代码行数:66,代码来源:PaneScene.cpp


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