Download

Camera Wibbly Wobbly Maths Stuff

Hey there everyone!

So this is a weird one.

I have a character inside a hollow sphere. Dynamic gravity enabled thanks to Xaklse.
When I run around the sphere the character follows the surface of the sphere very well, however the camera completely disregards the fact that the base pivot rotation of the character has technically changed.
As a result of this, as I reach an almost 90degree angle on a wall (in world relation), the camera can no longer “look” further upwards (or rather, backwards at this point).

I guess the camera needs to think, no matter what, it is always at X>0 Y>0 Z>0 and by doing so in theory it would never reach a max yaw/pitch etc etc
Side note, it would still need a max yaw and pitch otherwise the camera would become a UFO.

Any ideas?

Not sure if this is what causing this, but might be something to look at… in regards to rotation of items, I have found that some times items rotate at 0 - 180 degrees, and then from -180 to 0. (not 0 -360)… Try print stringing your rotation values and see if they go past 180.

Don’t you adjust the players position using the normals on the sphere?
The camera should beable to adjust

Unfortunately the rotation of the character is being handled by a plugin, so I haven’t even specified what it should do, rather, the plugin does. I’m thinking as a result of the plugin, the camera does not follow the same rulings.

The key issue here is the camera has this hidden global setting saying “Up is Up and Down is Down” as soon as the game hits runtime and no manner of rotation whether it be, character, capsule or camera, will change this setting (to my knowledge).
I’m also concerned about gimbal lock but I haven’t even gotten there yet.