about keymap,may somebody help me?
about keymap,may somebody help me?
why when I use the class SkeyMap,errors comes up like these:
error C2466: cannot allocate an array of constant size 0
error C2143: syntax error : missing ';' before '.'
error C2501: 'keyMap' : missing storage-class or type specifiers
error C2371: 'keyMap' : redefinition; different basic types
see declaration of 'keyMap'
error C2143: syntax error : missing ';' before '.'
error C2466: cannot allocate an array of constant size 0
Code: Select all
SKeyMap keyMap[8];
keyMap[1].Action = EKA_MOVE_FORWARD;
keyMap[1].KeyCode = KEY_KEY_W;
keyMap[3].Action = EKA_MOVE_BACKWARD;
keyMap[3].KeyCode = KEY_KEY_S;
keyMap[5].Action = EKA_STRAFE_LEFT;
keyMap[5].KeyCode = KEY_KEY_A;
keyMap[7].Action = EKA_STRAFE_RIGHT;
keyMap[7].KeyCode = KEY_KEY_D;
Add the keymap to the camera:
Code: Select all
scene::ICameraSceneNode* camera = 0;
camera = smgr->addCameraSceneNodeFPS(0,80.0f,300.0f,-1, keyMap, 8);
N02 vaporizer