four quick noobish questions

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.
omar shaaban
Posts: 616
Joined: Wed Nov 01, 2006 6:26 pm
Location: Cairo,Egypt
Contact:

Post by omar shaaban »

Elazul wrote:thanks for the reply, but can you tell me what variable type cpos is initilized as?

and should that code (or what's similar to it) be inside the event handler itself , or the jump=true part be inside the handler, and the rest inside the draw loop itself?

(just incase this makes a difference, im using irrlicht 1.3 , not 1.3.1)
Well cpos stands for the camera postion so it will be like that:

Code: Select all

vector3df * cpos=camera->getPostion();
And jump==true will be inside the handler when u press "space"
and the rest of the code as u said will be in the loop so it updates frequently
Elazul
Posts: 38
Joined: Fri Mar 23, 2007 4:47 pm

Post by Elazul »

i've tried it out, after fixing the syntax errors, and it doesn't really work, i don't understand why... regardless, thanks for the help.


Alf shokr ya me3alem :D
omar shaaban
Posts: 616
Joined: Wed Nov 01, 2006 6:26 pm
Location: Cairo,Egypt
Contact:

Post by omar shaaban »

Elazul wrote:i've tried it out, after fixing the syntax errors, and it doesn't really work, i don't understand why... regardless, thanks for the help.


Alf shokr ya me3alem :D
well can u post your code so i can see where is the error!
enta men masr wala ehhh makont te2ol men el2oaall 3al 3omoom eb3at el source beta3ak wana 7ashooof el moshkela 8)
BAnd
Posts: 12
Joined: Fri Jul 06, 2007 5:58 pm

Post by BAnd »

i used this stuf to make the FPS camera jump

Code: Select all

// add camera
	SKeyMap keyMap[9];
                 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,1200.f,-1, 
           keyMap, 9, false, 2);
	camera->setPosition(core::vector3df(10000,2000,10000));
	camera->setTarget(core::vector3df(2397*2,343*2,2700*2));
	camera->setFarValue(24000.0f);
Post Reply