never mind ppl. i figured it out.
if you add an event reciever, you need to add a SKeyMap[] to your camera for it to move via user input.
Code: Select all
SKeyMap keyMap[8];
keyMap[0].Action = EKA_MOVE_FORWARD; // what the key does
keyMap[0].KeyCode = KEY_UP; // what the key is
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;
then when you add your camera:
Code: Select all
camera = scenemgr -> addCameraSceneNodeFPS( 0, 100.0f, 300.0, -1, keyMap, 8 );
then inside your OnEvent(SEvent event) method. ( this is your event reciever. check the tutorials for more info. )
Code: Select all
if ( device -> getSceneManager() -> getActiveCamera() ) {
device -> getSceneManager() -> getActiveCamera() -> OnEvent( event );
return true;
}
jumping and crouching support are not built in, and must be created in your event reciever.
There's a crack in everything -- That's how the light gets in.