ogre非缓冲消息处理
m_bMouseDown = false; //初始化
//以下在每帧中
bCurrentMouseDown = mMouse->getMouseState().buttonDown(OIS::MB_Left); //OIS::Mouse* mMouse
if(bCurrentMouseDown && !m_bMouseDown){} //鼠标左键被按下
m_bMouseDown = bCurrentMouseDown
//获取当前鼠标键盘状态
mMouse->capture();
mKeyboard->capture();
mKeyboard->isKeyDown(OIS::KC_ESCAPE); //检测某键是否被按下
//设置事件处理间隔
mToggle -= evt.timeSinceLastFrame;
if((mToggle < 0.0f) && mKeyboard->isKeyDown(OIS::KC_1))
{
mToggle = 0.5f; //此处表示间隔为0.5s
//...
//...
}
//摄像机父结点的转换
mCamera->getParentSceneNode()->detachObject(mCamera);
mCamNode = mSceneMgr->getSceneNode("CamNode2");
mCamNode->attachObject(mCamera);
//鼠标右键旋转摄像机
if(mMouse->getMouseState().buttonDown(OIS::MB_Right))
{
mCamNode->yaw(Degree(-mRotate * mMouse->getMouseState().X.rel), Node::TS_WORLD);
mCamNode->pitch(Degree(-mRotate * mMouse->getMouseState().Y.rel), Node::TS_LOCAL);
}