I have keyboard rotation sort of working, but there must be a better way. What I've done for now is comment out the lines in the switchToNextScene() function that set [a] and [d] to EKA_STRAFE_LEFT and EKA_STRAFE_RIGHT.
Then, in the OnEvent() function, I have the following:
Code: Select all
if (event.EventType == EET_KEY_INPUT_EVENT && event.KeyInput.PressedDown == true)
{
if (event.KeyInput.Key == KEY_KEY_A)
{
FPScamera->setRotation(FPScamera->getRotation() + core::vector3df(0,-3,0));
}
else if (event.KeyInput.Key == KEY_KEY_D)
{
FPScamera->setRotation(FPScamera->getRotation() + core::vector3df(0,3,0));
}
FPScamera->OnEvent(event);
...
}
Can anyone help me on how I can add better keyboard support for rotation? I'm hoping it doesn't require serious mucking around with the engine source code.