more realistic movement effect

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

more realistic movement effect

Post by game_manic »

I was trying to get a weapon of mine to move up and down alittle as i walked around, what i did was made a if statement, that get the input of my keys in my class and also a int up that equaled 0, but anyway as long as i am moving it should go up and down, but it doesn't :x :x

So if someone could see if they could solve the problem many thanks :D .
Guest

Post by Guest »

Just use addCameraSceneNode(), FPS varient addCameraSceneNodeFPS(), or the Mayan addCameraSceneNodeMaya()
It'll save you a bit of time.
Millers Drillers

Post by Millers Drillers »

First of all you arent supposed to ask questions in this forum. Second, he means bobble head effect. Just do it by altering some value... cant put my finger on it now tho....
Guest

Post by Guest »

The Irrlicht Demo example has what I think you're talking about. I'm currently looking through it now to find it.
Guest

Post by Guest »

Found it. You make a camera as you normally do, but add a keymap and number of keys to the function.
Ex. sm->addCameraSceneNodeFPS(0, rotSpeed, speed, identifer, keymap, keys);

And for keymap you make a keymap of SKeyMap type in an array of how many keys you need, then fill out the action and keycode for each key.
Ex.

Code: Select all

SKeyMap keyMap[8]; //keymap
//fill out the stuff, this makes a common FPS config
			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;
Hope that helps.
Guest

Post by Guest »

EDIT: the word config isn't code, it should be after the word FPS
Guest

Post by Guest »

I'm sorry I didn't realize what you were asking. So you want a bobbling effect for the camera.
I'm not sure, but maybe where the Action is you can add code there, probably seperated by a |. Or that may be just for the camera movement, I'm not sure.
Post Reply