PueloGames
25-02-2008 07:27:38
how to zoom with mouse wheel?
this is the code:
myListener.h
...
bool PoolListener::mouseMoved(const OIS::MouseEvent &arg)
{
mGUIManager->injectMouseMove( arg.state.X.rel, arg.state.Y.rel);
mGUIManager->injectMouseWheelChange(arg.state.Z.rel);
return true;
}
...
game.h
...
mSheet->addEventHandler(QuickGUI::Widget::EVENT_MOUSE_WHEEL,&Pool::zoom,this);
...
...
void Pool::zoom(const QuickGUI::EventArgs& args)
{
mCamera->move(Ogre::Vector3(mCamera->getRealDirection().x,mCamera->getRealDirection().y+1,mCamera->getRealDirection().z));
}
...
the zoom always move when i move the mouse and the wheel.
thanks
this is the code:
myListener.h
...
bool PoolListener::mouseMoved(const OIS::MouseEvent &arg)
{
mGUIManager->injectMouseMove( arg.state.X.rel, arg.state.Y.rel);
mGUIManager->injectMouseWheelChange(arg.state.Z.rel);
return true;
}
...
game.h
...
mSheet->addEventHandler(QuickGUI::Widget::EVENT_MOUSE_WHEEL,&Pool::zoom,this);
...
...
void Pool::zoom(const QuickGUI::EventArgs& args)
{
mCamera->move(Ogre::Vector3(mCamera->getRealDirection().x,mCamera->getRealDirection().y+1,mCamera->getRealDirection().z));
}
...
the zoom always move when i move the mouse and the wheel.
thanks