I was using the "Movement example 4" tutorial, and I understand the basic ideas, such as loading meshes, textures, setting up the camera, and basic movements of the camera. However, the movement I set up for the camera to move around with W S D A keys, which i set to move with WS: the Z coordinate, and DA: the X coordinate. However, it didn't quite work out exactly like I planned, because in FPS games, the rotation of the camera with the mouse also affects the direction of the X and Z coordinates. I was wondering if anyone had any example code to make movement more like an FPS rather than a strict X/Z coordinate in which there are only 4 directions.
Another problem is, right now, it ignores the walls, and clips thru them, and I suppose doesn't have any gravity. I was wondering if there was source code showing that too. I looked at an example FPS game, using irrlicht, but it was very complex, and didn't exactly make it clear. I would rather see the isolated snippets of code.
The last problem is, the Gun position. If the Gun is stationed, I would have to move it the same way I move the camera right? Or is there some other method?
Thanks for your help.
EDIT: I added the source code, and a screenshot of what it looks like. In the scr shot you can see that the gun is there, but it's not in the right position but i believe it does move as you move (at least it should).
Source: http://www.sharebigfile.com/file/23783/ ... t.rar.html
![Image](http://img235.imageshack.us/img235/8868/fpsguncp0.jpg)