I’m trying to implement a first person shooter camera, whose ViewYawMin/Max, ViewPitchMin/Max, ViewRollMin/Max would be calculated from character orientation instead of being fixed to world.
I’m using the dynamic gravity pull (1773) and trying to integrate it with the shooter game example. I’ve put in some tiny planets which you can walk around as they recalculate the player’s gravity, but I ran into some problems with the camera as it is limited to real world rotations instead of character up vector rotations.
Basically what I am thinking of is the following:
PlayerCameraManager.cpp has limitview functions for each cartesian axis that get called from ProcessViewRotation(). The limitview functions just clamp the angle inside the definable ViewPitchMin - View PitchMax -values.
My thought is to take these out and replace them with a calculation from the pawn’s up/forward/right vector (the pawn is aligning properly on the planet’s surface) so that there is a free movement around the up vector of the player, but restricted to +87 and -87 degrees on the right and forward vectors of the character. So basically there are virtual circles on the feet and head of the character that the center of the view can’t be rotated to (this helps me visualise it in 3D).
I can’t figure out how I should do this. I’ve been reading about quaternions and they seem to be one possibility, but I don’t understand them properly enough to use them.
Any ideas on how to go about this?