about keymap,may somebody help me?

A forum to store posts deemed exceptionally wise and useful
Post Reply
q

about keymap,may somebody help me?

Post by q »



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
TheRLG
Posts: 372
Joined: Thu Oct 07, 2004 11:20 pm

Post by TheRLG »

ok 1st this post doesn't belong in FAQs, Howtos, and tool lists.

2nd, lets see ur code, from those errors it seems all botched up.
area51
Posts: 338
Joined: Thu Mar 18, 2004 10:20 pm
Location: UK
Contact:

Post by area51 »

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
Post Reply