why the SKeyMap take no effects?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
lancer_xjb
Posts: 11
Joined: Wed Mar 31, 2010 9:30 am

why the SKeyMap take no effects?

Post by lancer_xjb »

I announce a inherited onevent and create a FPS camera.

Code: Select all

      keymap[4].Action = irr::EKA_MOVE_FORWARD;
      keymap[4].KeyCode = irr::KEY_UP;
      keymap[6].Action = irr::EKA_STRAFE_LEFT;
      keymap[6].KeyCode = irr::KEY_LEFT;
      keymap[8].Action = irr::EKA_JUMP_UP;
      keymap[8].KeyCode = irr::KEY_SPACE;
   mygame->Camera = mygame->Device->getSceneManager()->addCameraSceneNodeFPS(0,100,0.5,-1,keymap,11,false,5,false);
KEY_LEFT takes effects while others don't. If KEY_SPACE is pressed, a OctTreeSceneNode will be recreated. I guess there are conflicts
between class OnEvent and keymap,but how to solve it?
yestoday is a history,tomorrow is a mystery,but today is a gift.That's why we call it the present.
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

The array indices in your code snippet do not make sense. Why start at 4 and skip 5 and 7 leaving uninitialised array elements? And don't forget to check that the keyMapSize parameter to the addCameraSceneNodeFPS function is correct - your seems to be set to 11 for nine elements...
lancer_xjb
Posts: 11
Joined: Wed Mar 31, 2010 9:30 am

Post by lancer_xjb »

it's just a omission of all. Actually ,I code complete.
yestoday is a history,tomorrow is a mystery,but today is a gift.That's why we call it the present.
lancer_xjb
Posts: 11
Joined: Wed Mar 31, 2010 9:30 am

Post by lancer_xjb »

After rebuilding the project,all is ok.I don't know why.
yestoday is a history,tomorrow is a mystery,but today is a gift.That's why we call it the present.
Post Reply