Do I need to re-write OnEvent class?

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
Endar
Posts: 145
Joined: Mon Jun 14, 2004 7:59 am

Do I need to re-write OnEvent class?

Post by Endar »

Hey guys, I'm new to irrlicht and C++, and I was just trying to change the default keys for that move the FPS camera, like in the tutorial about collision detection.

I was just wondering if I had to re-write the OnEvent class, like in one of the other tutorials, or if I could change the keys without.

If I need to, any pointers or hints would be much appreciated. :D
Guest

Post by Guest »

see addCamaraSceneNodeFPS Online Help.
:wink:
addCameraSceneNode can set your own keymap when creating

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;
                   
                    camera = sceneManager->addCameraSceneNodeFPS(0, 100, 500, -1, keyMap, 8);
////////////////////////////////////////////////////////////////////////
zgock
http://www.zgock-lab.net/irrlicht/ (Irrlicht Tutorial in Japanese)
from Land with Bamboo and Ninja and Japanimations :wink:
Endar
Posts: 145
Joined: Mon Jun 14, 2004 7:59 am

Post by Endar »

Much appreciated zgock :D
Post Reply