i admit that i'm greener than green at using jme but i've been using the first person controller and wanted to limit the up and down range of movement in the camera. For example, i want the character to be able to look at his feet but not to look backwards upside down through his arse hole.
To do this i figured that i'd need to change the KeyLookUpAction.performAction code:
now, my math is going to need brushing up, but is there an easy way to get the angle in regard to the world axis that the camera is rotated? ie up and down rotation?
do you think i should keep a matrix3f or a quaternion or calculate the angle each time through?
BUT ... the problem is that the user can quickly spin the camera all the way around so that the camera returns to the correct angle range ... i can fix that tho.
is there a better way that anyone can think of that doesn't require so much math?
I don't quite understand your problem… Do you want to limit the angle range of the camera for both movements?
If so, then I would suggest writing your own controller so you will have more freedom as to what to allow. As you have already discovered, Camera has methods for getting the up vector direction, that means you can simply apply a dot product to get the angle between that vector and your favorite one (for instance a y-axis unit vector). That would let you decide whether the camera is pointing too much in one direction or not.
Well, you really don't have to do it that way. Camera has a method called lookAt() you could use to set the direction if the angle is outside range. It will require some calculations, but they are not that complicated.