First of all, is there any easy way to make jumping ability with the FPS camera? I checked the API and I noticed the the thing about upward movement but I wanted to make jumping activated my something like the spacebar and not by looking up. I saw that other topic in this forum about making an actor instead of a camera, but I have no idea how to do that and would like to avoid it if all possible.
EDIT:
I tried adding the lines
EDIT: Doof. I just saw and corrected my array size variable and it works fine now.
Code: Select all
keyMap[8].Action = EKA_JUMP_UP;
keyMap[8].KeyCode = KEY_SPACE;
Code: Select all
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;
keyMap[8].Action = EKA_JUMP_UP;
keyMap[8].KeyCode = KEY_SPACE;
scene::ICameraSceneNode* camera =
smgr->addCameraSceneNodeFPS(0, 100.0f, 300.0f, -1, keyMap, 9, true, .5f);
camera->setPosition(core::vector3df(0,150,0));
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
selector, camera, core::vector3df(30,50,30),
core::vector3df(0,-3.f,0),
core::vector3df(0,50,0));
camera->addAnimator(anim);
anim->drop();
Thanks for your time.