I was trying to get a weapon of mine to move up and down alittle as i walked around, what i did was made a if statement, that get the input of my keys in my class and also a int up that equaled 0, but anyway as long as i am moving it should go up and down, but it doesn't
So if someone could see if they could solve the problem many thanks .
more realistic movement effect
Found it. You make a camera as you normally do, but add a keymap and number of keys to the function.
Ex. sm->addCameraSceneNodeFPS(0, rotSpeed, speed, identifer, keymap, keys);
And for keymap you make a keymap of SKeyMap type in an array of how many keys you need, then fill out the action and keycode for each key.
Ex.
Hope that helps.
Ex. sm->addCameraSceneNodeFPS(0, rotSpeed, speed, identifer, keymap, keys);
And for keymap you make a keymap of SKeyMap type in an array of how many keys you need, then fill out the action and keycode for each key.
Ex.
Code: Select all
SKeyMap keyMap[8]; //keymap
//fill out the stuff, this makes a common FPS config
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;