Ogre Version: : 3.0: Operating System: : windows 11: Render System: : any :
Hi,
I'm having an issue with my application.
I am trying to make it so that i can look around with the mouse movement.
On the samples i found the code on how to do this but when i try this it is really twitchy.
So when i move the mouse a small amount it moves the game like crazy.
I checked it with multiple fps but it stays the same
I can slow it down by multiplying the width and height by 10 but then the movement seems to lag behind
Does anybody know how to do this correct or improve this?
We don't see the call to OgreGame::Camera::setOrientation() but I assume you pass it mCameraYaw and mCameraPitch. Those two variables, unless you are clearing them each frame, are the accumulated absolute angles (because of the += operator). But the Camera::yaw() and Camera::pitch() functions expect delta angles and apply them to the existing orientation.
Yeah you are right
I was just looking at it again and indeed i was adding them so it accumulated the angles and went crazy
So just removed the + and assigned the direct and it now works
Also when doing things like that, use delta time to make movement less choppy and more predictable.
Actually, I do not think that is correct.
Since the movement of the mouse is absolute (say for example, 200 pixels to the right), rotating the camera could be instant with just that value in mind.
Multiplying it with delta time would make it incorrect, as your camera movement would then be faster when on a low FPS.
If they are after a first person mouse look (such as in Counter Strike), delta time should not be used.
Also when doing things like that, use delta time to make movement less choppy and more predictable.
Actually, I do not think that is correct.
Since the movement of the mouse is absolute (say for example, 200 pixels to the right), rotating the camera could be instant with just that value in mind.
Multiplying it with delta time would make it incorrect, as your camera movement would then be faster when on a low FPS.
If they are after a first person mouse look (such as in Counter Strike), delta time should not be used.
You are right, I was speaking about motion controller in general, FPS rotation does not need this. Third person rotation needs this only for specific cases. delta time is mostly for other things.