How to prevent 360* camera rotation?

I am trying to develope and proper camera that can be used in first person games on jme3. One problem that I have come across is that the camera can actually be panned upside down, resulting in you being able to walk around upside down. I have searched this forum for a solution, and spent many hours thinking and trying to find one, but I’ve given up and have come to ask you guys.

What I’m basically asking is: is there a way to restrict a camera so that it can only look straight down, and straight up. The code I am working with is from the HelloCollision.java sample. (https://docs.jmonkeyengine.org/beginner/hello_collision.html)

Thanks in advance.

You know you just need to search “Limit camera rotation” to find what you need.

Some links:

Oh lol, thanks. That second one solved my problem.

For anyone who is interested to see the finished first person camera I will post it soon once its done. :joy:

2 Likes