Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Author Topic: onMouseStop kinda  (Read 422 times)

r4ccoon

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 1
    • View Profile
onMouseStop kinda
« on: April 04, 2010, 04:54:38 PM »

hei. i am using buffered mouse, and i am making like fps camera. i have them moving already.but the problem is when i dont move my mouse, it still moving.
hehe..
there is an event called mouseMoved()
and even though I have

Code: [Select]
if( ms.X.rel > 0 || ms.X.rel < 0)
mRotX = Ogre::Degree(-ms.X.rel * 0.13);
else
mRotX = 0;

if( ms.Y.rel > 0 || ms.Y.rel < 0)
mRotY = Ogre::Degree(-ms.Y.rel * 0.13);
else
mRotY = 0;


and it still moving when i dont move my mouse. how do i know that the mouse stopped moving, like what value is mouse is stop moving.

so if mRotX and mRotY are zero, the camera doesnt suppose to move.
thanks before
« Last Edit: April 04, 2010, 04:56:51 PM by r4ccoon »
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Re: onMouseStop kinda
« Reply #1 on: April 05, 2010, 07:00:41 AM »

Mouse is a little different to handle to keyboard. Where a keyboard you get a down than up event. Mouse will not come in with a relative movement of 0. I think off the top of my head, is you simple zero out the rotx/roty every frame after applying them to your camera you will be OK.
Logged