I'm making an application where I want two different cameras, one normal FPScam and a normal cameranode I'm moving arround like an overview camera.
Anyways... I want to use the same keys for both, and I just can't figure out how to do it.
I want the FPScamera to move with the default settings (arrowkeys and mouse) so so far I've just added it with the keymap paramaeter set to 0 (zero). So in my eventreciever class, before I make a case for KEY_LEFT, KEY_RIGHT, etc. I go through an if statement that checks the ID of the active camera before I check for eventtype and then do the switch statement.
Code: Select all
if(smgr->getActiveCamera()->getID() == 2)
{
if(event.EventType == EET_KEY_INPUT_EVENT && event.KeyInput.PressedDown)
{
switch(event.KeyInput.Key)
{
//Left
case KEY_LEFT:
{
Code: Select all
//snatched from the API
SKeyMap keyMap[8];
keyMap[0].Action = EKA_MOVE_FORWARD;
keyMap[0].KeyCode = KEY_UP;
keyMap[1].Action = EKA_MOVE_FORWARD;
keyMap[1].KeyCode = KEY_KEY_W;
keyMap[2].Action = EKA_MOVE_BACKWARD;
keyMap[2].KeyCode = KEY_DOWN;
keyMap[3].Action = EKA_MOVE_BACKWARD;
keyMap[3].KeyCode = KEY_KEY_S;
keyMap[4].Action = EKA_STRAFE_LEFT;
keyMap[4].KeyCode = KEY_LEFT;
keyMap[5].Action = EKA_STRAFE_LEFT;
keyMap[5].KeyCode = KEY_KEY_A;
keyMap[6].Action = EKA_STRAFE_RIGHT;
keyMap[6].KeyCode = KEY_RIGHT;
keyMap[7].Action = EKA_STRAFE_RIGHT;
keyMap[7].KeyCode = KEY_KEY_D;
camera = smgr->addCameraSceneNodeFPS(0, 60.0f, 20.0f, 1, keyMap, 0, true);
since the addCameraSceneNode doesn't take an eventrecieverparameter (woah! Long word), I'm kinda stuck... Any ideas?