Capping the mouse and jumping.

Hello everyone,

First of all, I don’t know if my title makes sense. But I have followed http://www.lloydgoodall.com/tutorials/first-person-camera-control-with-lwjgl/ in order to get a sort of FPS camera going.

It works aaalmost perfectly, but if you look for example too much up, I end up looking upside down, and I can spin all the way around. Does anyone know how to “cap” the axis at a specific point to prevent this?

Yet another question, I am using this code to move also. But is there anyone who knows how to jump? I guess there is a lot of velocity and stuff involved, but can anyone give a good example?

Thanks,

EDIT: Kind of fixed the capping now by adding if statements in the lookThrough method inside the Camera class. Just checked if the axis hit a specific angle and increasing / decreasing the pitch by respective angle. Quick and dirty fix and the camera is jittering, but it works.